From 6c6a87e6c29bff2d425592a18375a3cf7d2b907e Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 20 Oct 2024 19:34:48 +0200 Subject: [PATCH] Fix entity destruction packet write method in HoverText.java Updated the destroyPacket to utilize getIntLists(). This change ensures proper handling of entity IDs in line with the necessary method for destroying entities. --- src/main/java/com/alttd/halloween/leaderboard/HoverText.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alttd/halloween/leaderboard/HoverText.java b/src/main/java/com/alttd/halloween/leaderboard/HoverText.java index 55c0864..3633d69 100644 --- a/src/main/java/com/alttd/halloween/leaderboard/HoverText.java +++ b/src/main/java/com/alttd/halloween/leaderboard/HoverText.java @@ -10,6 +10,7 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher; import lombok.extern.slf4j.Slf4j; import org.bukkit.Location; +import java.util.List; import java.util.Optional; import java.util.UUID; @@ -40,7 +41,7 @@ public class HoverText { .write(2, location.getZ()); spawnPacket.getIntegers().write(1, 78); // Armor Stand type PacketContainer destroyPacket = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY); - destroyPacket.getIntegers().write(0, entityId); + destroyPacket.getIntLists().write(0, List.of(entityId)); return Optional.of(new LeaderboardLineEntity(entityId, spawnPacket, destroyPacket)); } catch (Exception e) { log.error("Failed to create hover text entity", e);