fix duplicate team creation with glow property
This commit is contained in:
parent
8cd7282bb5
commit
33c27e903c
1 changed files with 5 additions and 2 deletions
|
@ -24,7 +24,10 @@ public class GlowProperty extends EntityPropertyImpl<NamedColor> {
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue