2018-07-23 10:39:55 +02:00
|
|
|
From 224496958b947329bcbcf013a4f9492ba7f109d7 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
|
2018-07-23 10:39:55 +02:00
|
|
|
index 578d966401..e9a746f138 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
|
2018-07-18 02:08:13 +02:00
|
|
|
@@ -764,5 +764,10 @@ public class EntityArmorStand extends EntityLiving {
|
2017-02-19 02:34:46 +01: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
|
2018-07-23 10:39:55 +02:00
|
|
|
index 3b4867bfc9..b596a616fe 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
|
2018-07-20 21:57:43 +02:00
|
|
|
@@ -201,6 +201,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2018-07-22 07:27:46 +02:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.ca(); } // Paper - OBFHELPER
|
|
|
|
public boolean ca() {
|
2018-07-18 02:08:13 +02:00
|
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
2017-02-19 02:34:46 +01:00
|
|
|
}
|
2018-07-20 21:57:43 +02:00
|
|
|
@@ -235,7 +236,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2018-07-18 02:08:13 +02:00
|
|
|
if (this.a(TagsFluid.a) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) {
|
2018-07-22 07:27:46 +02:00
|
|
|
- if (!this.ca() && !MobEffectUtil.c(this) && !flag1) {
|
|
|
|
+ if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden
|
2018-07-18 02:08:13 +02:00
|
|
|
this.setAirTicks(this.l(this.getAirTicks()));
|
2017-02-19 02:34:46 +01:00
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|
|
|
|
--
|
2018-07-20 21:57:43 +02:00
|
|
|
2.18.0
|
2017-02-19 02:34:46 +01:00
|
|
|
|