Files
Purpur/patches/server/0261-Make-pufferfish-config-relocatable.patch
granny 639bcbd780 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@f9c7f2a Begin switching to JSpecify annotations (#11448)
PaperMC/Paper@e3c8a8e Add PlayerInsertLecternBookEvent [1.20 port] (#7305)
PaperMC/Paper@b410fe8 Configurable per-world void damage offset/damage(#11436)
PaperMC/Paper@ea00be3 Do not NPE on uuid resolution in player profile (#11449)
PaperMC/Paper@ba3c29b Finish converting all events to jspecify annotations
PaperMC/Paper@e7e1ab5 Finish converting most of the undeprecated api to jspecify
PaperMC/Paper@69ffbec Fix hex color check
PaperMC/Paper@709f0f2 Use components properly in ProfileWhitelistVerifyEvent (#11456)
PaperMC/Paper@fb76840 [ci skip] Add section on nullability annotations (#11461)
PaperMC/Paper@7cd4f2c Check if leash tag has a uuid
2024-10-03 17:08:59 -07:00

57 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Sun, 12 Jun 2022 09:18:57 -0500
Subject: [PATCH] Make pufferfish config relocatable
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index bcaf4932c82b0e6702450e2feb09828edf58cbf0..8f1645573780d12bf29d441d31eab1b76cd9e70f 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -28,6 +28,7 @@ public class PufferfishConfig {
private static final YamlFile config = new YamlFile();
private static int updates = 0;
+ public static File pufferfishFile; // Purpur
private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
ConfigurationSection newSection = new MemoryConfiguration();
@@ -50,7 +51,7 @@ public class PufferfishConfig {
}
public static void load() throws IOException {
- File configFile = new File("pufferfish.yml");
+ File configFile = pufferfishFile; // Purpur
if (configFile.exists()) {
try {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 430418990e218bca55fd7c817086bf7a6866fa1a..4bd75f2a4f932fc63efd4e4d884aa834184250fa 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -248,6 +248,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
+ gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 316c5e1460ccf3386c4c8623eabb7f087df8c4b9..e35a562eec4b65335723c50180fe1471f858ae60 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -182,6 +182,12 @@ public class Main {
.ofType(File.class)
.defaultsTo(new File("purpur.yml"))
.describedAs("Yml file");
+
+ acceptsAll(asList("pufferfish", "pufferfish-settings"), "File for pufferfish settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("pufferfish.yml"))
+ .describedAs("Yml file");
// Purpur end
// Paper start