testserver/Spigot-Server-Patches/0307-Reset-players-airTicks...

31 lines
1.4 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 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 f3b69a5eb5d15738d7061e10643ace23bd3718c4..f13cb4fec9da1773729630bc0e8bd01ba7bb9344 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2249,6 +2249,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
+ public final int getMaxAirTicks() { return bG(); } // Paper - OBFHELPER
public int bG() {
return 300;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index d1f716067e6c71f523c7561b9ef92f4296d1a726..01d679cfa6ad8f5dc5bb4539197a59cb00c65337 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1997,6 +1997,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);