Fix destructor enderpearls teleporting players
This commit is contained in:
parent
90500a723a
commit
1fa7f02a89
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user