diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java index e51abe92..cd8888b2 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.utilities.packets; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.packets.packethandlers.*; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -73,6 +74,10 @@ public class PacketsHandler { public LibsPackets transformPacket(PacketContainer sentPacket, Disguise disguise, Player observer, Entity entity) { LibsPackets packets = new LibsPackets(disguise); + if (disguise.getType() == DisguiseType.UNKNOWN) { + return packets; + } + try { packets.addPacket(sentPacket); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java index 4b26a882..703db343 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java @@ -59,6 +59,10 @@ public class PacketHandlerSpawn implements IPacketHandler { packets.clear(); + if (disguise.getType() == DisguiseType.UNKNOWN) { + return; + } + constructSpawnPackets(observer, packets, entity); } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java index 13f9360f..8f9ac54f 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java @@ -7,15 +7,12 @@ import com.comphenix.protocol.events.ListenerPriority; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; -import com.comphenix.protocol.reflect.StructureModifier; -import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; -import me.libraryaddict.disguise.disguisetypes.EntityPose; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.packets.LibsPackets; import me.libraryaddict.disguise.utilities.packets.PacketsManager; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import java.lang.reflect.InvocationTargetException; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java index bd7239a6..727d1536 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java @@ -12,6 +12,7 @@ import com.comphenix.protocol.wrappers.WrappedWatchableObject; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium;