mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-19 02:11:28 +02:00
89d51d5f29
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable. It should be noted that this decision does not promise all future exploits will be configurable.
33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Yannick Lamprecht <yannicklamprecht@live.de>
|
|
Date: Sat, 10 Feb 2024 20:50:01 +0100
|
|
Subject: [PATCH] improve BanList types
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 9f7ed337463cc9bb370a5541d9de5cd8f9c1a78a..c490a29bcf7410bc54959ee71375605964379ed5 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2215,6 +2215,21 @@ public final class CraftServer implements Server {
|
|
};
|
|
}
|
|
|
|
+ // Paper start - add BanListType (which has a generic)
|
|
+ @SuppressWarnings("unchecked")
|
|
+ @Override
|
|
+ public <B extends BanList<E>, E> B getBanList(final io.papermc.paper.ban.BanListType<B> type) {
|
|
+ Preconditions.checkArgument(type != null, "BanList.BanType cannot be null");
|
|
+ if (type == io.papermc.paper.ban.BanListType.IP) {
|
|
+ return (B) new CraftIpBanList(this.playerList.getIpBans());
|
|
+ } else if (type == io.papermc.paper.ban.BanListType.PROFILE) {
|
|
+ return (B) new CraftProfileBanList(this.playerList.getBans());
|
|
+ } else {
|
|
+ throw new IllegalArgumentException("Unknown BanListType: " + type);
|
|
+ }
|
|
+ }
|
|
+ // Paper end - add BanListType (which has a generic)
|
|
+
|
|
@Override
|
|
public void setWhitelist(boolean value) {
|
|
this.playerList.setUsingWhiteList(value);
|