From f17c296756134cf61b14a9c748b2ba8fa1144ccf Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 18 Feb 2017 19:34:46 -0600 Subject: [PATCH] Do not let ArmorStands drown under water --- .../Do-not-let-armorstands-drown.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Spigot-Server-Patches/Do-not-let-armorstands-drown.patch diff --git a/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch new file mode 100644 index 0000000000..aaa7805a5b --- /dev/null +++ b/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Sat, 18 Feb 2017 19:29:58 -0600 +Subject: [PATCH] Do not let armorstands drown + + +diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/server/EntityArmorStand.java +@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { + super.move(moveType, x, y, z); + } + } ++ ++ @Override ++ public boolean canBreatheUnderwater() { // Skips a bit of damage handling code, probably a micro-optimization ++ return true; ++ } + // Paper end + } +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { + super.a(d0, flag, iblockdata, blockposition); + } + ++ public boolean canBreatheUnderwater() { return this.bF(); } // Paper - OBFHELPER + public boolean bF() { + return false; + } +@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { + + if (this.isAlive()) { + if (this.a(Material.WATER)) { +- if (!this.bF() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) { ++ if (!this.canBreatheUnderwater() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) { // Paper - Use obfhelper + this.setAirTicks(this.d(this.getAirTicks())); + if (this.getAirTicks() == -20) { + this.setAirTicks(0); +-- \ No newline at end of file