Paper/patches/server/0273-Reset-players-airTicks-on-respawn.patch
2023-09-21 15:26:51 -07:00

19 lines
944 B
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/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ddc3522e38b3bafb3c3b32492d842d588efd1495..10044e1d596665b8f8b88f0baf1c61c8d3af0c4e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2414,6 +2414,7 @@ public class ServerPlayer extends Player {
this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset
+ this.setAirSupply(this.getMaxAirSupply()); // Paper
this.setRemainingFireTicks(0);
this.fallDistance = 0;
this.foodData = new FoodData(this);