Added NETHER_PORTAL and END_PORTAL to the TeleportCause enum. Addresses BUKKIT-265

Added new NETHER_PORTAL and END_PORTAL values to the TeleportCause enum
and relevant constructor for PlayerPortalEvent.

By: James Clarke <jamesrtclarke@me.com>
This commit is contained in:
Bukkit/Spigot 2012-02-15 19:54:01 +00:00
parent 93e9f175c4
commit c2e4349767
2 changed files with 13 additions and 0 deletions

View file

@ -17,6 +17,11 @@ public class PlayerPortalEvent extends PlayerTeleportEvent {
super(player, from, to);
this.travelAgent = pta;
}
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta, TeleportCause cause) {
super(Type.PLAYER_PORTAL, player, from, to, cause);
this.travelAgent = pta;
}
public void useTravelAgent(boolean useTravelAgent) {
this.useTravelAgent = useTravelAgent;

View file

@ -43,6 +43,14 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
* Indicates the teleportation was caused by a plugin
*/
PLUGIN,
/**
* Indicates the teleportation was caused by a player entering a Nether portal
*/
NETHER_PORTAL,
/**
* Indicates the teleportation was caused by a player entering an End portal
*/
END_PORTAL,
/**
* Indicates the teleportation was caused by an event not covered by this enum
*/