9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/divinemc-server/minecraft-patches/features/0072-Configurable-Files-Locations.patch
2025-11-17 17:25:30 +03:00

46 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: dan28000 <84990628+dan28000@users.noreply.github.com>
Date: Mon, 6 Oct 2025 14:17:59 +0200
Subject: [PATCH] Configurable Files Locations
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index eb3f3a2d70de239b8324b35529987daf70202042..c5c24720058be1782ec71905ae04c8448fc902d7 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -100,10 +100,12 @@ import net.minecraft.world.scores.Team;
import org.slf4j.Logger;
public abstract class PlayerList {
- public static final File USERBANLIST_FILE = new File("banned-players.json");
- public static final File IPBANLIST_FILE = new File("banned-ips.json");
- public static final File OPLIST_FILE = new File("ops.json");
- public static final File WHITELIST_FILE = new File("whitelist.json");
+ // DivineMC start - Configurable Files Locations
+ public static File USERBANLIST_FILE = new File("banned-players.json");
+ public static File IPBANLIST_FILE = new File("banned-ips.json");
+ public static File OPLIST_FILE = new File("ops.json");
+ public static File WHITELIST_FILE = new File("whitelist.json");
+ // DivineMC end - Configurable Files Locations
public static final Component CHAT_FILTERED_FULL = Component.translatable("chat.filtered_full");
public static final Component DUPLICATE_LOGIN_DISCONNECT_MESSAGE = Component.translatable("multiplayer.disconnect.duplicate_login");
private static final Logger LOGGER = LogUtils.getLogger();
@@ -141,10 +143,17 @@ public abstract class PlayerList {
this.server = server;
this.registries = registries;
this.playerIo = playerIo;
+ // DivineMC start - Configurable Files Locations
+ USERBANLIST_FILE = (File) server.options.valueOf("banned-players");
+ IPBANLIST_FILE = (File) server.options.valueOf("banned-ips");
+ OPLIST_FILE = (File) server.options.valueOf("ops");
+ WHITELIST_FILE = (File) server.options.valueOf("whitelist");
+
this.whitelist = new UserWhiteList(WHITELIST_FILE, notificationService);
this.ops = new ServerOpList(OPLIST_FILE, notificationService);
this.bans = new UserBanList(USERBANLIST_FILE, notificationService);
this.ipBans = new IpBanList(IPBANLIST_FILE, notificationService);
+ // DivineMC end - Configurable Files Locations
}
abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor