From 8162d003724d831e840dfd6d0ad8f4d115586018 Mon Sep 17 00:00:00 2001 From: Charlie Date: Wed, 30 Jul 2014 16:59:59 -0400 Subject: [PATCH] fixed sheep and guests going through portals --- src/main/java/ca/gibstick/discosheep/PartyEvents.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/ca/gibstick/discosheep/PartyEvents.java b/src/main/java/ca/gibstick/discosheep/PartyEvents.java index c66f724..5a052e5 100644 --- a/src/main/java/ca/gibstick/discosheep/PartyEvents.java +++ b/src/main/java/ca/gibstick/discosheep/PartyEvents.java @@ -5,7 +5,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityPortalEnterEvent; +import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerShearEntityEvent; @@ -71,4 +71,12 @@ public class PartyEvents implements Listener { } } + // prevent portal teleport + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + public void onEntityPortalEvent(EntityPortalEvent e) { + if (party.getSheepList().contains(e.getEntity()) || party.getGuestList().contains(e.getEntity())) { + e.setCancelled(true); + } + } + }