From 5c29463b6d45dcb7703fbccbefefce8b580069f6 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 29 Sep 2013 11:15:12 +1300 Subject: [PATCH] Disguises should no longer crash the eye of the beholder when the creeper slips into bed --- .../libraryaddict/disguise/PacketsManager.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/PacketsManager.java b/src/me/libraryaddict/disguise/PacketsManager.java index aa504987..05b6484d 100644 --- a/src/me/libraryaddict/disguise/PacketsManager.java +++ b/src/me/libraryaddict/disguise/PacketsManager.java @@ -43,7 +43,6 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; - import com.comphenix.protocol.Packets; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; @@ -68,7 +67,7 @@ public class PacketsManager { Packets.Server.REL_ENTITY_MOVE_LOOK, Packets.Server.ENTITY_LOOK, Packets.Server.ENTITY_TELEPORT, Packets.Server.ADD_EXP_ORB, Packets.Server.VEHICLE_SPAWN, Packets.Server.MOB_SPAWN, Packets.Server.ENTITY_PAINTING, Packets.Server.COLLECT, Packets.Server.UPDATE_ATTRIBUTES, - Packets.Server.ENTITY_EQUIPMENT) { + Packets.Server.ENTITY_EQUIPMENT, Packets.Server.BED) { @Override public void onPacketSending(PacketEvent event) { final Player observer = event.getPlayer(); @@ -575,7 +574,8 @@ public class PacketsManager { Packets.Server.REL_ENTITY_MOVE_LOOK, Packets.Server.ENTITY_LOOK, Packets.Server.ENTITY_TELEPORT, Packets.Server.ENTITY_HEAD_ROTATION, Packets.Server.ENTITY_METADATA, Packets.Server.ENTITY_EQUIPMENT, Packets.Server.ARM_ANIMATION, Packets.Server.ENTITY_LOCATION_ACTION, Packets.Server.MOB_EFFECT, - Packets.Server.ENTITY_STATUS, Packets.Server.ENTITY_VELOCITY, Packets.Server.UPDATE_ATTRIBUTES) { + Packets.Server.ENTITY_STATUS, Packets.Server.ENTITY_VELOCITY, Packets.Server.UPDATE_ATTRIBUTES, + Packets.Server.BED) { @Override public void onPacketSending(PacketEvent event) { StructureModifier entityModifer = event.getPacket().getEntityModifier(event.getPlayer().getWorld()); @@ -638,6 +638,7 @@ public class PacketsManager { } event.setCancelled(true); break; + case Packets.Server.ENTITY_STATUS: if (DisguiseAPI.getDisguise(entity).canHearSelfDisguise() && (Byte) event.getPacket().getModifier().read(1) == 2) @@ -796,6 +797,15 @@ public class PacketsManager { break; } + case Packets.Server.BED: + + { + if (!disguise.getType().isPlayer()) { + packets = new PacketContainer[0]; + } + break; + } + default: break; }