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

34 lines
1.3 KiB
Diff
Raw Normal View History

2019-12-13 21:41:01 +01:00
From 7c1513e669c5fad4b1a3c3e799b3447c28c2683b 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 5d31068d7..365984bb8 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
2019-12-13 21:41:01 +01:00
index de11e1249..8eb20424f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2019-12-12 19:45:00 +01:00
@@ -1831,6 +1831,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