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

58 lines
1.2 KiB
Java
Raw Normal View History

2015-07-30 14:25:16 +00:00
package com.plotsquared.sponge.events;
2015-09-06 01:53:56 +00:00
import org.spongepowered.api.entity.player.Player;
2015-07-30 14:25:16 +00:00
import org.spongepowered.api.event.Cancellable;
import com.intellectualcrafters.plot.object.Plot;
2015-09-11 10:09:22 +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-11 10:09:22 +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-11 10:09:22 +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-11 10:09:22 +00:00
2015-07-30 14:25:16 +00:00
/**
* Get the plot involved
*
* @return Plot
*/
2015-09-11 10:09:22 +00:00
public Plot getPlot()
{
return plot;
2015-07-30 14:25:16 +00:00
}
/**
* @return true if it was an automated claim, else false
*/
2015-09-11 10:09:22 +00:00
public boolean wasAuto()
{
return auto;
2015-07-30 14:25:16 +00:00
}
@Override
2015-09-11 10:09:22 +00:00
public boolean isCancelled()
{
return cancelled;
2015-07-30 14:25:16 +00:00
}
@Override
2015-09-11 10:09:22 +00:00
public void setCancelled(final boolean cancel)
{
cancelled = cancel;
2015-07-30 14:25:16 +00:00
}
2015-09-11 10:09:22 +00:00
}