Paper/patches/server/0277-Reset-players-airTicks-on-respawn.patch
Spottedleaf 41647af74c Do not use worldgen executor for api profile completions
We cannot put blocking network I/O onto the worldgen threads,
this will crash the server if it stalls
2022-07-03 14:55:56 -07:00

19 lines
942 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 541029d263f55588ae0f232e2692c7218e471f6f..15b9186ad0e52a55a3f523e4f1d96ef34ca99145 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2293,6 +2293,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.remainingFireTicks = 0;
this.fallDistance = 0;
this.foodData = new FoodData(this);