Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-16 11:30:06 +01:00
31 Zeilen
1.4 KiB
Diff
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/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
index d750c814ca3b7dc7df7f87de3e360235849c000b..ae5fe4f71ea1cc231e5d87920c2243f4f4f581f1 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -2152,6 +2152,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);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 2fc25a13a554174d2b5f415c910c4a26e37b30e1..f102ecb56ac04a5b840fa52e6d1ff9604598d58d 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2350,6 +2350,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
|
|
}
|
|
|
|
+ public final int getMaxAirTicks() { return bH(); } // Paper - OBFHELPER
|
|
public int bH() {
|
|
return 300;
|
|
}
|