Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
Do not let ArmorStands drown under water
Dieser Commit ist enthalten in:
Ursprung
ae98591b8c
Commit
85aa230650
45
Spigot-Server-Patches/0212-Do-not-let-armorstands-drown.patch
Normale Datei
45
Spigot-Server-Patches/0212-Do-not-let-armorstands-drown.patch
Normale Datei
@ -0,0 +1,45 @@
|
||||
From 5f475dbcb1673dd21d6632794127e29ff1a96f55 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 7738ca3..5818aa5 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -772,5 +772,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 6ac6a40..9474b2a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -188,6 +188,7 @@ public abstract class EntityLiving extends Entity {
|
||||
super.a(d0, flag, iblockdata, blockposition);
|
||||
}
|
||||
|
||||
+ public boolean canBreatheUnderwater() { return this.bF(); } // Paper - OBFHELPER
|
||||
public boolean bF() {
|
||||
return false;
|
||||
}
|
||||
@@ -222,7 +223,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
if (this.isAlive()) {
|
||||
if (this.a(Material.WATER)) {
|
||||
- if (!this.bF() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) {
|
||||
+ if (!this.canBreatheUnderwater() && !this.hasEffect(MobEffects.WATER_BREATHING) && !flag1) { // Paper - Use obfhelper
|
||||
this.setAirTicks(this.d(this.getAirTicks()));
|
||||
if (this.getAirTicks() == -20) {
|
||||
this.setAirTicks(0);
|
||||
--
|
||||
2.9.3
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren