Fix a CCE in MorphDinnerbone

This commit is contained in:
Sam 2017-02-27 19:00:06 +00:00
parent 9df5d3e746
commit 0ca4b2041d
1 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
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;
@ -111,7 +112,14 @@ public class MorphDinnerbone extends MorphGadget implements IPacketHandler
if (packetInfo.getPacket() instanceof PacketPlayOutNamedEntitySpawn) if (packetInfo.getPacket() instanceof PacketPlayOutNamedEntitySpawn)
{ {
PacketPlayOutNamedEntitySpawn packet = (PacketPlayOutNamedEntitySpawn) packetInfo.getPacket(); PacketPlayOutNamedEntitySpawn packet = (PacketPlayOutNamedEntitySpawn) packetInfo.getPacket();
Player owner = (Player) UtilEnt.getEntityById(packet.a); Entity entity = UtilEnt.getEntityById(packet.a);
if (!(entity instanceof Player))
{
return;
}
Player owner = (Player) entity;
if (Manager.getActive(owner, GadgetType.MORPH) == this) if (Manager.getActive(owner, GadgetType.MORPH) == this)
{ {
summonForEntity(packetInfo.getPlayer(), owner); summonForEntity(packetInfo.getPlayer(), owner);