mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2024-11-11 01:17:16 +00:00
Auctally grab the datawatcher
This commit is contained in:
parent
5db33ffcf6
commit
1c056089bc
1 changed files with 3 additions and 5 deletions
|
@ -71,12 +71,10 @@ public class LibsDisguises extends JavaPlugin implements Listener {
|
|||
if (disguise.getType().isMisc() && entity.getType().isAlive())
|
||||
event.setCancelled(true);
|
||||
} else if (event.getPacketID() == Packets.Server.ENTITY_METADATA) {
|
||||
event.setPacket(new PacketContainer(event.getPacketID()));
|
||||
StructureModifier<Object> mods = event.getPacket().getModifier();
|
||||
mods.write(0, entity.getEntityId());
|
||||
mods.write(1,
|
||||
disguise.getWatcher()
|
||||
.convert((List<WatchableObject>) event.getPacket().getModifier().read(1)));
|
||||
event.setPacket(new PacketContainer(event.getPacketID()));
|
||||
mods.write(0, mods.read(0));
|
||||
mods.write(1, disguise.getWatcher().convert((List<WatchableObject>) mods.read(1)));
|
||||
} else if (event.getPacketID() == Packets.Server.NAMED_ENTITY_SPAWN) {
|
||||
if (disguise.getType().isPlayer()) {
|
||||
StructureModifier<Object> mods = event.getPacket().getModifier();
|
||||
|
|
Loading…
Reference in a new issue