2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
2021-06-11 08:29:15 +02:00
|
|
|
index dd9c51b28e32389429887e9c9cef0a554eff8a40..036577b0237e9c8a7ab22ede7477eefa1abecf96 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
|
|
@@ -338,6 +338,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2020-11-03 03:22:15 +01: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
|
|
|
}
|
2021-03-16 08:19:45 +01:00
|
|
|
@@ -381,7 +382,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 02:34:46 +01:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2020-06-25 15:11:48 +02:00
|
|
|
if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) {
|
2020-11-03 03:22:15 +01:00
|
|
|
- if (!this.cM() && !MobEffectUtil.c(this) && !flag1) {
|
2019-06-25 03:47:58 +02:00
|
|
|
+ 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);
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
2021-03-16 14:04:28 +01:00
|
|
|
index 2ef991aa7f739d3577fbbf4386064557e8f7c904..57e0ea95df34fab22d6c5868ab839d56a3fa85fc 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
2021-03-16 14:04:28 +01:00
|
|
|
@@ -872,5 +872,10 @@ public class EntityArmorStand extends EntityLiving {
|
2021-03-16 08:19:45 +01:00
|
|
|
super.move(moveType, vec3d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean canBreatheUnderwater() { // Skips a bit of damage handling code, probably a micro-optimization
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
}
|