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); + } + } + }