From 8128aa7324dff4e79a36671574947d34992d5247 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 14 Oct 2023 12:27:14 +0200 Subject: [PATCH] Fix PacketCache growing uncontrollably --- .../de/steamwar/bausystem/features/tpslimit/PacketCache.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java index 253641c0..e9076382 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java @@ -109,7 +109,7 @@ class PacketCache { } List entities = Bukkit.getWorlds().get(0).getEntities().stream() .filter(e -> !(e instanceof Player)) - .filter(e -> !PacketCache.entities.contains(e)) + .filter(e -> PacketCache.entities.add(e)) .collect(Collectors.toList()); for (Entity entity : entities) { @@ -127,7 +127,5 @@ class PacketCache { int fuse = tnt.getFuseTicks(); packets.add(ChatWrapper.impl.getDataWatcherPacket(entity.getEntityId(), fuseDataWatcher, fuse - (fuse % 5) + 1)); } - - entities.addAll(entities); } }