refactor: wip cleanup

- Added a bunch of events
- Refactor database backend
- Major code cleanup
- Dependency bumps
- CI workflows
This commit is contained in:
darksaid98 committed 2023-12-16 17:28:36 +01:00
1 parent 6949e94310
commit e0644ad4de
75 files changed
+4019 -1303

No files matched your search

@@ -1,38 +1,35 @@
package com.github.alathra.AlathranWars.events;
import org.bukkit.event.Cancellable;
import com.github.alathra.AlathranWars.conflict.War;
import com.github.alathra.AlathranWars.enums.WarDeleteReason;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class WarDeleteEvent extends Event implements Cancellable {
public class WarDeleteEvent extends Event {
private static final HandlerList HANDLER_LIST = new HandlerList();
private boolean cancelled;
private War war;
private WarDeleteReason reason;
/**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* @return true if this event is cancelled
*/
@Override
public boolean isCancelled() {
return this.cancelled;
}
/**
* Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins.
*
* @param cancelled true if you wish to cancel this event
*/
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
public WarDeleteEvent(War war, WarDeleteReason reason) {
this.war = war;
this.reason = reason;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
public War getWar() {
return war;
}
public WarDeleteReason getReason() {
return reason;
}
}