testserver/Spigot-Server-Patches/0306-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 9a3be0671275720821d8707e7e083027b7503aa5..4c96d3db6d0e97def4c04a4ec45cdab9d040fbe3 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2250,6 +2250,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 868dcb4b43a7d82f9df58742da6d5cd7ca5fdcc7..9717ae9ead12eae7ad258b1a9d8b63c21945d934 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);