Implements customiseable PortalTravelAgent and updated PlayerPortalEvent.
By: Rigby <rigby@onarandombox.com>
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
package org.bukkit.event.player;
|
||||
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.TravelAgent;
|
||||
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) {
|
||||
|
||||
protected boolean useTravelAgent = true;
|
||||
|
||||
protected Player player;
|
||||
protected TravelAgent travelAgent;
|
||||
|
||||
public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta) {
|
||||
super(Type.PLAYER_PORTAL, player, from, to);
|
||||
this.travelAgent = pta;
|
||||
}
|
||||
|
||||
public void useTravelAgent(boolean useTravelAgent) {
|
||||
@@ -22,4 +26,12 @@ public class PlayerPortalEvent extends PlayerTeleportEvent {
|
||||
public boolean useTravelAgent() {
|
||||
return useTravelAgent;
|
||||
}
|
||||
}
|
||||
|
||||
public TravelAgent getPortalTravelAgent() {
|
||||
return this.travelAgent;
|
||||
}
|
||||
|
||||
public void setPortalTravelAgent(TravelAgent travelAgent) {
|
||||
this.travelAgent = travelAgent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user