1
mirror of https://github.com/Shiewk/SModeration.git synced 2026-04-28 05:54:16 +02:00
Files
SModeration/src/main/java/de/shiewk/smoderation/paper/event/PunishmentIssueEvent.java
T
Shiewk 823093be35 Rework save format and punishment manager
- Punishments are now saved as JSON in files named after their targets
- Each punishment type now has its own Java class
- Each file contains a list of JSON objects that is updated every time something changes (e.g. player muted, banned or unbanned)
- Punishments have a unique ID now; if something changes, the new version is added to the list and overwrites the old version
- 'Undo' has been renamed to 'cancel'
- You can no longer mute or ban players if they are already muted or banned
2026-04-08 16:12:01 +02:00

49 lines
1.2 KiB
Java

package de.shiewk.smoderation.paper.event;
import de.shiewk.smoderation.paper.punishments.Punishment;
import de.shiewk.smoderation.paper.punishments.PunishmentManager;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PunishmentIssueEvent extends Event implements Cancellable {
private static final HandlerList handlerList = new HandlerList();
private final Punishment punishment;
private final PunishmentManager manager;
private boolean cancelled;
public PunishmentIssueEvent(Punishment punishment, PunishmentManager manager) {
this.punishment = punishment;
this.manager = manager;
}
public Punishment getPunishment() {
return punishment;
}
public PunishmentManager getPunishmentManager() {
return manager;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlerList;
}
public static HandlerList getHandlerList() {
return handlerList;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}