From bbd695981dbd75c4faf009ba5b32cc39e6346b64 Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 22 Dec 2016 21:06:39 -0500 Subject: [PATCH] Don't summon titles if player is morphed --- .../src/mineplex/core/titles/Titles.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/titles/Titles.java b/Plugins/Mineplex.Core/src/mineplex/core/titles/Titles.java index 3c6fd2dab..210405c95 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/titles/Titles.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/titles/Titles.java @@ -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 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 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) {