Fix destructor enderpearls teleporting players

This commit is contained in:
Spencer 2017-12-23 15:40:01 -05:00 committed by Alexander Meech
parent 90500a723a
commit 1fa7f02a89

View File

@ -39,6 +39,7 @@ import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
public class PerkDestructor extends Perk 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) public void setEnabled(boolean var)
{ {
_enabled = var; _enabled = var;