Paper/patches/server/0472-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch

34 lines
2.2 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 10 Jul 2020 13:12:33 -0500
Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
2022-03-01 06:43:03 +01:00
index 6a006f22d33491be4413fb64649ba9f6f51acac8..e17bb884929d4f4b7dc5b2d71234ff81d840c994 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
2022-03-01 06:43:03 +01:00
@@ -137,11 +137,20 @@ public class Main {
2021-06-11 14:02:28 +02:00
return;
}
- File file = (File) optionset.valueOf("universe"); // CraftBukkit
+ // Paper start - fix SPIGOT-5824
+ File file;
+ File userCacheFile = new File("usercache.json");
+ if (optionset.has("universe")) {
+ file = (File) optionset.valueOf("universe"); // CraftBukkit
+ userCacheFile = new File(file, "usercache.json");
+ } else {
+ file = new File(bukkitConfiguration.getString("settings.world-container", "."));
+ }
+ // Paper end - fix SPIGOT-5824
YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY); // Paper
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
- GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
+ GameProfileCache usercache = new GameProfileCache(gameprofilerepository, userCacheFile); // Paper - only move usercache.json into folder if --universe is used, not world-container
// CraftBukkit start
2021-06-14 12:42:08 +02:00
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
2021-06-11 14:02:28 +02:00
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());