From 98e5827a8a0e33940454a7e6e1014a3d1c2baea4 Mon Sep 17 00:00:00 2001 From: filoghost Date: Wed, 2 Aug 2017 14:29:52 +0200 Subject: [PATCH] Attempt to fix error with ProtocolLib's temporary players --- .../bridge/protocollib/current/ProtocolLibHookImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java index 91f64114..12d05a64 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/protocollib/current/ProtocolLibHookImpl.java @@ -8,6 +8,8 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; + +import com.comphenix.net.sf.cglib.proxy.Factory; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.ListenerPriority; @@ -102,6 +104,10 @@ public class ProtocolLibHookImpl implements ProtocolLibHook { public void onPacketSending(PacketEvent event) { PacketContainer packet = event.getPacket(); + + if (event.getPlayer() instanceof Factory) { + return; // Ignore temporary players (reference: https://github.com/dmulloy2/ProtocolLib/issues/349) + } // Spawn entity packet if (packet.getType() == PacketType.Play.Server.SPAWN_ENTITY_LIVING) {