From cbdbc5f2901d7bb7eeb568cdf530ccf4a64e2f0b Mon Sep 17 00:00:00 2001 From: DoKM Date: Wed, 18 Aug 2021 16:19:31 +0200 Subject: Fix a duplicate value exception in capemanger slow update Somehow there can be two exact players in the theworld.playerEntities https://hst.sh/enuvamecef --- .../io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index 583e3715..75a63644 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -312,7 +312,9 @@ public class CapeManager { playerMap.clear(); for(EntityPlayer player : Minecraft.getMinecraft().theWorld.playerEntities) { String uuid = player.getUniqueID().toString().replace("-", ""); - playerMap.put(uuid, player); + try { + playerMap.put(uuid, player); + } catch(IllegalArgumentException ignored){} } } -- cgit