PaperMC/Spigot-Server-Patches/0322-Reset-players-airTicks-on-respawn.patch

34 lines
1.3 KiB
Diff
Raw Normal View History

From d32552a87b14d231a96e10bbb937a07618f44df6 Mon Sep 17 00:00:00 2001
From: GreenMeanie <GreenMeanieMC@gmail.com>
Date: Sat, 20 Oct 2018 22:34:02 -0400
Subject: [PATCH] Reset players airTicks on respawn
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 905d2be5e..95d73fd6e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2326,6 +2326,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
+ public int getMaxAirTicks() { return bw(); } // Paper - OBFHELPER
public int bw() {
return 300;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 70c9a41ee..2301efa51 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1859,6 +1859,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
this.setHealth(this.getMaxHealth());
+ this.setAirTicks(this.getMaxAirTicks()); // Paper
this.fireTicks = 0;
this.fallDistance = 0;
this.foodData = new FoodMetaData(this);
--
2019-12-13 21:41:01 +01:00
2.24.1