diff options
author | Jakub Zacek <[email protected]> | 2024-07-15 23:35:51 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-15 17:35:51 -0400 |
commit | 2cd8c461af74f0a524878dcdffba86cd105c48c6 (patch) | |
tree | ac107a76fe3d6cdd2e6ef5804ef3cba152957e4c /patches/server/0792-Flying-Fall-Damage.patch | |
parent | b57b24d549c65ddc5eb3edcc1ecc6aad2826dbd8 (diff) | |
download | Paper-2cd8c461af74f0a524878dcdffba86cd105c48c6.tar.gz Paper-2cd8c461af74f0a524878dcdffba86cd105c48c6.zip |
Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897)
Diffstat (limited to 'patches/server/0792-Flying-Fall-Damage.patch')
-rw-r--r-- | patches/server/0792-Flying-Fall-Damage.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patches/server/0792-Flying-Fall-Damage.patch b/patches/server/0792-Flying-Fall-Damage.patch new file mode 100644 index 0000000000..4132811a77 --- /dev/null +++ b/patches/server/0792-Flying-Fall-Damage.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: TreyRuffy <[email protected]> +Date: Fri, 27 May 2022 02:26:08 -0600 +Subject: [PATCH] Flying Fall Damage + + +diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java +index ad334f149fe1b44d4ebe48489dcd2811ff1b5cd0..950ce40d268d89ff3c503116081db6c9ccd65329 100644 +--- a/src/main/java/net/minecraft/world/entity/player/Player.java ++++ b/src/main/java/net/minecraft/world/entity/player/Player.java +@@ -196,6 +196,7 @@ public abstract class Player extends LivingEntity { + private boolean ignoreFallDamageFromCurrentImpulse; + private int currentImpulseContextResetGraceTime; + public boolean affectsSpawning = true; // Paper - Affects Spawning API ++ public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage + + // CraftBukkit start + public boolean fauxSleeping; +@@ -1693,7 +1694,7 @@ public abstract class Player extends LivingEntity { + + @Override + public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { +- if (this.abilities.mayfly) { ++ if (this.abilities.mayfly && !this.flyingFallDamage.toBooleanOrElse(false)) { // Paper - flying fall damage + return false; + } else { + if (fallDistance >= 2.0F) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 682c5e9328d965bf335bb06ac7aedf6d49b1c6cb..4bcceef859099405a3d78bc7e6b12c778e906d72 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -2581,6 +2581,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + this.getHandle().onUpdateAbilities(); + } + ++ // Paper start - flying fall damage ++ @Override ++ public void setFlyingFallDamage(@NotNull net.kyori.adventure.util.TriState flyingFallDamage) { ++ getHandle().flyingFallDamage = flyingFallDamage; ++ } ++ ++ @NotNull ++ @Override ++ public net.kyori.adventure.util.TriState hasFlyingFallDamage() { ++ return getHandle().flyingFallDamage; ++ } ++ // Paper end - flying fall damage ++ + @Override + public int getNoDamageTicks() { + if (this.getHandle().spawnInvulnerableTime > 0) { |