Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
716db7fb5e
Helps with development to not need to cast as much... No clue why upstream makes some of the decisions they do....
46 Zeilen
2.0 KiB
Diff
46 Zeilen
2.0 KiB
Diff
From 68dd2f248cc7e8ac0f3fc7aae5a87f9520ea8b16 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 578d966401..e9a746f138 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
@@ -764,5 +764,10 @@ public class EntityArmorStand extends EntityLiving {
|
|
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
|
|
index 5da05c0825..169ad7619e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -202,6 +202,7 @@ public abstract class EntityLiving extends Entity {
|
|
super.a(d0, flag, iblockdata, blockposition);
|
|
}
|
|
|
|
+ public boolean canBreatheUnderwater() { return this.ca(); } // Paper - OBFHELPER
|
|
public boolean ca() {
|
|
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
|
}
|
|
@@ -236,7 +237,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
if (this.isAlive()) {
|
|
if (this.a(TagsFluid.a) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) {
|
|
- if (!this.ca() && !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.18.0
|
|
|