3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

add comment explaining logic

Dieser Commit ist enthalten in:
radsteve 2024-07-12 20:19:27 +02:00
Ursprung a5ac40d6b8
Commit 946d15cc3b

Datei anzeigen

@ -5,15 +5,16 @@ Subject: [PATCH] Item stack name tooltip API
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 9d1e68c09fa7093cf0f6fa636f90cb15a44cbb38..3b74464b2c0300a252bac22897f61050500b2189 100644
index 9d1e68c09fa7093cf0f6fa636f90cb15a44cbb38..4384869b79539c9e424b20bd656b67160a475b77 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -805,6 +805,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@@ -805,6 +805,19 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
this.trackEnteredOrExitedLavaOnVehicle();
this.updatePlayerAttributes();
this.advancements.flushDirty(this);
+
+ // Paper start - Item stack name tooltip API
+ // This is taken from net.minecraft.client.gui.Gui#tick and adapted to a non-tick behaviour.
+ ItemStack selectedStack = this.getInventory().getSelected();
+ if(selectedStack.isEmpty()) {
+ lastItemStackChangeTime = 0;
@ -27,7 +28,7 @@ index 9d1e68c09fa7093cf0f6fa636f90cb15a44cbb38..3b74464b2c0300a252bac22897f61050
}
private void updatePlayerAttributes() {
@@ -2944,4 +2956,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@@ -2944,4 +2957,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
return (CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end