2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2017-02-19 01:34:46 +00: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
|
2021-02-16 17:08:29 +00:00
|
|
|
index 4870a6f9f894b2c9d0fea83dad0808ac6448f808..e17637cfee773b1b79c05d7a8e6558963c7a9c14 100644
|
2017-02-19 01:34:46 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2020-12-21 07:56:22 +00:00
|
|
|
@@ -837,5 +837,10 @@ public class EntityArmorStand extends EntityLiving {
|
2019-04-27 06:26:04 +00:00
|
|
|
super.move(moveType, vec3d);
|
2017-02-19 01:34:46 +00: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
|
2021-02-16 17:08:29 +00:00
|
|
|
index c2c5dbba5cc048e8fa2a4a383737330adf7b7663..2dfa2abf37994a72dfdfcc38e032626247b43fd7 100644
|
2017-02-19 01:34:46 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-09-02 09:12:25 +00:00
|
|
|
@@ -245,6 +245,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 01:34:46 +00:00
|
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
|
|
}
|
|
|
|
|
2020-11-03 02:22:15 +00:00
|
|
|
+ public boolean canBreatheUnderwater() { return this.cM(); } // Paper - OBFHELPER
|
|
|
|
public boolean cM() {
|
2018-07-18 00:08:13 +00:00
|
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
2017-02-19 01:34:46 +00:00
|
|
|
}
|
2020-09-02 09:12:25 +00:00
|
|
|
@@ -288,7 +289,7 @@ public abstract class EntityLiving extends Entity {
|
2017-02-19 01:34:46 +00:00
|
|
|
|
|
|
|
if (this.isAlive()) {
|
2020-06-25 13:11:48 +00: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 02:22:15 +00:00
|
|
|
- if (!this.cM() && !MobEffectUtil.c(this) && !flag1) {
|
2019-06-25 01:47:58 +00: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 01:34:46 +00:00
|
|
|
if (this.getAirTicks() == -20) {
|
|
|
|
this.setAirTicks(0);
|