From 26770e5b7a7d3569418b2737c7c31370d6de0a45 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 23 Nov 2013 15:25:25 +1300 Subject: [PATCH] Send a entity teleport packet for falling block to prevent it glitching into the ground --- .../disguise/utilities/PacketsManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 47292b24..254474db 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -272,6 +272,18 @@ public class PacketsManager { spawnPackets[0].getModifier().write(2, (int) Math.floor(loc.getY() * 32D)); spawnPackets[0].getModifier().write(8, yaw); + if (disguise.getType() == DisguiseType.FALLING_BLOCK) { + // Make the teleport packet to make it visible.. + spawnPackets[1] = new PacketContainer(Packets.Server.ENTITY_TELEPORT); + StructureModifier mods = spawnPackets[1].getModifier(); + mods.write(0, disguisedEntity.getEntityId()); + mods.write(1, (int) Math.floor(loc.getX() * 32D)); + mods.write(2, (int) Math.floor(loc.getY() * 32D)); + mods.write(3, (int) Math.floor(loc.getZ() * 32D)); + mods.write(4, yaw); + mods.write(5, (byte) (int) (loc.getPitch() * 256.0F / 360.0F)); + } + } if (spawnPackets[1] == null) { // Make a packet to turn his head!