mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-23 15:29:34 +01:00
Add WhitelistToggleEvent
This commit is contained in:
parent
719f0a0a7e
commit
13d4e540cf
1 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,42 @@
|
||||||
|
package com.destroystokyo.paper.event.server;
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
import org.jspecify.annotations.NullMarked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is fired when whitelist is toggled
|
||||||
|
*
|
||||||
|
* @author Mark Vainomaa
|
||||||
|
*/
|
||||||
|
@NullMarked
|
||||||
|
public class WhitelistToggleEvent extends Event {
|
||||||
|
|
||||||
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
|
|
||||||
|
private final boolean enabled;
|
||||||
|
|
||||||
|
@ApiStatus.Internal
|
||||||
|
public WhitelistToggleEvent(final boolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether whitelist is going to be enabled or not
|
||||||
|
*
|
||||||
|
* @return Whether whitelist is going to be enabled or not
|
||||||
|
*/
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return this.enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLER_LIST;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLER_LIST;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue