Don't summon titles if player is morphed

This commit is contained in:
samczsun 2016-12-22 21:06:39 -05:00
parent 7322e05ac4
commit bbd695981d

View File

@ -47,7 +47,6 @@ import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import mineplex.core.Managers;
import mineplex.core.MiniDbClientPlugin;
@ -61,10 +60,11 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketHandler;
@ -93,6 +93,8 @@ public class Titles extends MiniDbClientPlugin<TitleData> implements IPacketHand
private final TrackManager _trackManager = require(TrackManager.class);
private final TitlesRepository _titlesRepository = new TitlesRepository();
private final GadgetManager _gadgetManager = require(GadgetManager.class);
private final BaseComponent[] CLICK_ENABLE_TRACK = new ComponentBuilder("")
.append("Click to enable this track")
.color(ChatColor.GREEN)
@ -699,7 +701,11 @@ public class Titles extends MiniDbClientPlugin<TitleData> implements IPacketHand
if (packetInfo.getPacket() instanceof PacketPlayOutNamedEntitySpawn)
{
PacketPlayOutNamedEntitySpawn packet = (PacketPlayOutNamedEntitySpawn) packetInfo.getPacket();
summonForEntity(packetInfo.getPlayer(), (Player) UtilEnt.getEntityById(packet.a));
Player owner = (Player) UtilEnt.getEntityById(packet.a);
if (_gadgetManager.getActive(owner, GadgetType.MORPH) == null)
{
summonForEntity(packetInfo.getPlayer(), owner);
}
}
else if (packetInfo.getPacket() instanceof PacketPlayOutEntityDestroy)
{