PlotSquared/src/main/java/com/plotsquared/sponge/events/PlayerTeleportToPlotEvent.java
2015-07-31 00:25:16 +10:00

55 lines
1.3 KiB
Java

package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player;
import org.spongepowered.api.event.Cancellable;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
public class PlayerTeleportToPlotEvent extends PlayerEvent implements Cancellable {
private final Location from;
private final Plot plot;
private boolean cancelled;
/**
* PlayerTeleportToPlotEvent: Called when a player teleports to a plot
*
* @param player That was teleported
* @param from Start location
* @param plot Plot to which the player was teleported
*/
public PlayerTeleportToPlotEvent(final Player player, final Location from, final Plot plot) {
super(player);
this.from = from;
this.plot = plot;
}
/**
* Get the from location
*
* @return Location
*/
public Location getFrom() {
return this.from;
}
/**
* Get the plot involved
*
* @return Plot
*/
public Plot getPlot() {
return this.plot;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
}
}