Added various 1.6 portal events.

By: Stephen <stephen@jazer.com>
This commit is contained in:
Bukkit/Spigot
2011-06-07 14:12:08 -04:00
parent b3c007d3a7
commit 2c4ba8815e
9 changed files with 150 additions and 0 deletions

View File

@@ -183,6 +183,13 @@ public class PlayerListener implements Listener {
*/
public void onPlayerBedLeave(PlayerBedLeaveEvent event) {}
/**
* Called when a player is teleporting in a portal (after the animation)
*
* @param event Relevant event details
*/
public void onPlayerPortal(PlayerPortalEvent event) {}
// TODO: Remove after RB
@Deprecated public void onPlayerQuit(PlayerEvent event) {}
@Deprecated public void onPlayerCommandPreprocess(PlayerChatEvent event) {}

View File

@@ -0,0 +1,22 @@
package org.bukkit.event.player;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.block.Block;
/**
* Called when a player completes the portaling process by standing in a portal
*/
public class PlayerPortalEvent extends PlayerTeleportEvent {
private boolean useTravelAgent = true;
public PlayerPortalEvent(Player player, Location from, Location to) {
super(Type.PLAYER_PORTAL, player, from, to);
}
public void useTravelAgent(boolean useTravelAgent){
this.useTravelAgent = useTravelAgent;
}
public boolean useTravelAgent(){
return useTravelAgent;
}
}

View File

@@ -2,6 +2,7 @@ package org.bukkit.event.player;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
/**
* Holds information for player teleport events
@@ -10,4 +11,7 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
public PlayerTeleportEvent(Player player, Location from, Location to) {
super(Type.PLAYER_TELEPORT, player, from, to);
}
public PlayerTeleportEvent(final Event.Type type, Player player, Location from, Location to) {
super(type, player, from, to);
}
}