Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@78eb3aaf Start discouraging world name use (#13760)
PaperMC/Paper@6f4b0045 Add earlier trigger for world migration delay in vanilla logic (#13792)
PaperMC/Paper@02ec8e95 [ci/skip] Remove dead disableGameRuleLimits property reading
This commit is contained in:
granny
2026-04-19 17:49:36 -07:00
parent e64b1b2add
commit 28ce941fa2
11 changed files with 39 additions and 27 deletions

View File

@@ -74,8 +74,8 @@ public class PurpurConfig {
commands = new HashMap<>();
commands.put("purpur", new PurpurCommand("purpur"));
version = getInt("config-version", 47);
set("config-version", 47);
version = getInt("config-version", 48);
set("config-version", 48);
readConfig(PurpurConfig.class, null);

View File

@@ -6,6 +6,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
import java.util.logging.Level;
import net.kyori.adventure.key.Key;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.Identifier;
import net.minecraft.util.Mth;
@@ -19,6 +20,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.properties.Tilt;
import org.apache.commons.lang3.BooleanUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
@@ -35,16 +37,26 @@ import static org.purpurmc.purpur.PurpurConfig.log;
@SuppressWarnings("unused")
public class PurpurWorldConfig {
private final String legacyWorldName;
private final String worldName;
private final World.Environment environment;
public PurpurWorldConfig(String worldName, World.Environment environment) {
this.worldName = worldName;
public PurpurWorldConfig(String legacyWorldName, World.Environment environment, Key worldKey) {
this.legacyWorldName = legacyWorldName;
this.worldName = worldKey.asString();
this.environment = environment;
init();
}
public void init() {
if (PurpurConfig.version < 48) {
ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + this.legacyWorldName);
if (section != null) {
PurpurConfig.config.set("world-settings." + this.legacyWorldName, null);
PurpurConfig.config.set("world-settings." + this.worldName, section);
Bukkit.getLogger().info("NOTE: Migrated Purpur world config %s -> %s".formatted(this.legacyWorldName, this.worldName));
}
}
log("-------- World Settings For [" + worldName + "] --------");
PurpurConfig.readConfig(PurpurWorldConfig.class, this);
}