2019-04-22 21:36:14 +00:00
|
|
|
From acb04e7af931a4ae09b5ac254c3e29220e1976fd Mon Sep 17 00:00:00 2001
|
2017-02-19 01:34:46 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.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
|
2019-04-22 21:36:14 +00:00
|
|
|
index b570882340..694df9e185 100644
|
2017-02-19 01:34:46 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2018-12-08 10:09:55 +00:00
|
|
|
@@ -763,5 +763,10 @@ public class EntityArmorStand extends EntityLiving {
|
2017-02-19 01:34:46 +00:00
|
|
|
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
|
2019-04-22 21:36:14 +00:00
|
|
|
index 34fbf83621..138a224e04 100644
|
2017-02-19 01:34:46 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2018-08-04 21:03:53 +00:00
|
|
|
@@ -202,6 +202,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 01:34:46 +00:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2018-07-22 05:27:46 +00:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.ca(); } // Paper - OBFHELPER
|
|
|
|
public boolean ca() {
|
2018-07-18 00:08:13 +00:00
|
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
2017-02-19 01:34:46 +00:00
|
|
|
}
|
2018-08-04 21:03:53 +00:00
|
|
|
@@ -236,7 +237,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 01:34:46 +00:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2018-08-26 18:11:49 +00:00
|
|
|
if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) {
|
2018-07-22 05:27:46 +00:00
|
|
|
- if (!this.ca() && !MobEffectUtil.c(this) && !flag1) {
|
|
|
|
+ if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden
|
2018-08-26 18:11:49 +00:00
|
|
|
this.setAirTicks(this.k(this.getAirTicks()));
|
2017-02-19 01:34:46 +00:00
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|
|
|
|
--
|
2019-03-20 01:46:00 +00:00
|
|
|
2.21.0
|
2017-02-19 01:34:46 +00:00
|
|
|
|