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/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -0,0 +0,0 @@ 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; } @@ -0,0 +0,0 @@ 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); diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java @@ -0,0 +0,0 @@ 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 }