From 1fa7f02a89dec82d381f55579bdd7876c8d3619b Mon Sep 17 00:00:00 2001 From: Spencer Date: Sat, 23 Dec 2017 15:40:01 -0500 Subject: [PATCH] Fix destructor enderpearls teleporting players --- .../game/arcade/kit/perks/PerkDestructor.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDestructor.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDestructor.java index df95372dc..a2e5d0f9c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDestructor.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDestructor.java @@ -39,6 +39,7 @@ import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.metadata.FixedMetadataValue; public class PerkDestructor extends Perk @@ -282,6 +283,27 @@ public class PerkDestructor extends Perk } } + @EventHandler + public void pearlTeleport(PlayerTeleportEvent event) + { + if (!Manager.GetGame().IsLive()) + { + return; + } + + if (event.getCause() != PlayerTeleportEvent.TeleportCause.ENDER_PEARL) + { + return; + } + + if (!Kit.HasKit(event.getPlayer())) + { + return; + } + + event.setCancelled(true); + } + public void setEnabled(boolean var) { _enabled = var;