2018-07-04 09:55:24 +02:00
|
|
|
From d93e6f8c98d66ccad03bb24a8f89c3af11a60422 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-04 09:55:24 +02:00
|
|
|
index ee3d37a71..df0d66ad0 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
|
2017-10-13 23:07:48 +02:00
|
|
|
@@ -779,5 +779,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-04 09:55:24 +02:00
|
|
|
index c97ee68a5..44335fd2d 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
|
2017-11-08 17:13:57 +01:00
|
|
|
@@ -195,6 +195,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2017-06-08 16:16:51 +02:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.bN(); } // Paper - OBFHELPER
|
|
|
|
public boolean bN() {
|
2017-02-19 02:34:46 +01:00
|
|
|
return false;
|
|
|
|
}
|
2017-11-08 17:13:57 +01:00
|
|
|
@@ -229,7 +230,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
|
|
|
if (this.a(Material.WATER)) {
|
2017-06-08 16:16:51 +02:00
|
|
|
- if (!this.bN() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) {
|
2017-05-14 20:05:01 +02:00
|
|
|
+ if (!this.canBreatheUnderwater() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) {
|
2017-02-19 02:34:46 +01:00
|
|
|
this.setAirTicks(this.d(this.getAirTicks()));
|
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|
|
|
|
--
|
2018-07-04 09:55:24 +02:00
|
|
|
2.18.0
|
2017-02-19 02:34:46 +01:00
|
|
|
|