2019-06-14 10:27:40 +08:00
|
|
|
From c02767e8da2a6471be996d0edde117a2831755a1 Mon Sep 17 00:00:00 2001
|
2017-02-19 09:34:46 +08: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-05-28 07:01:45 +08:00
|
|
|
index 1ae3ffa666..81226d6042 100644
|
2017-02-19 09:34:46 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2019-05-26 09:56:30 +08:00
|
|
|
@@ -798,5 +798,10 @@ public class EntityArmorStand extends EntityLiving {
|
2019-04-27 14:26:04 +08:00
|
|
|
super.move(moveType, vec3d);
|
2017-02-19 09:34:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @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-06-06 23:36:57 +08:00
|
|
|
index 5e58930e81..ed528faada 100644
|
2017-02-19 09:34:46 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2019-04-27 14:26:04 +08:00
|
|
|
@@ -223,6 +223,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 09:34:46 +08:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2019-04-27 14:26:04 +08:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.cl(); } // Paper - OBFHELPER
|
|
|
|
public boolean cl() {
|
2018-07-18 08:08:13 +08:00
|
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
2017-02-19 09:34:46 +08:00
|
|
|
}
|
2019-05-28 07:01:45 +08:00
|
|
|
@@ -262,7 +263,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 09:34:46 +08:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2018-08-27 02:11:49 +08:00
|
|
|
if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) {
|
2019-04-27 14:26:04 +08:00
|
|
|
- if (!this.cl() && !MobEffectUtil.c(this) && !flag1) {
|
2018-07-22 13:27:46 +08:00
|
|
|
+ if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden
|
2018-08-27 02:11:49 +08:00
|
|
|
this.setAirTicks(this.k(this.getAirTicks()));
|
2017-02-19 09:34:46 +08:00
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|
|
|
|
--
|
2019-03-20 09:46:00 +08:00
|
|
|
2.21.0
|
2017-02-19 09:34:46 +08:00
|
|
|
|