mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
b6925c36af
This is now default vanilla behavior Fixes #3644
43 lines
2.1 KiB
Diff
43 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 3571ef9ac1299702ad274aad43070abf959bf9d9..0232ffba7b18174e0ce44d91285541a9869d07b9 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
@@ -826,5 +826,10 @@ public class EntityArmorStand extends EntityLiving {
|
|
super.move(moveType, vec3d);
|
|
}
|
|
}
|
|
+
|
|
+ @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
|
|
index 0799f3b025c25204fddfd818b314ec1452a1ba1a..34f2821a64c7893ff0a8c33ae4b77ce883227f0c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -244,6 +244,7 @@ public abstract class EntityLiving extends Entity {
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
}
|
|
|
|
+ public boolean canBreatheUnderwater() { return this.cL(); } // Paper - OBFHELPER
|
|
public boolean cL() {
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
|
}
|
|
@@ -287,7 +288,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
if (this.isAlive()) {
|
|
if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) {
|
|
- if (!this.cL() && !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()));
|
|
if (this.getAirTicks() == -20) {
|
|
this.setAirTicks(0);
|