2019-08-31 21:30:44 +02:00
|
|
|
From 2f2e638edbbacbf9356bc1679b56ac781e14df12 Mon Sep 17 00:00:00 2001
|
2017-02-19 02:34:46 +01: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-08-31 21:30:44 +02:00
|
|
|
index 3e78b152f..9e6633a1b 100644
|
2017-02-19 02:34:46 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2019-08-31 21:30:44 +02:00
|
|
|
@@ -810,5 +810,10 @@ public class EntityArmorStand extends EntityLiving {
|
2019-04-27 08:26:04 +02:00
|
|
|
super.move(moveType, vec3d);
|
2017-02-19 02:34:46 +01: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-08-31 21:30:44 +02:00
|
|
|
index 79edb3b3c..a016cbb21 100644
|
2017-02-19 02:34:46 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2019-04-27 08:26:04 +02:00
|
|
|
@@ -223,6 +223,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2019-06-25 03:47:58 +02:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.cm(); } // Paper - OBFHELPER
|
|
|
|
public boolean cm() {
|
2018-07-18 02:08:13 +02:00
|
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
2017-02-19 02:34:46 +01:00
|
|
|
}
|
2019-05-28 01:01:45 +02:00
|
|
|
@@ -262,7 +263,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2018-08-26 20:11:49 +02: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-06-25 03:47:58 +02:00
|
|
|
- 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()));
|
2017-02-19 02:34:46 +01:00
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|
|
|
|
--
|
2019-08-31 21:30:44 +02:00
|
|
|
2.23.0
|
2017-02-19 02:34:46 +01:00
|
|
|
|