mirror of
https://github.com/PaperMC/Paper.git
synced 2024-08-25 06:03:03 +02:00
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: masmc05 <masmc05@gmail.com>
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 34242fa907bb87ef78cf96ca81ae224de750956f..927c3110a64cfab665137a6f0c8b72075168f2bf 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2218,6 +2218,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);
|