Skip to content

Commit

Permalink
fixed sheep and guests going through portals
Browse files Browse the repository at this point in the history
  • Loading branch information
Gibstick committed Jul 30, 2014
1 parent e3c82a0 commit 8162d00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/ca/gibstick/discosheep/PartyEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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;
Expand Down Expand Up @@ -71,4 +71,12 @@ public void onPlayerInteractEntityEvent(PlayerInteractEntityEvent e) {
}
}

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

}

0 comments on commit 8162d00

Please sign in to comment.