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.
This commit is contained in:
James Clarke 2012-02-15 19:54:01 +00:00 committed by EvilSeph
parent a3038f4615
commit 42d8d07051
2 changed files with 13 additions and 0 deletions

View File

@ -18,6 +18,11 @@ public class PlayerPortalEvent extends PlayerTeleportEvent {
this.travelAgent = pta; 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) { public void useTravelAgent(boolean useTravelAgent) {
this.useTravelAgent = useTravelAgent; this.useTravelAgent = useTravelAgent;
} }

View File

@ -43,6 +43,14 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
* Indicates the teleportation was caused by a plugin * Indicates the teleportation was caused by a plugin
*/ */
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 * Indicates the teleportation was caused by an event not covered by this enum
*/ */