mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-10-07 12:07:38 +02:00
Attempt to fix error with ProtocolLib's temporary players
This commit is contained in:
parent
81fb3ef028
commit
98e5827a8a
@ -8,6 +8,8 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import com.comphenix.net.sf.cglib.proxy.Factory;
|
||||||
import com.comphenix.protocol.PacketType;
|
import com.comphenix.protocol.PacketType;
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
import com.comphenix.protocol.events.ListenerPriority;
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
@ -102,6 +104,10 @@ public class ProtocolLibHookImpl implements ProtocolLibHook {
|
|||||||
public void onPacketSending(PacketEvent event) {
|
public void onPacketSending(PacketEvent event) {
|
||||||
|
|
||||||
PacketContainer packet = event.getPacket();
|
PacketContainer packet = event.getPacket();
|
||||||
|
|
||||||
|
if (event.getPlayer() instanceof Factory) {
|
||||||
|
return; // Ignore temporary players (reference: https://github.com/dmulloy2/ProtocolLib/issues/349)
|
||||||
|
}
|
||||||
|
|
||||||
// Spawn entity packet
|
// Spawn entity packet
|
||||||
if (packet.getType() == PacketType.Play.Server.SPAWN_ENTITY_LIVING) {
|
if (packet.getType() == PacketType.Play.Server.SPAWN_ENTITY_LIVING) {
|
||||||
|
Loading…
Reference in New Issue
Block a user