@@ -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) {}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user