From d7d8ef021e0d0135212cc2aee84ed780032020a7 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Tue, 30 Aug 2016 00:47:48 -0400 Subject: [PATCH] Disable using cosmetics inside mavericks hub --- .../mavericks/MavericksPortalManager.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/mavericks/MavericksPortalManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/mavericks/MavericksPortalManager.java index ce65060af..597be1b4a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/mavericks/MavericksPortalManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/mavericks/MavericksPortalManager.java @@ -1,9 +1,5 @@ package mineplex.hub.modules.mavericks; -import mineplex.core.MiniPlugin; -import mineplex.core.common.util.F; -import mineplex.core.cosmetic.CosmeticManager; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Sound; @@ -12,6 +8,11 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityPortalEnterEvent; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; + +import mineplex.core.MiniPlugin; +import mineplex.core.common.util.F; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.gadget.event.GadgetEnableEvent; /** * A small teleportation manager to manage the portal from the hub to the mavericks world and back. */ @@ -40,7 +41,16 @@ public class MavericksPortalManager extends MiniPlugin } @EventHandler - public void onEntier(EntityPortalEnterEvent event) + public void onEnable(GadgetEnableEvent event) + { + if (event.getPlayer().getWorld().equals(_destMavericks.getWorld())) + { + event.setCancelled(true); + } + } + + @EventHandler + public void onEnter(EntityPortalEnterEvent event) { if (!(event.getEntity() instanceof Player)) { @@ -57,6 +67,7 @@ public class MavericksPortalManager extends MiniPlugin _cosmeticManager.getPetManager().disableAll(p); _cosmeticManager.getMountManager().DisableAll(p); + _cosmeticManager.getGadgetManager().disableAll(p); if (box == _portalHubMavericks) {