PlotSquared/Sponge/src/main/java/com/plotsquared/sponge/events/PlayerPlotDeniedEvent.java

57 lines
1.3 KiB
Java
Raw Normal View History

2015-07-30 16:25:16 +02:00
package com.plotsquared.sponge.events;
import java.util.UUID;
2015-10-07 08:33:33 +02:00
import org.spongepowered.api.entity.living.player.Player;
2015-07-30 16:25:16 +02:00
import com.intellectualcrafters.plot.object.Plot;
2015-09-13 06:04:31 +02:00
public class PlayerPlotDeniedEvent extends PlotEvent {
2015-07-30 16:25:16 +02:00
private final Player initiator;
private final boolean added;
private final UUID player;
2015-09-13 06:04:31 +02:00
2015-07-30 16:25:16 +02:00
/**
* PlayerPlotDeniedEvent: Called when the denied UUID list is modified for a plot
*
* @param initiator Player that initiated the event
* @param plot Plot in which the event occurred
* @param player Player that was denied/un-denied
* @param added true of add to deny list, false if removed
*/
2015-09-13 06:04:31 +02:00
public PlayerPlotDeniedEvent(final Player initiator, final Plot plot, final UUID player, final boolean added) {
2015-07-30 16:25:16 +02:00
super(plot);
this.initiator = initiator;
this.added = added;
this.player = player;
}
2015-09-13 06:04:31 +02:00
2015-07-30 16:25:16 +02:00
/**
* If a user was added
*
* @return boolean
*/
2015-09-13 06:04:31 +02:00
public boolean wasAdded() {
2015-09-11 12:09:22 +02:00
return added;
2015-07-30 16:25:16 +02:00
}
2015-09-13 06:04:31 +02:00
2015-07-30 16:25:16 +02:00
/**
* The player added/removed
*
* @return UUID
*/
2015-09-13 06:04:31 +02:00
public UUID getPlayer() {
2015-09-11 12:09:22 +02:00
return player;
2015-07-30 16:25:16 +02:00
}
2015-09-13 06:04:31 +02:00
2015-07-30 16:25:16 +02:00
/**
* The player initiating the action
*
* @return Player
*/
2015-09-13 06:04:31 +02:00
public Player getInitiator() {
2015-09-11 12:09:22 +02:00
return initiator;
2015-07-30 16:25:16 +02:00
}
2015-09-11 12:09:22 +02:00
}