From c34a306393c4f6182a79efef051cc9d9a1e924d0 Mon Sep 17 00:00:00 2001 From: Owen <23108066+Owen1212055@users.noreply.github.com> Date: Thu, 9 Jun 2022 16:48:35 -0400 Subject: [PATCH] Remove old config options (#7908) --- patches/server/0004-Paper-config-files.patch | 72 ++++++++++++++++++- patches/server/0009-Paper-command.patch | 4 +- patches/server/0011-Paper-Metrics.patch | 6 +- patches/server/0353-Anti-Xray.patch | 4 +- ...-Add-tick-times-API-and-mspt-command.patch | 4 +- 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch index 078373cd3..a23862a5d 100644 --- a/patches/server/0004-Paper-config-files.patch +++ b/patches/server/0004-Paper-config-files.patch @@ -835,10 +835,10 @@ index 0000000000000000000000000000000000000000..69add4a7f1147015806bc9b63a8340d1 +} diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java new file mode 100644 -index 0000000000000000000000000000000000000000..4ee18a87d3160ef41654116f033a01f2e52513f2 +index 0000000000000000000000000000000000000000..d25393aa10a02a74f500c520bfb2979428693177 --- /dev/null +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -@@ -0,0 +1,375 @@ +@@ -0,0 +1,392 @@ +package io.papermc.paper.configuration; + +import com.google.common.base.Suppliers; @@ -886,8 +886,10 @@ index 0000000000000000000000000000000000000000..4ee18a87d3160ef41654116f033a01f2 +import org.spongepowered.configurate.ConfigurateException; +import org.spongepowered.configurate.ConfigurationNode; +import org.spongepowered.configurate.ConfigurationOptions; ++import org.spongepowered.configurate.NodePath; +import org.spongepowered.configurate.objectmapping.ObjectMapper; +import org.spongepowered.configurate.transformation.ConfigurationTransformation; ++import org.spongepowered.configurate.transformation.TransformAction; +import org.spongepowered.configurate.yaml.YamlConfigurationLoader; + +import java.io.File; @@ -1045,6 +1047,21 @@ index 0000000000000000000000000000000000000000..4ee18a87d3160ef41654116f033a01f2 + LOGGER.warn("The world config file for " + world + " didn't have a version set, assuming latest"); + version.raw(WorldConfiguration.CURRENT_VERSION); + } ++ ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder(); ++ for (NodePath path : RemovedConfigurations.REMOVED_WORLD_PATHS) { ++ builder.addAction(path, TransformAction.remove()); ++ } ++ builder.build().apply(node); ++ // ADD FUTURE TRANSFORMS HERE ++ } ++ ++ @Override ++ protected void applyGlobalConfigTransformations(ConfigurationNode node) throws ConfigurateException { ++ ConfigurationTransformation.Builder builder = ConfigurationTransformation.builder(); ++ for (NodePath path : RemovedConfigurations.REMOVED_GLOBAL_PATHS) { ++ builder.addAction(path, TransformAction.remove()); ++ } ++ builder.build().apply(node); + // ADD FUTURE TRANSFORMS HERE + } + @@ -1214,6 +1231,57 @@ index 0000000000000000000000000000000000000000..4ee18a87d3160ef41654116f033a01f2 + return BasicConfigurationNode.root(options); + } +} +diff --git a/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java b/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java +new file mode 100644 +index 0000000000000000000000000000000000000000..70eca3b294688db4af4445b324d6b5dec988cb73 +--- /dev/null ++++ b/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java +@@ -0,0 +1,45 @@ ++package io.papermc.paper.configuration; ++ ++import org.spongepowered.configurate.NodePath; ++ ++import static org.spongepowered.configurate.NodePath.path; ++ ++interface RemovedConfigurations { ++ ++ NodePath[] REMOVED_WORLD_PATHS = { ++ path("elytra-hit-wall-damage"), ++ path("queue-light-updates"), ++ path("save-queue-limit-for-auto-save"), ++ path("max-chunk-sends-per-tick"), ++ path("max-chunk-gens-per-tick"), ++ path("fire-physics-event-for-redstone"), ++ path("fix-zero-tick-instant-grow-farms"), ++ path("bed-search-radius"), ++ path("lightning-strike-distance-limit"), ++ path("fix-wither-targeting-bug"), ++ path("remove-corrupt-tile-entities"), ++ path("allow-leashing-undead-horse"), ++ path("reset-arrow-despawn-timer-on-fall"), ++ path("seed-based-feature-search"), ++ path("seed-based-feature-search-loads-chunks"), ++ path("viewdistances.no-tick-view-distance"), ++ path("seed-based-feature-search"), // unneeded as of 1.18 ++ path("seed-based-feature-search-loads-chunks"), // unneeded as of 1.18 ++ path("reset-arrow-despawn-timer-on-fall"), ++ path("squid-spawn-height"), ++ path("viewdistances"), ++ }; ++ ++ NodePath[] REMOVED_GLOBAL_PATHS = { ++ path("queue-light-updates-max-loss"), ++ path("sleep-between-chunk-saves"), ++ path("remove-invalid-statistics"), ++ path("min-chunk-load-threads"), ++ path("use-versioned-world"), ++ path("save-player-data"), // to spigot (converted) ++ path("log-named-entity-deaths"), // default in vanilla ++ path("chunk-tasks-per-tick"), // removed in tuinity merge ++ path("item-validation", "loc-name") ++ }; ++ ++} diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..4a1a7e9764dc6f64cc2968baf5958d0cde87cbe2 diff --git a/patches/server/0009-Paper-command.patch b/patches/server/0009-Paper-command.patch index 3f29b13d4..a1dd2d7de 100644 --- a/patches/server/0009-Paper-command.patch +++ b/patches/server/0009-Paper-command.patch @@ -297,7 +297,7 @@ index 0000000000000000000000000000000000000000..e75134a6aa92c86aa86430c7603e1112 + } +} diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index 4ee18a87d3160ef41654116f033a01f2e52513f2..093c157034cb6e245a6cc0a23ded073f05b6bb3c 100644 +index d25393aa10a02a74f500c520bfb2979428693177..2e8da92c09fca465b754e45e0bf9984b978557e9 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java @@ -1,5 +1,6 @@ @@ -307,7 +307,7 @@ index 4ee18a87d3160ef41654116f033a01f2e52513f2..093c157034cb6e245a6cc0a23ded073f import com.google.common.base.Suppliers; import com.google.common.collect.Table; import com.mojang.logging.LogUtils; -@@ -333,6 +334,7 @@ public class PaperConfigurations extends Configurations COMMANDS = new HashMap<>(); static { diff --git a/patches/server/0011-Paper-Metrics.patch b/patches/server/0011-Paper-Metrics.patch index 0101bdee9..98cdc3148 100644 --- a/patches/server/0011-Paper-Metrics.patch +++ b/patches/server/0011-Paper-Metrics.patch @@ -690,7 +690,7 @@ index 0000000000000000000000000000000000000000..5a19e30a9b7e65a70f68a429b8ca741f + } +} diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index 093c157034cb6e245a6cc0a23ded073f05b6bb3c..6b4635bf556fe966a835a0ba741fbe3fa0083d9a 100644 +index 2e8da92c09fca465b754e45e0bf9984b978557e9..b1845b20091b2a28a988f729c18415bb801a2b51 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java @@ -1,5 +1,6 @@ @@ -700,7 +700,7 @@ index 093c157034cb6e245a6cc0a23ded073f05b6bb3c..6b4635bf556fe966a835a0ba741fbe3f import com.destroystokyo.paper.PaperCommand; import com.google.common.base.Suppliers; import com.google.common.collect.Table; -@@ -333,6 +334,7 @@ public class PaperConfigurations extends Configurations COMMANDS = new HashMap<>(); @@ -708,7 +708,7 @@ index 093c157034cb6e245a6cc0a23ded073f05b6bb3c..6b4635bf556fe966a835a0ba741fbe3f static { COMMANDS.put("paper", new PaperCommand("paper")); } -@@ -341,6 +343,11 @@ public class PaperConfigurations extends Configurations { server.server.getCommandMap().register(s, "Paper", command); }); diff --git a/patches/server/0353-Anti-Xray.patch b/patches/server/0353-Anti-Xray.patch index ba088ffa0..3512efc9d 100644 --- a/patches/server/0353-Anti-Xray.patch +++ b/patches/server/0353-Anti-Xray.patch @@ -1017,7 +1017,7 @@ index 0000000000000000000000000000000000000000..80a2dfb266ae1221680a7b24fee2f7e2 + } +} diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index b49e7949337517dcf1dd0738b3f8573a04efcae5..0ee70d37ac22da84f671b688863ff691961ad652 100644 +index ab145a47bef1d356e28c719e5c25552ff4bc6555..e4845a818b3a9dc3b06a67b3a461ce506bb37cba 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java @@ -2,6 +2,7 @@ package io.papermc.paper.configuration; @@ -1028,7 +1028,7 @@ index b49e7949337517dcf1dd0738b3f8573a04efcae5..0ee70d37ac22da84f671b688863ff691 import com.google.common.base.Suppliers; import com.google.common.collect.Table; import com.mojang.logging.LogUtils; -@@ -189,6 +190,7 @@ public class PaperConfigurations extends Configurations