From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown 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 41aedbbe52761f79512a0676b096a1f8a9a49396..96c229e5dd214d32478fe4d5b96e77d8ba2bc93c 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -830,5 +830,10 @@ public class EntityArmorStand extends EntityLiving { super.move(moveType, vec3d); } } + + @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 1b23da5c34704bbc00dd050bdf418a937002d784..f52c2faa42c45d1d8acf7002c306a7de3aadcb86 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -245,6 +245,7 @@ public abstract class EntityLiving extends Entity { super.a(d0, flag, iblockdata, blockposition); } + public boolean canBreatheUnderwater() { return this.cM(); } // Paper - OBFHELPER public boolean cM() { return this.getMonsterType() == EnumMonsterType.UNDEAD; } @@ -288,7 +289,7 @@ public abstract class EntityLiving extends Entity { if (this.isAlive()) { if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) { - if (!this.cM() && !MobEffectUtil.c(this) && !flag1) { + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden this.setAirTicks(this.l(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0);