diff --git a/paper-server/patches/features/0031-SW-Remove-Worldlock-and-Symlink-Check.patch b/paper-server/patches/features/0031-SW-Remove-Worldlock-and-Symlink-Check.patch new file mode 100644 index 000000000..c67d3e08c --- /dev/null +++ b/paper-server/patches/features/0031-SW-Remove-Worldlock-and-Symlink-Check.patch @@ -0,0 +1,72 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chaoscaot +Date: Wed, 25 Dec 2024 12:18:00 +0100 +Subject: [PATCH] SW Remove Worldlock and Symlink Check + + +diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java +index de43e54698125ce9f319d4889dd49f7029fe95e0..e21d744040bcf58b391f002f2dd1129e532ff1b6 100644 +--- a/net/minecraft/world/level/storage/LevelStorageSource.java ++++ b/net/minecraft/world/level/storage/LevelStorageSource.java +@@ -343,7 +343,7 @@ public class LevelStorageSource { + + public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String saveName, ResourceKey dimensionType) throws IOException, ContentValidationException { // CraftBukkit + Path levelPath = this.getLevelPath(saveName); +- List list = Boolean.getBoolean("paper.disableWorldSymlinkValidation") ? List.of() : this.worldDirValidator.validateDirectory(levelPath, true); // Paper - add skipping of symlinks scan ++ List list = List.of(); // Paper - add skipping of symlinks scan + if (!list.isEmpty()) { + throw new ContentValidationException(levelPath, list); + } else { +@@ -420,7 +420,6 @@ public class LevelStorageSource { + } + + public class LevelStorageAccess implements AutoCloseable { +- final DirectoryLock lock; + public final LevelStorageSource.LevelDirectory levelDirectory; + private final String levelId; + private final Map resources = Maps.newHashMap(); +@@ -432,7 +431,6 @@ public class LevelStorageSource { + // CraftBukkit end + this.levelId = levelId; + this.levelDirectory = new LevelStorageSource.LevelDirectory(levelDir); +- this.lock = DirectoryLock.create(levelDir); + } + + public long estimateDiskSpace() { +@@ -476,9 +474,7 @@ public class LevelStorageSource { + } + + private void checkLock() { +- if (!this.lock.isValid()) { +- throw new IllegalStateException("Lock is no longer valid"); +- } ++ //nope + } + + public PlayerDataStorage createPlayerStorage() { +@@ -532,7 +528,7 @@ public class LevelStorageSource { + } + + public Optional getIconFile() { +- return !this.lock.isValid() ? Optional.empty() : Optional.of(this.levelDirectory.iconFile()); ++ return Optional.of(this.levelDirectory.iconFile()); + } + + public void deleteLevel() throws IOException { +@@ -561,7 +557,6 @@ public class LevelStorageSource { + throw exception; + } else { + if (dir.equals(LevelStorageAccess.this.levelDirectory.path())) { +- LevelStorageAccess.this.lock.close(); + Files.deleteIfExists(path); + } + +@@ -645,7 +640,7 @@ public class LevelStorageSource { + + @Override + public void close() throws IOException { +- this.lock.close(); ++ //ignored + } + + public boolean restoreLevelDataFromOld() { diff --git a/paper-server/patches/features/0032-SW-Disable-Commands.patch b/paper-server/patches/features/0032-SW-Disable-Commands.patch new file mode 100644 index 000000000..10c4950c1 --- /dev/null +++ b/paper-server/patches/features/0032-SW-Disable-Commands.patch @@ -0,0 +1,152 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chaoscaot +Date: Wed, 25 Dec 2024 12:31:02 +0100 +Subject: [PATCH] SW Disable Commands + + +diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java +index 19ccf3abf14c67f72a1ca065e4a304f50e645ef4..86d2a9b1cbe6e03066ea4a2034e2dd611bff67cb 100644 +--- a/net/minecraft/commands/Commands.java ++++ b/net/minecraft/commands/Commands.java +@@ -150,66 +150,66 @@ public class Commands { + private final CommandDispatcher dispatcher = new CommandDispatcher<>(); + + public Commands(Commands.CommandSelection selection, CommandBuildContext context) { +- AdvancementCommands.register(this.dispatcher); +- AttributeCommand.register(this.dispatcher, context); +- ExecuteCommand.register(this.dispatcher, context); +- BossBarCommands.register(this.dispatcher, context); ++ //AdvancementCommands.register(this.dispatcher); ++ //AttributeCommand.register(this.dispatcher, context); ++ //ExecuteCommand.register(this.dispatcher, context); ++ //BossBarCommands.register(this.dispatcher, context); + ClearInventoryCommands.register(this.dispatcher, context); +- CloneCommands.register(this.dispatcher, context); +- DamageCommand.register(this.dispatcher, context); +- DataCommands.register(this.dispatcher); +- DataPackCommand.register(this.dispatcher); +- DebugCommand.register(this.dispatcher); +- DefaultGameModeCommands.register(this.dispatcher); +- DifficultyCommand.register(this.dispatcher); ++ //CloneCommands.register(this.dispatcher, context); ++ //DamageCommand.register(this.dispatcher, context); ++ //DataCommands.register(this.dispatcher); ++ //DataPackCommand.register(this.dispatcher); ++ //DebugCommand.register(this.dispatcher); ++ //DefaultGameModeCommands.register(this.dispatcher); ++ //DifficultyCommand.register(this.dispatcher); + EffectCommands.register(this.dispatcher, context); +- EmoteCommands.register(this.dispatcher); ++ //EmoteCommands.register(this.dispatcher); + EnchantCommand.register(this.dispatcher, context); +- ExperienceCommand.register(this.dispatcher); +- FillCommand.register(this.dispatcher, context); ++ //ExperienceCommand.register(this.dispatcher); ++ //FillCommand.register(this.dispatcher, context); + FillBiomeCommand.register(this.dispatcher, context); +- ForceLoadCommand.register(this.dispatcher); +- FunctionCommand.register(this.dispatcher); ++ //ForceLoadCommand.register(this.dispatcher); ++ //FunctionCommand.register(this.dispatcher); + GameModeCommand.register(this.dispatcher); + GameRuleCommand.register(this.dispatcher, context); + GiveCommand.register(this.dispatcher, context); +- HelpCommand.register(this.dispatcher); +- ItemCommands.register(this.dispatcher, context); ++ //HelpCommand.register(this.dispatcher); ++ //ItemCommands.register(this.dispatcher, context); + KickCommand.register(this.dispatcher); + KillCommand.register(this.dispatcher); +- ListPlayersCommand.register(this.dispatcher); +- LocateCommand.register(this.dispatcher, context); +- LootCommand.register(this.dispatcher, context); +- MsgCommand.register(this.dispatcher); +- ParticleCommand.register(this.dispatcher, context); +- PlaceCommand.register(this.dispatcher); +- PlaySoundCommand.register(this.dispatcher); +- RandomCommand.register(this.dispatcher); +- ReloadCommand.register(this.dispatcher); +- RecipeCommand.register(this.dispatcher); +- ReturnCommand.register(this.dispatcher); +- RideCommand.register(this.dispatcher); ++ //ListPlayersCommand.register(this.dispatcher); ++ //LocateCommand.register(this.dispatcher, context); ++ //LootCommand.register(this.dispatcher, context); ++ //MsgCommand.register(this.dispatcher); ++ //ParticleCommand.register(this.dispatcher, context); ++ //PlaceCommand.register(this.dispatcher); ++ //PlaySoundCommand.register(this.dispatcher); ++ //RandomCommand.register(this.dispatcher); ++ //ReloadCommand.register(this.dispatcher); ++ //RecipeCommand.register(this.dispatcher); ++ //ReturnCommand.register(this.dispatcher); ++ //RideCommand.register(this.dispatcher); + RotateCommand.register(this.dispatcher); +- SayCommand.register(this.dispatcher); +- ScheduleCommand.register(this.dispatcher); +- ScoreboardCommand.register(this.dispatcher, context); +- SeedCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED); +- SetBlockCommand.register(this.dispatcher, context); +- SetSpawnCommand.register(this.dispatcher); ++ //SayCommand.register(this.dispatcher); ++ //ScheduleCommand.register(this.dispatcher); ++ //ScoreboardCommand.register(this.dispatcher, context); ++ //SeedCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED); ++ //SetBlockCommand.register(this.dispatcher, context); ++ //SetSpawnCommand.register(this.dispatcher); + SetWorldSpawnCommand.register(this.dispatcher); + SpectateCommand.register(this.dispatcher); +- SpreadPlayersCommand.register(this.dispatcher); +- StopSoundCommand.register(this.dispatcher); ++ //SpreadPlayersCommand.register(this.dispatcher); ++ //StopSoundCommand.register(this.dispatcher); + SummonCommand.register(this.dispatcher, context); +- TagCommand.register(this.dispatcher); +- TeamCommand.register(this.dispatcher, context); +- TeamMsgCommand.register(this.dispatcher); ++ //TagCommand.register(this.dispatcher); ++ //TeamCommand.register(this.dispatcher, context); ++ //TeamMsgCommand.register(this.dispatcher); + TeleportCommand.register(this.dispatcher); +- TellRawCommand.register(this.dispatcher, context); ++ //TellRawCommand.register(this.dispatcher, context); + TickCommand.register(this.dispatcher); + TimeCommand.register(this.dispatcher); +- TitleCommand.register(this.dispatcher, context); +- TriggerCommand.register(this.dispatcher); ++ //TitleCommand.register(this.dispatcher, context); ++ //TriggerCommand.register(this.dispatcher); + WeatherCommand.register(this.dispatcher); + WorldBorderCommand.register(this.dispatcher); + if (JvmProfiler.INSTANCE.isAvailable()) { +@@ -230,20 +230,20 @@ public class Commands { + } + + if (selection.includeDedicated) { +- BanIpCommands.register(this.dispatcher); +- BanListCommands.register(this.dispatcher); +- BanPlayerCommands.register(this.dispatcher); +- DeOpCommands.register(this.dispatcher); +- OpCommand.register(this.dispatcher); +- PardonCommand.register(this.dispatcher); +- PardonIpCommand.register(this.dispatcher); +- PerfCommand.register(this.dispatcher); ++ //BanIpCommands.register(this.dispatcher); ++ //BanListCommands.register(this.dispatcher); ++ //BanPlayerCommands.register(this.dispatcher); ++ //DeOpCommands.register(this.dispatcher); ++ //OpCommand.register(this.dispatcher); ++ //PardonCommand.register(this.dispatcher); ++ //PardonIpCommand.register(this.dispatcher); ++ //PerfCommand.register(this.dispatcher); + SaveAllCommand.register(this.dispatcher); + SaveOffCommand.register(this.dispatcher); + SaveOnCommand.register(this.dispatcher); +- SetPlayerIdleTimeoutCommand.register(this.dispatcher); ++ //SetPlayerIdleTimeoutCommand.register(this.dispatcher); + StopCommand.register(this.dispatcher); +- TransferCommand.register(this.dispatcher); ++ //TransferCommand.register(this.dispatcher); + WhitelistCommand.register(this.dispatcher); + } + diff --git a/paper-server/patches/features/0033-SW-Remove-Debug-Message.patch b/paper-server/patches/features/0033-SW-Remove-Debug-Message.patch new file mode 100644 index 000000000..64f39d2e8 --- /dev/null +++ b/paper-server/patches/features/0033-SW-Remove-Debug-Message.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chaoscaot +Date: Wed, 25 Dec 2024 12:36:40 +0100 +Subject: [PATCH] SW Remove Debug Message + + +diff --git a/net/minecraft/server/players/StoredUserList.java b/net/minecraft/server/players/StoredUserList.java +index d445e8f126f077d8419c52fa5436ea963a1a42a4..dfb0d766b5244646d18ddec5d8b91eddb69d9e97 100644 +--- a/net/minecraft/server/players/StoredUserList.java ++++ b/net/minecraft/server/players/StoredUserList.java +@@ -12,6 +12,7 @@ import com.mojang.logging.LogUtils; + import java.io.BufferedReader; + import java.io.BufferedWriter; + import java.io.File; ++import java.io.FileNotFoundException; + import java.io.IOException; + import java.nio.charset.StandardCharsets; + import java.util.Collection; +@@ -103,6 +104,8 @@ public abstract class StoredUserList> { + + try (BufferedWriter writer = Files.newWriter(this.file, StandardCharsets.UTF_8)) { + GSON.toJson(jsonArray, GSON.newJsonWriter(writer)); ++ } catch (FileNotFoundException e) { ++ return; + } + } + diff --git a/paper-server/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java b/paper-server/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java index 660b2ec6b..2f5bbffe1 100644 --- a/paper-server/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java +++ b/paper-server/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java @@ -92,7 +92,7 @@ public enum VersionHistoryManager { )) { gson.toJson(currentData, writer); } catch (final IOException e) { - logger.log(Level.SEVERE, "Failed to write to version history file", e); + // logger.log(Level.SEVERE, "Failed to write to version history file", e); } } diff --git a/paper-server/src/main/java/io/papermc/paper/configuration/Configurations.java b/paper-server/src/main/java/io/papermc/paper/configuration/Configurations.java index 109e569b7..c012f1242 100644 --- a/paper-server/src/main/java/io/papermc/paper/configuration/Configurations.java +++ b/paper-server/src/main/java/io/papermc/paper/configuration/Configurations.java @@ -112,7 +112,7 @@ public abstract class Configurations { loader.save(node); } catch (ConfigurateException ex) { if (ex.getCause() instanceof AccessDeniedException) { - LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex); + //LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex); } else throw ex; } } diff --git a/paper-server/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/paper-server/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java index 098ab351d..78498a907 100644 --- a/paper-server/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/paper-server/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java @@ -463,8 +463,6 @@ public class PaperConfigurations extends Configurations