2022-08-02 12:08:52 +00:00
|
|
|
package dev.plex.event;
|
2020-11-03 02:58:56 +00:00
|
|
|
|
2022-08-02 12:08:52 +00:00
|
|
|
import dev.plex.player.PlexPlayer;
|
2020-11-03 02:58:56 +00:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.event.player.PlayerEvent;
|
|
|
|
|
2022-02-07 17:07:48 +00:00
|
|
|
/**
|
|
|
|
* Superclass for punishment events
|
|
|
|
*/
|
2020-11-03 02:58:56 +00:00
|
|
|
@Getter
|
|
|
|
public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancellable
|
|
|
|
{
|
2022-02-07 17:07:48 +00:00
|
|
|
/**
|
|
|
|
* The player who was punished
|
|
|
|
*/
|
2022-08-02 12:08:52 +00:00
|
|
|
protected PlexPlayer punishedPlayer;
|
2022-02-07 17:07:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the event was cancelled
|
|
|
|
*/
|
2020-11-03 02:58:56 +00:00
|
|
|
@Setter
|
2022-02-07 17:07:48 +00:00
|
|
|
protected boolean cancelled; //TODO: unsure if cancelling the event does anything
|
2020-11-03 02:58:56 +00:00
|
|
|
|
2022-02-07 17:07:48 +00:00
|
|
|
/**
|
|
|
|
* Creates an event object
|
2022-02-22 09:30:23 +00:00
|
|
|
*
|
2022-02-07 17:07:48 +00:00
|
|
|
* @param punishedPlayer The player who was punished
|
2022-08-02 12:08:52 +00:00
|
|
|
* @see PlexPlayer
|
2022-02-07 17:07:48 +00:00
|
|
|
*/
|
2022-08-02 12:08:52 +00:00
|
|
|
protected PunishedPlayerEvent(PlexPlayer punishedPlayer)
|
2020-11-03 02:58:56 +00:00
|
|
|
{
|
2022-04-07 03:55:01 +00:00
|
|
|
super(Bukkit.getPlayer(punishedPlayer.getUuid()));
|
2020-11-03 02:58:56 +00:00
|
|
|
this.punishedPlayer = punishedPlayer;
|
|
|
|
}
|
|
|
|
}
|