Ignore DisguiseType.UNKNOWN, handles #373
This commit is contained in:
parent
9ecf1cc62c
commit
c5cad96118
@ -3,6 +3,7 @@ package me.libraryaddict.disguise.utilities.packets;
|
|||||||
import com.comphenix.protocol.PacketType;
|
import com.comphenix.protocol.PacketType;
|
||||||
import com.comphenix.protocol.events.PacketContainer;
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
|
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
||||||
import me.libraryaddict.disguise.utilities.packets.packethandlers.*;
|
import me.libraryaddict.disguise.utilities.packets.packethandlers.*;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -73,6 +74,10 @@ public class PacketsHandler {
|
|||||||
public LibsPackets transformPacket(PacketContainer sentPacket, Disguise disguise, Player observer, Entity entity) {
|
public LibsPackets transformPacket(PacketContainer sentPacket, Disguise disguise, Player observer, Entity entity) {
|
||||||
LibsPackets packets = new LibsPackets(disguise);
|
LibsPackets packets = new LibsPackets(disguise);
|
||||||
|
|
||||||
|
if (disguise.getType() == DisguiseType.UNKNOWN) {
|
||||||
|
return packets;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
packets.addPacket(sentPacket);
|
packets.addPacket(sentPacket);
|
||||||
|
|
||||||
|
@ -59,6 +59,10 @@ public class PacketHandlerSpawn implements IPacketHandler {
|
|||||||
|
|
||||||
packets.clear();
|
packets.clear();
|
||||||
|
|
||||||
|
if (disguise.getType() == DisguiseType.UNKNOWN) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
constructSpawnPackets(observer, packets, entity);
|
constructSpawnPackets(observer, packets, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,15 +7,12 @@ import com.comphenix.protocol.events.ListenerPriority;
|
|||||||
import com.comphenix.protocol.events.PacketAdapter;
|
import com.comphenix.protocol.events.PacketAdapter;
|
||||||
import com.comphenix.protocol.events.PacketContainer;
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
import com.comphenix.protocol.events.PacketEvent;
|
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.LibsDisguises;
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
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.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.packets.LibsPackets;
|
import me.libraryaddict.disguise.utilities.packets.LibsPackets;
|
||||||
import me.libraryaddict.disguise.utilities.packets.PacketsManager;
|
import me.libraryaddict.disguise.utilities.packets.PacketsManager;
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
@ -12,6 +12,7 @@ import com.comphenix.protocol.wrappers.WrappedWatchableObject;
|
|||||||
import me.libraryaddict.disguise.DisguiseAPI;
|
import me.libraryaddict.disguise.DisguiseAPI;
|
||||||
import me.libraryaddict.disguise.LibsDisguises;
|
import me.libraryaddict.disguise.LibsDisguises;
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
|
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
||||||
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.LibsPremium;
|
import me.libraryaddict.disguise.utilities.LibsPremium;
|
||||||
|
Loading…
Reference in New Issue
Block a user