TF-PlotSquared/Sponge/src/main/java/com/plotsquared/sponge/events/PlayerClaimPlotEvent.java

58 lines
1.3 KiB
Java
Raw Normal View History

2015-07-30 14:25:16 +00:00
package com.plotsquared.sponge.events;
2015-10-07 06:33:33 +00:00
import org.spongepowered.api.entity.living.player.Player;
2015-07-30 14:25:16 +00:00
import org.spongepowered.api.event.Cancellable;
2015-12-19 19:30:06 +00:00
import org.spongepowered.api.event.cause.Cause;
2015-07-30 14:25:16 +00:00
import com.intellectualcrafters.plot.object.Plot;
2015-09-13 04:04:31 +00:00
public class PlayerClaimPlotEvent extends PlayerEvent implements Cancellable {
2015-07-30 14:25:16 +00:00
private final Plot plot;
private final boolean auto;
private boolean cancelled;
2015-09-13 04:04:31 +00:00
2015-07-30 14:25:16 +00:00
/**
* PlayerClaimPlotEvent: Called when a plot is claimed
*
* @param player Player that claimed the plot
* @param plot Plot that was claimed
*/
2015-09-13 04:04:31 +00:00
public PlayerClaimPlotEvent(final Player player, final Plot plot, final boolean auto) {
2015-07-30 14:25:16 +00:00
super(player);
this.plot = plot;
this.auto = auto;
}
2015-09-13 04:04:31 +00:00
2015-07-30 14:25:16 +00:00
/**
* Get the plot involved
*
* @return Plot
*/
2015-09-13 04:04:31 +00:00
public Plot getPlot() {
2015-09-11 10:09:22 +00:00
return plot;
2015-07-30 14:25:16 +00:00
}
2015-09-13 04:04:31 +00:00
2015-07-30 14:25:16 +00:00
/**
* @return true if it was an automated claim, else false
*/
2015-09-13 04:04:31 +00:00
public boolean wasAuto() {
2015-09-11 10:09:22 +00:00
return auto;
2015-07-30 14:25:16 +00:00
}
2015-09-13 04:04:31 +00:00
2015-07-30 14:25:16 +00:00
@Override
2015-09-13 04:04:31 +00:00
public boolean isCancelled() {
2015-09-11 10:09:22 +00:00
return cancelled;
2015-07-30 14:25:16 +00:00
}
2015-09-13 04:04:31 +00:00
2015-07-30 14:25:16 +00:00
@Override
2015-09-13 04:04:31 +00:00
public void setCancelled(final boolean cancel) {
2015-09-11 10:09:22 +00:00
cancelled = cancel;
2015-07-30 14:25:16 +00:00
}
2015-12-19 19:30:06 +00:00
@Override
public Cause getCause() {
return null;
}
2015-09-11 10:09:22 +00:00
}