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 da4f0ef74898eb327449f0dccb34afb63235b3b1..aaa4f3e26f52fd978ca421d2339627b9647c18e2 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1996,6 +1996,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);