Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Whitelist Toggle Event #6602

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;

// TODO awaiting #5422 scheduled merge, to prevent the massive infamous merge conflict
@Name("Is Whitelisted")
@Description("Whether or not the server or a player is whitelisted.")
@Examples({"if server is whitelisted:", "if player is whitelisted"})
Expand All @@ -42,7 +43,8 @@ public class CondIsWhitelisted extends Condition {
static {
Skript.registerCondition(CondIsWhitelisted.class,
"[the] server (is|1¦is(n't| not)) white[ ]listed",
"%players% (is|are)(|1¦(n't| not)) white[ ]listed");
"%players% (is|are)(|1¦(n't| not)) white[ ]listed",
"[the] server will [:not] be white[ ]listed");
}

@Nullable
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/ch/njol/skript/events/SimpleEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.destroystokyo.paper.event.player.PlayerJumpEvent;
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import com.destroystokyo.paper.event.player.PlayerReadyArrowEvent;
import com.destroystokyo.paper.event.server.WhitelistToggleEvent;
import io.papermc.paper.event.player.PlayerStopUsingItemEvent;
import io.papermc.paper.event.player.PlayerDeepSleepEvent;
import io.papermc.paper.event.player.PlayerInventorySlotChangeEvent;
Expand Down Expand Up @@ -780,6 +781,17 @@ public class SimpleEvents {
.since("INSERT VERSION")
.requiredPlugins("Spigot 1.19.4+");
}

Skript.registerEvent("Whitelist Toggle", SimpleEvent.class, WhitelistToggleEvent.class, "server whitelist [toggle]")
.description("Called when the server's whitelist is toggled.")
.examples(
"on server whitelist:",
"\tif the server will be whitelisted:",
"\t\tbroadcast \"This server is now whitelisted!\""
)
.since("INSERT VERSION")
.requiredPlugins("Paper");

}

}
Loading