2021-01-03 07:21:15 +00:00
|
|
|
package dev.plex.event;
|
2020-11-03 02:58:56 +00:00
|
|
|
|
2021-01-03 07:21:15 +00:00
|
|
|
import dev.plex.player.PunishedPlayer;
|
2022-01-27 21:23:01 +00:00
|
|
|
import java.util.UUID;
|
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
|
|
|
|
*/
|
2020-11-03 02:58:56 +00:00
|
|
|
protected PunishedPlayer 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
|
|
|
|
* @param punishedPlayer The player who was punished
|
|
|
|
* @see PunishedPlayer
|
|
|
|
*/
|
2020-11-03 02:58:56 +00:00
|
|
|
protected PunishedPlayerEvent(PunishedPlayer punishedPlayer)
|
|
|
|
{
|
|
|
|
super(Bukkit.getPlayer(UUID.fromString(punishedPlayer.getUuid())));
|
|
|
|
this.punishedPlayer = punishedPlayer;
|
|
|
|
}
|
|
|
|
}
|