mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-10 12:50:28 +01:00
57dd397155
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
46 lines
2.0 KiB
Diff
46 lines
2.0 KiB
Diff
From 7ec60a5af380c5e04364415e3b8d9f7ca0e4cace 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 176af6c889..992d7bfb0f 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 639d113de3..e6b48cc0ea 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -227,6 +227,7 @@ public abstract class EntityLiving extends Entity {
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
}
|
|
|
|
+ public boolean canBreatheUnderwater() { return this.cB(); } // Paper - OBFHELPER
|
|
public boolean cB() {
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
|
}
|
|
@@ -266,7 +267,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
if (this.isAlive()) {
|
|
if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).getBlock() != Blocks.BUBBLE_COLUMN) {
|
|
- if (!this.cB() && !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);
|
|
--
|
|
2.26.2
|
|
|