Fix entity destruction packet write method in HoverText.java

Changed the method from getIntegerArrays() to getIntegers() to ensure the correct destruction packet is sent. This fixes an issue where entities were not being correctly destroyed, thereby preventing potential memory leaks and display errors.
This commit is contained in:
2024-10-20 19:22:13 +02:00
parent 023e9386ce
commit 3411a38946
@@ -40,7 +40,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.getIntegerArrays().write(0, new int[]{entityId});
destroyPacket.getIntegers().write(0, entityId);
return Optional.of(new LeaderboardLineEntity(entityId, spawnPacket, destroyPacket));
} catch (Exception e) {
log.error("Failed to create hover text entity", e);