2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-22 21:25:48 +02:00
|
|
|
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
|
2020-06-26 08:29:44 +02:00
|
|
|
index a704feb0c19b56964d017f9e0ea3f26bc3e975f8..41c14d367e0b51e109001167d3c7b40676f364b8 100644
|
2018-10-22 21:25:48 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-06-26 03:58:00 +02:00
|
|
|
@@ -2256,6 +2256,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2018-10-22 21:25:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-06-25 16:09:55 +02:00
|
|
|
+ public int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER
|
|
|
|
public int bD() {
|
2018-10-22 21:25:48 +02:00
|
|
|
return 300;
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2020-06-26 03:58:00 +02:00
|
|
|
index f64a83a6a9f8aaa0c1bbd6c2e3d0af28c06cbbd6..6bdbe8081689c55a61e133c7b4d3d06d0c507d50 100644
|
2018-10-22 21:25:48 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
2020-06-26 03:58:00 +02:00
|
|
|
@@ -2027,6 +2027,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
2018-10-22 21:25:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
this.setHealth(this.getMaxHealth());
|
|
|
|
+ this.setAirTicks(this.getMaxAirTicks()); // Paper
|
|
|
|
this.fireTicks = 0;
|
|
|
|
this.fallDistance = 0;
|
|
|
|
this.foodData = new FoodMetaData(this);
|