Disable using cosmetics inside mavericks hub
This commit is contained in:
parent
464c9fcdc3
commit
d7d8ef021e
@ -1,9 +1,5 @@
|
|||||||
package mineplex.hub.modules.mavericks;
|
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.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -12,6 +8,11 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
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.
|
* 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
|
@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))
|
if (!(event.getEntity() instanceof Player))
|
||||||
{
|
{
|
||||||
@ -57,6 +67,7 @@ public class MavericksPortalManager extends MiniPlugin
|
|||||||
|
|
||||||
_cosmeticManager.getPetManager().disableAll(p);
|
_cosmeticManager.getPetManager().disableAll(p);
|
||||||
_cosmeticManager.getMountManager().DisableAll(p);
|
_cosmeticManager.getMountManager().DisableAll(p);
|
||||||
|
_cosmeticManager.getGadgetManager().disableAll(p);
|
||||||
|
|
||||||
if (box == _portalHubMavericks)
|
if (box == _portalHubMavericks)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user