diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 140fa0d3..7fbbac0e 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -116,8 +116,6 @@ public abstract class Disguise { return DisguiseUtilities.reverse(multiName); } - public abstract double getHeight(); - public void setMultiName(String... name) { if (name.length == 1 && name[0].isEmpty()) { name = new String[0]; @@ -135,6 +133,8 @@ public abstract class Disguise { sendArmorStands(oldName); } + public abstract double getHeight(); + protected void sendArmorStands(String[] oldName) { ArrayList packets = DisguiseUtilities.getNamePackets(this, oldName); @@ -890,6 +890,20 @@ public abstract class Disguise { } } + if (getMultiNameLength() > 0) { + PacketContainer packet = new PacketContainer(Server.ENTITY_DESTROY); + packet.getIntegerArrays().write(0, Arrays.copyOf(getArmorstandIds(), getMultiNameLength())); + + try { + for (Player player : DisguiseUtilities.getPerverts(this)) { + ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet); + } + } + catch (InvocationTargetException e) { + e.printStackTrace(); + } + } + // If this disguise is active // Remove the disguise from the current disguises. if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) { @@ -945,20 +959,6 @@ public abstract class Disguise { } } - if (getMultiNameLength() > 0) { - PacketContainer packet = new PacketContainer(Server.ENTITY_DESTROY); - packet.getIntegerArrays().write(0, Arrays.copyOf(getArmorstandIds(), getMultiNameLength())); - - try { - for (Player player : DisguiseUtilities.getPerverts(this)) { - ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet); - } - } - catch (InvocationTargetException e) { - e.printStackTrace(); - } - } - return true; }