From 33c27e903ce05cd3c39cbec35f89665bb827a1db Mon Sep 17 00:00:00 2001 From: Pyrbu Date: Wed, 18 Dec 2024 05:22:12 +0100 Subject: [PATCH] fix duplicate team creation with glow property --- .../lol/pyr/znpcsplus/entity/properties/GlowProperty.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/entity/properties/GlowProperty.java b/plugin/src/main/java/lol/pyr/znpcsplus/entity/properties/GlowProperty.java index e32f61d..b20d2e5 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/entity/properties/GlowProperty.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/entity/properties/GlowProperty.java @@ -24,7 +24,10 @@ public class GlowProperty extends EntityPropertyImpl { EntityData oldData = properties.get(0); byte oldValue = oldData == null ? 0 : (byte) oldData.getValue(); properties.put(0, newEntityData(0, EntityDataTypes.BYTE, (byte) (oldValue | (value == null ? 0 : 0x40)))); - if (isSpawned) packetFactory.removeTeam(player, entity); - packetFactory.createTeam(player, entity, value); + // the team is already created with the right glow color in the packet factory if the npc isnt spawned yet + if (isSpawned) { + packetFactory.removeTeam(player, entity); + packetFactory.createTeam(player, entity, value); + } } }