3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch

31 Zeilen
1.4 KiB
Diff

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 4e3ea0a00b903b09e2f4d62a330f9faf5ff15f67..58ecc49ba91cdb9c100ce3319434f2110b9a5892 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2256,6 +2256,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
2020-06-25 16:09:55 +02:00
+ public int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER
public int bD() {
return 300;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f64a83a6a9f8aaa0c1bbd6c2e3d0af28c06cbbd6..6bdbe8081689c55a61e133c7b4d3d06d0c507d50 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -2027,6 +2027,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);