From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Wed, 23 Nov 2022 21:05:47 +0100 Subject: [PATCH] Gale configuration License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org This patch is based on the following patch: "Paper config files" By: Jake Potrebic As part of: Paper (https://github.com/PaperMC/Paper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java index 478b9fba67f10dec1717a0d0bcb538cf0ad3afa1..f6dd9e279155969ba05b44083018e074e11b0bb9 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java @@ -301,6 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation @@ -474,6 +475,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor + super(serverLevelData, dimension, server.registryAccess(), levelStem.type(), false, isDebug, biomeZoomSeed, server.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> server.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), spigotConfig -> server.galeConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(levelStorageAccess.levelDirectory.path(), serverLevelData.getLevelName(), dimension.location(), spigotConfig, server.registryAccess(), serverLevelData.getGameRules())), dispatcher); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Gale - Gale configuration this.pvpMode = server.isPvpAllowed(); this.levelStorageAccess = levelStorageAccess; this.uuid = org.bukkit.craftbukkit.util.WorldUUID.getOrCreate(levelStorageAccess.levelDirectory.path().toFile()); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java index a0f3795f3aee1541ddab81da3cd8391f0a70e03d..e37635e452a38140099ba0a1fd5fcc6e8eaea2cd 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -160,6 +160,13 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl } // Paper end - add paper world config + // Gale start - Gale configuration + private final org.galemc.gale.configuration.GaleWorldConfiguration galeConfig; + public org.galemc.gale.configuration.GaleWorldConfiguration galeConfig() { + return this.galeConfig; + } + // Gale end - Gale configuration + public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files public static @Nullable BlockPos lastPhysicsProblem; // Spigot private int tileTickPosition; @@ -871,6 +878,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl org.bukkit.World.Environment environment, // Paper java.util.function.Function paperWorldConfigCreator, // Paper - create paper world config + java.util.function.Function galeWorldConfigCreator, // Gale - Gale configuration java.util.concurrent.Executor executor // Paper - Anti-Xray ) { // Paper start - getblock optimisations - cache world height/sections @@ -885,6 +894,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), environment); // Purpur - Purpur config files + this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config this.generator = generator; this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);