mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Move where armor destroy packet is sent
This commit is contained in:
parent
e8c7a48c47
commit
a0398c4d02
@ -116,8 +116,6 @@ public abstract class Disguise {
|
|||||||
return DisguiseUtilities.reverse(multiName);
|
return DisguiseUtilities.reverse(multiName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract double getHeight();
|
|
||||||
|
|
||||||
public void setMultiName(String... name) {
|
public void setMultiName(String... name) {
|
||||||
if (name.length == 1 && name[0].isEmpty()) {
|
if (name.length == 1 && name[0].isEmpty()) {
|
||||||
name = new String[0];
|
name = new String[0];
|
||||||
@ -135,6 +133,8 @@ public abstract class Disguise {
|
|||||||
sendArmorStands(oldName);
|
sendArmorStands(oldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract double getHeight();
|
||||||
|
|
||||||
protected void sendArmorStands(String[] oldName) {
|
protected void sendArmorStands(String[] oldName) {
|
||||||
ArrayList<PacketContainer> packets = DisguiseUtilities.getNamePackets(this, oldName);
|
ArrayList<PacketContainer> 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
|
// If this disguise is active
|
||||||
// Remove the disguise from the current disguises.
|
// Remove the disguise from the current disguises.
|
||||||
if (DisguiseUtilities.removeDisguise((TargetedDisguise) this)) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user