fixed sheep and guests going through portals

This commit is contained in:
Charlie 2014-07-30 16:59:59 -04:00
parent e3c82a08ba
commit 8162d00372

View File

@ -5,7 +5,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent; 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.entity.EntityTargetEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerShearEntityEvent; 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);
}
}
} }