From eeb927f0f0fe17821e8023dec928dc4f57fe33de Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Sun, 28 Dec 2025 22:58:57 -0500 Subject: [PATCH 01/10] feat: initial 1.21.11 support --- gradle.properties | 9 +++--- gradle/libs.versions.toml | 4 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- legitslimepaper-api/build.gradle.kts.patch | 2 +- .../asp/SlimeNMSBridgeImpl.java.patch | 4 +-- .../asp/level/SlimeLevelInstance.java.patch | 8 ++--- legitslimepaper-server/build.gradle.kts.patch | 6 ++-- .../minecraft/commands/Commands.java.patch | 26 ++++++---------- .../functions/MacroFunction.java.patch | 12 ++----- .../minecraft/network/chat/Style.java.patch | 12 ++----- .../resources/RegistryDataLoader.java.patch | 4 +-- .../net/minecraft/server/Main.java.patch | 31 ++----------------- .../server/ServerFunctionLibrary.java.patch | 24 +++++--------- .../server/commands/ExecuteCommand.java.patch | 6 ++-- .../server/commands/TickCommand.java.patch | 4 +-- .../server/level/ServerChunkCache.java.patch | 6 ++-- .../server/level/ServerPlayer.java.patch | 2 +- .../ServerGamePacketListenerImpl.java.patch | 18 +++++------ .../server/players/PlayerList.java.patch | 2 +- .../world/entity/player/Player.java.patch | 12 +++---- .../world/level/BaseCommandBlock.java.patch | 8 ++--- .../craftbukkit/util/Versioning.java.patch | 11 ------- 22 files changed, 72 insertions(+), 141 deletions(-) delete mode 100644 legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/Versioning.java.patch diff --git a/gradle.properties b/gradle.properties index 6861f66..1c9bd7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,11 @@ group=com.legitimoose.legitslimepaper -version=1.21.10-R0.1-SNAPSHOT -mcVersion=1.21.10 +version=1.21.11-R0.1-SNAPSHOT +mcVersion=1.21.11 #Update with ASP!! (also update gradle/libs.versions.toml) -aspRef=cd28d91fa92818b296ad914b584f9aae911e4045 -apiVersion=4.2.0-SNAPSHOT +aspRef=67110eba45e561f90ae74194d91e07e622fed23b +apiVersion=1.21.11 +aspApiVersion=4.2.0-SNAPSHOT org.gradle.caching=true org.gradle.parallel=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0cb3aa9..44916a7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ autoservice = "1.1.1" blossom = "2.1.0" bstats = "3.1.0" cloud-core = "2.0.0" -cloud-minecraft = "2.0.0-beta.10" +cloud-minecraft = "2.0.0-beta.14" configurate = "4.1.2" indra-git = "3.1.3" gradle-profiles = "0.54.0" @@ -15,7 +15,7 @@ lettuce = "6.5.1.RELEASE" lombok = "1.18.36" lombok-plugin = "8.11" mongo = "5.2.1" -paperweight = "2.0.0-beta.18" +paperweight = "2.0.0-beta.19" plugin-yml-paper = "0.6.0" shadow = "9.2.2" slf4j = "2.0.16" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 002b867..bad7c24 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/legitslimepaper-api/build.gradle.kts.patch b/legitslimepaper-api/build.gradle.kts.patch index 02e9a93..e9a4053 100644 --- a/legitslimepaper-api/build.gradle.kts.patch +++ b/legitslimepaper-api/build.gradle.kts.patch @@ -1,6 +1,6 @@ --- a/aspaper-api/build.gradle.kts +++ b/aspaper-api/build.gradle.kts -@@ -101,17 +_,21 @@ +@@ -103,17 +_,21 @@ java { srcDir(generatedDir) srcDir(file("../paper-api/src/main/java")) diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch index dad2d5a..59a1828 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch @@ -1,10 +1,10 @@ --- a/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java +++ b/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java -@@ -79,8 +_,10 @@ +@@ -80,8 +_,10 @@ // Some stuff is needed when loading overworld world SlimeLevelInstance instance = ((SlimeInMemoryWorld) this.loadInstance(defaultWorld, Level.OVERWORLD)).getInstance(); DimensionDataStorage worldpersistentdata = instance.getDataStorage(); -+ instance.getServer().readScoreboard(worldpersistentdata); // Moose ++ instance.getServer().getScoreboard().load(worldpersistentdata.computeIfAbsent(net.minecraft.world.scores.ScoreboardSaveData.TYPE).getData()); // Moose instance.getCraftServer().scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(instance.getServer(), instance.getScoreboard()); instance.getServer().commandStorage = new CommandStorage(worldpersistentdata); + instance.getServer().worldData = instance.serverLevelData; // Moose - Set default spawn location correctly (and prob more) diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch index 3c9c94a..0cc10f2 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch @@ -1,7 +1,7 @@ --- a/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java +++ b/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java -@@ -68,16 +_,10 @@ - public static LevelStorageSource CUSTOM_LEVEL_STORAGE; +@@ -71,16 +_,10 @@ + private static final Logger LOGGER = LogUtils.getClassLogger(); static { - try { @@ -21,7 +21,7 @@ } private static final ExecutorService WORLD_SAVER_SERVICE = Executors.newFixedThreadPool(4, new ThreadFactoryBuilder() -@@ -91,7 +_,7 @@ +@@ -94,7 +_,7 @@ org.bukkit.World.Environment environment) throws IOException { super(slimeBootstrap, MinecraftServer.getServer(), MinecraftServer.getServer().executor, @@ -30,7 +30,7 @@ primaryLevelData, worldKey, worldDimension, false, 0, Collections.emptyList(), true, null, environment, null, null); this.slimeInstance = new SlimeInMemoryWorld(slimeBootstrap, this); -@@ -169,6 +_,7 @@ +@@ -172,6 +_,7 @@ Bukkit.getPluginManager().callEvent(new WorldSaveEvent(getWorld())); //this.getChunkSource().save(forceSave); diff --git a/legitslimepaper-server/build.gradle.kts.patch b/legitslimepaper-server/build.gradle.kts.patch index 23c5238..edd8dc8 100644 --- a/legitslimepaper-server/build.gradle.kts.patch +++ b/legitslimepaper-server/build.gradle.kts.patch @@ -1,6 +1,6 @@ --- a/aspaper-server/build.gradle.kts +++ b/aspaper-server/build.gradle.kts -@@ -32,7 +_,22 @@ +@@ -31,7 +_,22 @@ } } @@ -23,7 +23,7 @@ + activeFork = legitslimepaper spigot { - enabled = true + enabled = false @@ -119,10 +_,14 @@ main { java { srcDir("../paper-server/src/main/java") } @@ -48,7 +48,7 @@ implementation(project(":core")) //ASP implementation("ca.spottedleaf:concurrentutil:0.0.7") implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ -@@ -221,14 +_,14 @@ +@@ -222,14 +_,14 @@ val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch index 2e23ffa..1e00373 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch @@ -20,7 +20,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; -@@ -40,7 +_,6 @@ +@@ -38,7 +_,6 @@ import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; @@ -28,15 +28,7 @@ import net.minecraft.network.chat.HoverEvent; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.protocol.game.ClientboundCommandsPacket; -@@ -145,6 +_,7 @@ - import net.minecraft.util.profiling.jfr.JvmProfiler; - import net.minecraft.world.flag.FeatureFlagSet; - import net.minecraft.world.flag.FeatureFlags; -+import net.minecraft.world.level.BaseCommandBlock; - import net.minecraft.world.level.GameRules; - import org.slf4j.Logger; - -@@ -177,6 +_,7 @@ +@@ -186,6 +_,7 @@ } }; private final CommandDispatcher dispatcher = new CommandDispatcher<>(); @@ -44,7 +36,7 @@ public Commands(Commands.CommandSelection selection, CommandBuildContext context) { // Paper start - Brigadier API - modern minecraft overloads that do not use redirects but are copies instead -@@ -293,6 +_,25 @@ +@@ -303,6 +_,25 @@ PublishCommand.register(this.dispatcher); } @@ -70,12 +62,12 @@ // Paper start - Vanilla command permission fixes for (final CommandNode node : this.dispatcher.getRoot().getChildren()) { if (node.getRequirement() == com.mojang.brigadier.builder.ArgumentBuilder.defaultRequirement()) { -@@ -360,6 +_,15 @@ +@@ -370,6 +_,15 @@ ContextChain contextChain = finishParsing(parseResults, command, commandSourceStack); try { + // Moose start - Command block whitelist -+ if (parseResults.getContext().getSource().source instanceof BaseCommandBlock.CloseableCommandBlockSource) { ++ if (parseResults.getContext().getSource().source instanceof net.minecraft.world.level.BaseCommandBlock.CloseableCommandBlockSource) { + List> context = parseResults.getContext().getNodes(); + if (!context.isEmpty() && !context.getFirst().getNode().commandBlockAllowed) { + throw new Exception("Non-vanilla commands cannot be executed in command blocks."); @@ -86,7 +78,7 @@ if (contextChain != null) { executeCommandInContext( commandSourceStack, -@@ -370,7 +_,7 @@ +@@ -380,7 +_,7 @@ } // Paper start } catch (Throwable var12) { // always gracefully handle it, no matter how bad:tm: @@ -95,12 +87,12 @@ // Paper end MutableComponent mutableComponent = Component.literal(var12.getMessage() == null ? var12.getClass().getName() : var12.getMessage()); LOGGER.error("Command exception: /{}", command, var12); // Paper - always show execution exception in console log -@@ -507,6 +_,20 @@ +@@ -518,6 +_,20 @@ runSync(player, bukkit, rootCommandNode); }); } + // Moose start - Make sure non-vanilla commands are restricted -+ static class SpecialPermissionCheck implements Predicate, PermissionSource.RestrictedMarker { ++ static class SpecialPermissionCheck implements Predicate, RestrictedMarker { + private final Predicate originalRequirement; + + public SpecialPermissionCheck(Predicate originalRequirement) { @@ -116,7 +108,7 @@ private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) { // Paper end - Perf: Async command map building -@@ -521,6 +_,15 @@ +@@ -532,6 +_,15 @@ } } // CraftBukkit end diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch index 6c93ee1..578f725 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch @@ -1,18 +1,10 @@ --- a/net/minecraft/commands/functions/MacroFunction.java +++ b/net/minecraft/commands/functions/MacroFunction.java -@@ -13,6 +_,7 @@ - import java.util.Locale; - import javax.annotation.Nullable; - import net.minecraft.Util; -+import net.minecraft.commands.Commands; - import net.minecraft.commands.ExecutionCommandSource; - import net.minecraft.commands.FunctionInstantiationException; - import net.minecraft.commands.execution.UnboundEntryAction; -@@ -51,6 +_,7 @@ +@@ -50,6 +_,7 @@ @Override public InstantiatedFunction instantiate(@Nullable CompoundTag arguments, CommandDispatcher dispatcher) throws FunctionInstantiationException { -+ dispatcher = (CommandDispatcher) Commands.vanillaCommands; // Moose ++ dispatcher = (CommandDispatcher) net.minecraft.commands.Commands.vanillaCommands; // Moose if (arguments == null) { throw new FunctionInstantiationException(Component.translatable("commands.function.error.missing_arguments", Component.translationArg(this.id()))); } else { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch index 903cf16..834bdf0 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/network/chat/Style.java.patch @@ -1,14 +1,6 @@ --- a/net/minecraft/network/chat/Style.java +++ b/net/minecraft/network/chat/Style.java -@@ -7,6 +_,7 @@ - import java.util.Optional; - import javax.annotation.Nullable; - import net.minecraft.ChatFormatting; -+import net.minecraft.commands.Commands; - import net.minecraft.network.RegistryFriendlyByteBuf; - import net.minecraft.network.codec.ByteBufCodecs; - import net.minecraft.network.codec.StreamCodec; -@@ -86,7 +_,20 @@ +@@ -76,7 +_,20 @@ this.underlined = underlined; this.strikethrough = strikethrough; this.obfuscated = obfuscated; @@ -21,7 +13,7 @@ + cmd = cmd.split(" ", 2)[0]; + String finalCmd = cmd; + -+ if (Commands.vanillaCommands.getRoot().getChildren().stream().noneMatch((node) -> node.commandBlockAllowed && finalCmd.startsWith(node.getName()))) { ++ if (net.minecraft.commands.Commands.vanillaCommands.getRoot().getChildren().stream().noneMatch((node) -> node.commandBlockAllowed && finalCmd.startsWith(node.getName()))) { + blackListedCommand = true; + } + } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch index 4d7c00d..ce10c62 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/resources/RegistryDataLoader.java +++ b/net/minecraft/resources/RegistryDataLoader.java -@@ -193,11 +_,12 @@ - map.put(registry.key(), new IllegalStateException("Registry must be non-empty: " + registry.key().location())); +@@ -199,11 +_,12 @@ + map.put(registry.key(), new IllegalStateException("Registry must be non-empty: " + registry.key().identifier())); } }); + // Moose start - Don't throw an exception on invalid registry diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch index ee2527c..add253f 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch @@ -8,34 +8,7 @@ import com.mojang.datafixers.DataFixer; import com.mojang.logging.LogUtils; import com.mojang.serialization.Dynamic; -@@ -16,12 +_,9 @@ - import java.util.Optional; - import java.util.function.BooleanSupplier; - import javax.annotation.Nullable; --import joptsimple.OptionParser; -+ - import joptsimple.OptionSet; --import joptsimple.OptionSpec; --import joptsimple.util.PathConverter; - import net.minecraft.CrashReport; --import net.minecraft.DefaultUncaughtExceptionHandler; - import net.minecraft.SharedConstants; - import net.minecraft.SuppressForbidden; - import net.minecraft.Util; -@@ -52,11 +_,7 @@ - import net.minecraft.world.level.levelgen.WorldDimensions; - import net.minecraft.world.level.levelgen.WorldOptions; - import net.minecraft.world.level.levelgen.presets.WorldPresets; --import net.minecraft.world.level.storage.LevelDataAndDimensions; --import net.minecraft.world.level.storage.LevelStorageSource; --import net.minecraft.world.level.storage.LevelSummary; --import net.minecraft.world.level.storage.PrimaryLevelData; --import net.minecraft.world.level.storage.WorldData; -+import net.minecraft.world.level.storage.*; - import org.slf4j.Logger; - - public class Main { -@@ -139,6 +_,8 @@ +@@ -137,6 +_,8 @@ return; } @@ -44,7 +17,7 @@ // Spigot start boolean eulaAgreed = Boolean.getBoolean("com.mojang.eula.agree"); if (eulaAgreed) { -@@ -228,7 +_,7 @@ +@@ -226,7 +_,7 @@ LOGGER.warn("Safe mode active, only vanilla datapack will be loaded"); } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch index b93ef68..efd45c0 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch @@ -1,19 +1,11 @@ --- a/net/minecraft/server/ServerFunctionLibrary.java +++ b/net/minecraft/server/ServerFunctionLibrary.java -@@ -17,6 +_,7 @@ - import java.util.concurrent.Executor; - import net.minecraft.commands.CommandSource; - import net.minecraft.commands.CommandSourceStack; -+import net.minecraft.commands.Commands; - import net.minecraft.commands.functions.CommandFunction; - import net.minecraft.core.Registry; - import net.minecraft.core.registries.Registries; -@@ -90,7 +_,7 @@ - ResourceLocation resourceLocation1 = LISTER.fileToId(resourceLocation); - map1.put(resourceLocation1, CompletableFuture.supplyAsync(() -> { - List lines = readLines(entry.getValue()); -- return CommandFunction.fromLines(resourceLocation1, this.dispatcher, commandSourceStack, lines); -+ return CommandFunction.fromLines(resourceLocation1, Commands.vanillaCommands, commandSourceStack, lines); - }, backgroundExecutor)); - } +@@ -85,7 +_,7 @@ + Identifier identifier1 = LISTER.fileToId(identifier); + map1.put(identifier1, CompletableFuture.supplyAsync(() -> { + List lines = readLines(entry.getValue()); +- return CommandFunction.fromLines(identifier1, this.dispatcher, commandSourceStack, lines); ++ return CommandFunction.fromLines(identifier1, Commands.vanillaCommands, commandSourceStack, lines); + }, backgroundExecutor)); + } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch index d802c19..2af1d4e 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/server/commands/ExecuteCommand.java +++ b/net/minecraft/server/commands/ExecuteCommand.java -@@ -142,7 +_,7 @@ +@@ -148,7 +_,7 @@ dispatcher.register( Commands.literal("execute") - .requires(Commands.hasPermission(2)) + .requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS)) - .then(Commands.literal("run").redirect(dispatcher.getRoot())) + .then(Commands.literal("run").redirect(Commands.vanillaCommands.getRoot())) // Moose - Only run vanilla commands .then(addConditionals(literalCommandNode, Commands.literal("if"), true, buildContext)) .then(addConditionals(literalCommandNode, Commands.literal("unless"), false, buildContext)) - .then(Commands.literal("as").then(Commands.argument("targets", EntityArgument.entities()).fork(literalCommandNode, commandContext -> { + .then(Commands.literal("as").then(Commands.argument("targets", EntityArgument.entities()).fork(literalCommandNode, context -> { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch index 6011af9..0bc674e 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch @@ -4,8 +4,8 @@ public static void register(CommandDispatcher dispatcher) { dispatcher.register( Commands.literal("tick") -- .requires(Commands.hasPermission(3)) -+ .requires(Commands.hasPermission(2)) +- .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) ++ .requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS)) .then(Commands.literal("query").executes(commandContext -> tickQuery(commandContext.getSource()))) .then( Commands.literal("rate") diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch index 9941af0..4dca4d7 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -211,7 +_,7 @@ +@@ -209,7 +_,7 @@ } //ASP start - No dimension data storage - if(level instanceof com.infernalsuite.asp.level.SlimeLevelInstance) { + if(level instanceof com.infernalsuite.asp.level.SlimeLevelInstance && false) { // Moose - Re-enable dat file storage - this.dataStorage = new com.infernalsuite.asp.level.ReadOnlyDimensionDataStorage(new SavedData.Context(level), path, fixerUpper, level.registryAccess()); + this.dataStorage = new com.infernalsuite.asp.level.ReadOnlyDimensionDataStorage(path, fixerUpper, level.registryAccess()); } else { - this.dataStorage = new DimensionDataStorage(new SavedData.Context(level), path, fixerUpper, level.registryAccess()); + this.dataStorage = new DimensionDataStorage(path, fixerUpper, level.registryAccess()); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 8590133..65c35e7 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -536,8 +_,8 @@ +@@ -526,8 +_,8 @@ } @Override diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 53ee027..b22c9b1 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,29 +1,29 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1367,7 +_,7 @@ +@@ -1384,7 +_,7 @@ @Override public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); -- if (this.player.hasPermissions(2)) { -+ if (this.player.hasPermissions(2) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission +- if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) { ++ if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission Entity entity = this.player.level().getEntity(packet.getEntityId()); if (entity != null) { try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { -@@ -1393,7 +_,7 @@ +@@ -1410,7 +_,7 @@ @Override public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); -- if (this.player.hasPermissions(2)) { -+ if (this.player.hasPermissions(2) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission +- if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) { ++ if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission BlockEntity blockEntity = this.player.level().getBlockEntity(packet.getPos()); CompoundTag compoundTag = blockEntity != null ? blockEntity.saveWithoutMetadata(this.player.registryAccess()) : null; this.send(new ClientboundTagQueryPacket(packet.getTransactionId(), compoundTag)); -@@ -3509,7 +_,7 @@ +@@ -3545,7 +_,7 @@ @Override public void handleChangeGameMode(ServerboundChangeGameModePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); -- if (!this.player.hasPermissions(2)) { -+ if (!this.player.hasPermissions(2) && !this.player.getBukkitEntity().hasPermission("minecraft.gamemodeswitcher")) { // Moose: Added a permission to allow players to change their own gamemode with F3 shortcut +- if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions())) { ++ if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.gamemodeswitcher")) { // Moose: Added a permission to allow players to change their own gamemode with F3 shortcut) LOGGER.warn( "Player {} tried to change game mode to {} without required permissions", this.player.getGameProfile().name(), diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch index 9cc83ec..03fe393 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1187,6 +_,8 @@ +@@ -1200,6 +_,8 @@ PlayerAdvancements playerAdvancements = player.getAdvancements(); // CraftBukkit if (playerAdvancements == null) { Path path = this.server.getWorldPath(LevelResource.PLAYER_ADVANCEMENTS_DIR).resolve(uuid + ".json"); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index d624243..87a7044 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -695,7 +_,7 @@ +@@ -690,7 +_,7 @@ } @Override @@ -9,7 +9,7 @@ super.addAdditionalSaveData(output); NbtUtils.addCurrentDataVersion(output); this.inventory.save(output.list("Inventory", ItemStackWithSlot.CODEC)); -@@ -708,7 +_,8 @@ +@@ -703,7 +_,8 @@ output.putInt("Score", this.getScore()); this.foodData.addAdditionalSaveData(output); output.store("abilities", Abilities.Packed.CODEC, this.abilities.pack()); @@ -19,12 +19,12 @@ this.lastDeathLocation.ifPresent(globalPos -> output.store("LastDeathLocation", GlobalPos.CODEC, globalPos)); output.storeNullable("current_explosion_impact_pos", Vec3.CODEC, this.currentImpulseImpactPos); output.putBoolean("ignore_fall_damage_from_current_explosion", this.ignoreFallDamageFromCurrentImpulse); -@@ -1891,7 +_,7 @@ +@@ -1998,7 +_,7 @@ } public boolean canUseGameMasterBlocks() { -- return this.abilities.instabuild && this.getPermissionLevel() >= 2; -+ return this.abilities.instabuild && (this.getPermissionLevel() >= 2 || this.getBukkitEntity().hasPermission("minecraft.commandblock")); // Moose - Add permission for interacting with GameMasterBlocks +- return this.abilities.instabuild && this.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER); ++ return this.abilities.instabuild && (this.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER) || this.getBukkitEntity().hasPermission("minecraft.commandblock")); // Moose - Add permission for interacting with GameMasterBlocks } - public int getPermissionLevel() { + public PermissionSet permissions() { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch index 0a2187c..7b73714 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/world/level/BaseCommandBlock.java +++ b/net/minecraft/world/level/BaseCommandBlock.java -@@ -104,7 +_,7 @@ +@@ -99,7 +_,7 @@ + return true; } else { this.successCount = 0; - MinecraftServer server = this.getLevel().getServer(); -- if (server.isCommandBlockEnabled() && !StringUtil.isNullOrEmpty(this.command)) { -+ if (server.isCommandBlockEnabled() && com.legitimoose.lsp.MooseConfig.allowCommandBlocks && !StringUtil.isNullOrEmpty(this.command)) { +- if (level.isCommandBlockEnabled() && !StringUtil.isNullOrEmpty(this.command)) { ++ if (level.isCommandBlockEnabled() && com.legitimoose.lsp.MooseConfig.allowCommandBlocks && !StringUtil.isNullOrEmpty(this.command)) { // Moose - allow command blocks config option try { this.lastOutput = null; diff --git a/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/Versioning.java.patch b/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/Versioning.java.patch deleted file mode 100644 index 1adcedf..0000000 --- a/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/Versioning.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -@@ -11,7 +_,7 @@ - public static String getBukkitVersion() { - String result = "Unknown-Version"; - -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.infernalsuite.asp/aspaper-api/pom.properties"); -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.legitimoose.legitslimepaper/legitslimepaper-api/pom.properties"); - Properties properties = new Properties(); - - if (stream != null) { From f69e3e8c5b878d41f545b6b61d62b06d0a34b73e Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:15:47 -0500 Subject: [PATCH 02/10] fix: made first applyTask work again --- settings.gradle.kts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 77d899d..75da51c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,4 +16,14 @@ rootProject.name = "legitslimepaper" include("legitslimepaper-api") include("legitslimepaper-server") -include("core", "api") \ No newline at end of file +fun optionalProject(path: String) { + val d = file(path) + if (d.isDirectory) { + include(path) + } else { + logger.lifecycle("Skipping $path (missing dir: ${d.path})") + } +} + +optionalProject("core") +optionalProject("api") From 8a3a5fab0ca1675b32376492a8a1937c12c279de Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Wed, 31 Dec 2025 20:55:03 -0500 Subject: [PATCH 03/10] ref: updated asp ref to 8b544f46541c91bdf2c0c15732a8babb5c6320eb --- gradle.properties | 2 +- legitslimepaper-server/build.gradle.kts.patch | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1c9bd7b..7924f71 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ version=1.21.11-R0.1-SNAPSHOT mcVersion=1.21.11 #Update with ASP!! (also update gradle/libs.versions.toml) -aspRef=67110eba45e561f90ae74194d91e07e622fed23b +aspRef=8b544f46541c91bdf2c0c15732a8babb5c6320eb apiVersion=1.21.11 aspApiVersion=4.2.0-SNAPSHOT diff --git a/legitslimepaper-server/build.gradle.kts.patch b/legitslimepaper-server/build.gradle.kts.patch index edd8dc8..0fd6a76 100644 --- a/legitslimepaper-server/build.gradle.kts.patch +++ b/legitslimepaper-server/build.gradle.kts.patch @@ -1,6 +1,6 @@ ---- a/aspaper-server/build.gradle.kts + --- a/aspaper-server/build.gradle.kts +++ b/aspaper-server/build.gradle.kts -@@ -31,7 +_,22 @@ +@@ -31,8 +_,22 @@ } } @@ -19,11 +19,11 @@ + outputDir = rootDirectory.dir("aspaper-server") + } + } -+ -+ activeFork = legitslimepaper ++ activeFork = legitslimepaper spigot { - enabled = false + enabled = true + buildDataRef = "17f77cee7117ab9d6175f088ae8962bfd04e61a9" @@ -119,10 +_,14 @@ main { java { srcDir("../paper-server/src/main/java") } @@ -46,7 +46,7 @@ - implementation(project(":aspaper-api")) //ASP + implementation(project(":legitslimepaper-api")) //ASP + Moose implementation(project(":core")) //ASP - implementation("ca.spottedleaf:concurrentutil:0.0.7") + implementation("ca.spottedleaf:concurrentutil:0.0.8") implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ @@ -222,14 +_,14 @@ val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() From 560dbcda959ddb39b013ff985a5d50d8ce8a739f Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Thu, 1 Jan 2026 01:28:42 -0500 Subject: [PATCH 04/10] fix: typo --- legitslimepaper-server/build.gradle.kts.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legitslimepaper-server/build.gradle.kts.patch b/legitslimepaper-server/build.gradle.kts.patch index 0fd6a76..7df91bc 100644 --- a/legitslimepaper-server/build.gradle.kts.patch +++ b/legitslimepaper-server/build.gradle.kts.patch @@ -1,4 +1,4 @@ - --- a/aspaper-server/build.gradle.kts +--- a/aspaper-server/build.gradle.kts +++ b/aspaper-server/build.gradle.kts @@ -31,8 +_,22 @@ } From fdb4512af5d86bd70b15e82e392507684008a77d Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Sat, 3 Jan 2026 17:35:30 -0500 Subject: [PATCH 05/10] fix: Made the pvp gamerule work again (by disabling ASP's pvp option) It's a little complex, but the ASP plugin will always set PVP in the propertyMap to true or false (WorldData line 104), so it's impossible for the line commented here to return a NOT_SET, which would make the gamerule work. --- .../asp/level/SlimeLevelInstance.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch index 0cc10f2..16f4d40 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch @@ -30,6 +30,15 @@ primaryLevelData, worldKey, worldDimension, false, 0, Collections.emptyList(), true, null, environment, null, null); this.slimeInstance = new SlimeInMemoryWorld(slimeBootstrap, this); +@@ -126,7 +_,7 @@ + getWorld().readBukkitValues(Converter.convertTag(extraData.get("BukkitValues"))); + } + +- this.pvpMode = propertyMap.getOptionalValue(SlimeProperties.PVP).map(TriState::byBoolean).orElse(TriState.NOT_SET); ++ //this.pvpMode = propertyMap.getOptionalValue(SlimeProperties.PVP).map(TriState::byBoolean).orElse(TriState.NOT_SET); Moose - Disable PVP option to re-enable gamerule + + this.entityDataController = new SlimeEntityDataLoader( + new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.EntityDataController.EntityRegionFileStorage( @@ -172,6 +_,7 @@ Bukkit.getPluginManager().callEvent(new WorldSaveEvent(getWorld())); From a7cabb39886beef19a73f5953ab7a4b23b9e19d8 Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:50:32 -0500 Subject: [PATCH 06/10] feat: disabled entity collisions when hidden --- .../level/entity/ChunkEntitySlices.java.patch | 11 +++++++++++ .../network/ServerGamePacketListenerImpl.java.patch | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 legitslimepaper-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java.patch diff --git a/legitslimepaper-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java.patch b/legitslimepaper-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java.patch new file mode 100644 index 0000000..07c6071 --- /dev/null +++ b/legitslimepaper-server/minecraft-patches/sources/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java.patch @@ -0,0 +1,11 @@ +--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java ++++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java +@@ -545,6 +_,8 @@ + if (entity == null || entity == except || !entity.getBoundingBox().intersects(box)) { + continue; + } ++ if (except instanceof net.minecraft.server.level.ServerPlayer player && !player.getBukkitEntity().canSee(entity.getBukkitEntity())) // Moose - Disable collisions for hidden entities ++ continue; + + if (predicate != null && !predicate.test(entity)) { + continue; diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index b22c9b1..7e11954 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -18,7 +18,7 @@ BlockEntity blockEntity = this.player.level().getBlockEntity(packet.getPos()); CompoundTag compoundTag = blockEntity != null ? blockEntity.saveWithoutMetadata(this.player.registryAccess()) : null; this.send(new ClientboundTagQueryPacket(packet.getTransactionId(), compoundTag)); -@@ -3545,7 +_,7 @@ +@@ -3574,7 +_,7 @@ @Override public void handleChangeGameMode(ServerboundChangeGameModePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); From fea365f63f7b9edeef2916eed7c454d14fc3a9b5 Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:52:42 -0500 Subject: [PATCH 07/10] ref: update asp ref to 89f6dc94bd9db7c7195b5421f69d554a73e11b65 --- gradle.properties | 2 +- .../asp/level/SlimeLevelInstance.java.patch | 15 +++------------ .../ServerGamePacketListenerImpl.java.patch | 6 +++--- .../world/entity/player/Player.java.patch | 2 +- .../manager/PaperPluginInstanceManager.java.patch | 2 +- .../java/org/bukkit/craftbukkit/Main.java.patch | 2 +- 6 files changed, 10 insertions(+), 19 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7924f71..c1ade7d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ version=1.21.11-R0.1-SNAPSHOT mcVersion=1.21.11 #Update with ASP!! (also update gradle/libs.versions.toml) -aspRef=8b544f46541c91bdf2c0c15732a8babb5c6320eb +aspRef=89f6dc94bd9db7c7195b5421f69d554a73e11b65 apiVersion=1.21.11 aspApiVersion=4.2.0-SNAPSHOT diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch index 16f4d40..af75b9a 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java +++ b/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java -@@ -71,16 +_,10 @@ +@@ -73,16 +_,10 @@ private static final Logger LOGGER = LogUtils.getClassLogger(); static { @@ -21,7 +21,7 @@ } private static final ExecutorService WORLD_SAVER_SERVICE = Executors.newFixedThreadPool(4, new ThreadFactoryBuilder() -@@ -94,7 +_,7 @@ +@@ -96,7 +_,7 @@ org.bukkit.World.Environment environment) throws IOException { super(slimeBootstrap, MinecraftServer.getServer(), MinecraftServer.getServer().executor, @@ -30,16 +30,7 @@ primaryLevelData, worldKey, worldDimension, false, 0, Collections.emptyList(), true, null, environment, null, null); this.slimeInstance = new SlimeInMemoryWorld(slimeBootstrap, this); -@@ -126,7 +_,7 @@ - getWorld().readBukkitValues(Converter.convertTag(extraData.get("BukkitValues"))); - } - -- this.pvpMode = propertyMap.getOptionalValue(SlimeProperties.PVP).map(TriState::byBoolean).orElse(TriState.NOT_SET); -+ //this.pvpMode = propertyMap.getOptionalValue(SlimeProperties.PVP).map(TriState::byBoolean).orElse(TriState.NOT_SET); Moose - Disable PVP option to re-enable gamerule - - this.entityDataController = new SlimeEntityDataLoader( - new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.EntityDataController.EntityRegionFileStorage( -@@ -172,6 +_,7 @@ +@@ -175,6 +_,7 @@ Bukkit.getPluginManager().callEvent(new WorldSaveEvent(getWorld())); //this.getChunkSource().save(forceSave); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 7e11954..640d6d9 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1384,7 +_,7 @@ +@@ -1385,7 +_,7 @@ @Override public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); @@ -9,7 +9,7 @@ Entity entity = this.player.level().getEntity(packet.getEntityId()); if (entity != null) { try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { -@@ -1410,7 +_,7 @@ +@@ -1411,7 +_,7 @@ @Override public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); @@ -18,7 +18,7 @@ BlockEntity blockEntity = this.player.level().getBlockEntity(packet.getPos()); CompoundTag compoundTag = blockEntity != null ? blockEntity.saveWithoutMetadata(this.player.registryAccess()) : null; this.send(new ClientboundTagQueryPacket(packet.getTransactionId(), compoundTag)); -@@ -3574,7 +_,7 @@ +@@ -3581,7 +_,7 @@ @Override public void handleChangeGameMode(ServerboundChangeGameModePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index 87a7044..e2041bd 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -19,7 +19,7 @@ this.lastDeathLocation.ifPresent(globalPos -> output.store("LastDeathLocation", GlobalPos.CODEC, globalPos)); output.storeNullable("current_explosion_impact_pos", Vec3.CODEC, this.currentImpulseImpactPos); output.putBoolean("ignore_fall_damage_from_current_explosion", this.ignoreFallDamageFromCurrentImpulse); -@@ -1998,7 +_,7 @@ +@@ -2019,7 +_,7 @@ } public boolean canUseGameMasterBlocks() { diff --git a/legitslimepaper-server/paper-patches/files/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java.patch b/legitslimepaper-server/paper-patches/files/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java.patch index aa58df4..cb0c7e4 100644 --- a/legitslimepaper-server/paper-patches/files/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java.patch +++ b/legitslimepaper-server/paper-patches/files/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java +++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java -@@ -235,6 +_,7 @@ +@@ -240,6 +_,7 @@ if (!plugin.isEnabled()) { return; } diff --git a/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch b/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch index 2b36bf2..fb0a7e8 100644 --- a/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch +++ b/legitslimepaper-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -169,6 +_,14 @@ +@@ -174,6 +_,14 @@ .ofType(String.class) .defaultsTo("Unknown Server") .describedAs("Name"); From c630f66d0d452f9bb8f9773a51bdda747a0e4889 Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Tue, 19 May 2026 23:41:56 -0400 Subject: [PATCH 08/10] feat: Update to 26.1.2. Includes some changes on the world structure. --- build-data/buildSrc.build.gradle.kts.patch | 4 +- build.gradle.kts | 4 +- gradle.properties | 8 ++-- gradle/libs.versions.toml | 10 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../asp/SlimeNMSBridgeImpl.java.patch | 8 ++-- .../asp/level/SlimeLevelInstance.java.patch | 46 ++++++++++++------- legitslimepaper-server/build.gradle.kts.patch | 46 +++++++++---------- .../minecraft/commands/Commands.java.patch | 39 ++++++++-------- .../options/EntitySelectorOptions.java.patch | 16 +++---- .../functions/MacroFunction.java.patch | 6 ++- .../resources/RegistryDataLoader.java.patch | 40 +++++++++------- .../net/minecraft/server/Main.java.patch | 28 ++++++++--- .../server/MinecraftServer.java.patch | 14 ++++++ .../server/ServerFunctionLibrary.java.patch | 12 ++--- .../server/commands/ExecuteCommand.java.patch | 6 +-- .../server/commands/TickCommand.java.patch | 4 +- .../data/EntityDataAccessor.java.patch | 42 ++++++++--------- .../server/level/PlayerSpawnFinder.java.patch | 12 ++--- .../server/level/ServerChunkCache.java.patch | 11 ----- .../server/level/ServerPlayer.java.patch | 4 +- .../ServerGamePacketListenerImpl.java.patch | 23 +++------- .../server/players/PlayerList.java.patch | 14 +++--- .../world/entity/player/Player.java.patch | 14 +++--- settings.gradle.kts | 10 ++-- 25 files changed, 228 insertions(+), 195 deletions(-) create mode 100644 legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch delete mode 100644 legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch diff --git a/build-data/buildSrc.build.gradle.kts.patch b/build-data/buildSrc.build.gradle.kts.patch index 3725480..c1f5102 100644 --- a/build-data/buildSrc.build.gradle.kts.patch +++ b/build-data/buildSrc.build.gradle.kts.patch @@ -1,6 +1,6 @@ --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts -@@ -8,6 +_,7 @@ +@@ -9,6 +_,7 @@ mavenLocal() mavenCentral() gradlePluginPortal() @@ -8,7 +8,7 @@ } fun convertPlugin(plugin: Provider): String { -@@ -22,7 +_,7 @@ +@@ -23,7 +_,7 @@ implementation(convertPlugin(libs.plugins.profiles)) implementation(convertPlugin(libs.plugins.kotlin.jvm)) implementation(convertPlugin(libs.plugins.lombok)) diff --git a/build.gradle.kts b/build.gradle.kts index e80a983..1b79a03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -83,7 +83,7 @@ subprojects { extensions.configure { toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(25) } } @@ -106,7 +106,7 @@ subprojects { } tasks.withType { options.encoding = Charsets.UTF_8.name() - options.release = 21 + options.release = 25 options.isFork = true } tasks.withType { diff --git a/gradle.properties b/gradle.properties index c1ade7d..89fa906 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ group=com.legitimoose.legitslimepaper -version=1.21.11-R0.1-SNAPSHOT -mcVersion=1.21.11 +version=26.1.2.build.61-stable +mcVersion=26.1.2 #Update with ASP!! (also update gradle/libs.versions.toml) -aspRef=89f6dc94bd9db7c7195b5421f69d554a73e11b65 -apiVersion=1.21.11 +aspRef=2e69d9f6e20da479e8a3edea0a57ce1a16888fe7 +apiVersion=26.1.2 aspApiVersion=4.2.0-SNAPSHOT org.gradle.caching=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 44916a7..c28a2da 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,11 +1,11 @@ [versions] -adventure = "4.24.0" -annotations = "26.0.1" +adventure = "4.26.1" +annotations = "1.0.0" autoservice = "1.1.1" blossom = "2.1.0" bstats = "3.1.0" cloud-core = "2.0.0" -cloud-minecraft = "2.0.0-beta.14" +cloud-minecraft = "2.0.0-SNAPSHOT" configurate = "4.1.2" indra-git = "3.1.3" gradle-profiles = "0.54.0" @@ -15,7 +15,7 @@ lettuce = "6.5.1.RELEASE" lombok = "1.18.36" lombok-plugin = "8.11" mongo = "5.2.1" -paperweight = "2.0.0-beta.19" +paperweight = "2.0.0-SNAPSHOT" plugin-yml-paper = "0.6.0" shadow = "9.2.2" slf4j = "2.0.16" @@ -33,7 +33,7 @@ shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } [libraries] adventure-nbt = { module = "net.kyori:adventure-nbt", version.ref = "adventure" } -annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" } +annotations = { module = "org.jspecify:jspecify", version.ref = "annotations" } auto-service = { module = "com.google.auto.service:auto-service", version.ref = "autoservice" } auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoservice" } bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bad7c24..c61a118 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch index 59a1828..fbbf616 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java.patch @@ -1,13 +1,15 @@ --- a/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java +++ b/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java -@@ -80,8 +_,10 @@ +@@ -80,9 +_,11 @@ + // See MinecraftServer loading logic // Some stuff is needed when loading overworld world SlimeLevelInstance instance = ((SlimeInMemoryWorld) this.loadInstance(defaultWorld, Level.OVERWORLD)).getInstance(); - DimensionDataStorage worldpersistentdata = instance.getDataStorage(); +- SavedDataStorage worldpersistentdata = instance.getDataStorage(); ++ SavedDataStorage worldpersistentdata = instance.getServer().getDataStorage(); // Moose - Ensure vanilla behavior + instance.getServer().getScoreboard().load(worldpersistentdata.computeIfAbsent(net.minecraft.world.scores.ScoreboardSaveData.TYPE).getData()); // Moose instance.getCraftServer().scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(instance.getServer(), instance.getScoreboard()); instance.getServer().commandStorage = new CommandStorage(worldpersistentdata); -+ instance.getServer().worldData = instance.serverLevelData; // Moose - Set default spawn location correctly (and prob more) ++// instance.getServer().worldData = instance.serverLevelData; // Moose - Set default spawn location correctly (and prob more) return true; } diff --git a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch index af75b9a..b7f152d 100644 --- a/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch +++ b/legitslimepaper-server/aspaper-patches/files/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java.patch @@ -1,40 +1,52 @@ --- a/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java +++ b/src/main/java/com/infernalsuite/asp/level/SlimeLevelInstance.java -@@ -73,16 +_,10 @@ +@@ -46,10 +_,7 @@ + import net.minecraft.world.level.gamerules.GameRules; + import net.minecraft.world.level.levelgen.WorldGenSettings; + import net.minecraft.world.level.levelgen.WorldOptions; +-import net.minecraft.world.level.storage.LevelData; +-import net.minecraft.world.level.storage.LevelResource; +-import net.minecraft.world.level.storage.LevelStorageSource; +-import net.minecraft.world.level.storage.PrimaryLevelData; ++import net.minecraft.world.level.storage.*; + import net.minecraft.world.level.validation.DirectoryValidator; + import org.apache.commons.io.FileUtils; + import org.bukkit.Bukkit; +@@ -80,17 +_,9 @@ private static final Logger LOGGER = LogUtils.getClassLogger(); static { - try { - Path path = Files.createTempDirectory("swm-" + UUID.randomUUID().toString().substring(0, 5)).toAbsolutePath(); - DirectoryValidator directoryvalidator = LevelStorageSource.parseValidator(path.resolve("allowed_symlinks.txt")); -- CUSTOM_LEVEL_STORAGE = new LevelStorageSource(path, path, directoryvalidator, DataFixers.getDataFixer()); +- CUSTOM_LEVEL_STORAGE_ACCESS = new LevelStorageSource(path, path, directoryvalidator, DataFixers.getDataFixer()) +- .createAccess("slime"); - - FileUtils.forceDeleteOnExit(path.toFile()); - - } catch (IOException ex) { - throw new IllegalStateException("Couldn't create dummy file directory.", ex); - } -+ // Moose start -+ Path path = MinecraftServer.getServer().server.getWorldContainer().toPath(); -+ CUSTOM_LEVEL_STORAGE = LevelStorageSource.createDefault(path); ++ // Moose start - Ensure the data directory is mapped correctly ++ CUSTOM_LEVEL_STORAGE_ACCESS = MinecraftServer.getServer().storageSource; + // Moose end } private static final ExecutorService WORLD_SAVER_SERVICE = Executors.newFixedThreadPool(4, new ThreadFactoryBuilder() -@@ -96,7 +_,7 @@ - org.bukkit.World.Environment environment) throws IOException { - - super(slimeBootstrap, MinecraftServer.getServer(), MinecraftServer.getServer().executor, -- CUSTOM_LEVEL_STORAGE.createAccess(slimeBootstrap.initial().getName() + UUID.randomUUID(), dimensionKey), -+ CUSTOM_LEVEL_STORAGE.createAccess("dat_files", dimensionKey), // Moose - primaryLevelData, worldKey, worldDimension, false, 0, - Collections.emptyList(), true, null, environment, null, null); +@@ -139,7 +_,7 @@ + environment, + null, + null, +- new ReadOnlyDimensionDataStorage(CUSTOM_LEVEL_STORAGE_ACCESS.getDimensionPath(dimensionKey), MinecraftServer.getServer().getFixerUpper(), MinecraftServer.getServer().registryAccess()), ++ new SavedDataStorage(CUSTOM_LEVEL_STORAGE_ACCESS.getDimensionPath(dimensionKey), MinecraftServer.getServer().getFixerUpper(), MinecraftServer.getServer().registryAccess()), + data + ); this.slimeInstance = new SlimeInMemoryWorld(slimeBootstrap, this); -@@ -175,6 +_,7 @@ +@@ -213,6 +_,7 @@ Bukkit.getPluginManager().callEvent(new WorldSaveEvent(getWorld())); //this.getChunkSource().save(forceSave); -+ this.getDataStorage().saveAndJoin(); // Moose - this.serverLevelData.setCustomBossEvents(MinecraftServer.getServer().getCustomBossEvents().save(MinecraftServer.getServer().registryAccess())); - ++ this.getDataStorage().saveAndJoin(); if (MinecraftServer.getServer().isStopped()) { // Make sure the world gets saved before stopping the server by running it from the main thread + saveInternal().get(); // Async wait for it to finish + } else { diff --git a/legitslimepaper-server/build.gradle.kts.patch b/legitslimepaper-server/build.gradle.kts.patch index 7df91bc..0ff2b13 100644 --- a/legitslimepaper-server/build.gradle.kts.patch +++ b/legitslimepaper-server/build.gradle.kts.patch @@ -1,30 +1,30 @@ --- a/aspaper-server/build.gradle.kts +++ b/aspaper-server/build.gradle.kts -@@ -31,8 +_,22 @@ +@@ -31,7 +_,22 @@ } } - activeFork = aspaper -+ val legitslimepaper = forks.register("legitslimepaper") { -+ forks = aspaper -+ upstream.patchRepo("paperServer") { -+ upstreamRepo = aspaper.patchedRepo("paperServer") -+ patchesDir = rootDirectory.dir("legitslimepaper-server/paper-patches") -+ outputDir = rootDirectory.dir("paper-server") -+ } -+ upstream.patchDir("aspaperServer") { -+ upstreamPath = "aspaper-server" -+ excludes = setOf("src/minecraft", "paper-patches", "minecraft-patches", "build.gradle.kts", "build.gradle.kts.patch") -+ patchesDir = rootDirectory.dir("legitslimepaper-server/aspaper-patches") -+ outputDir = rootDirectory.dir("aspaper-server") -+ } -+ } ++ val legitslimepaper = forks.register("legitslimepaper") { ++ forks = aspaper ++ upstream.patchRepo("paperServer") { ++ upstreamRepo = aspaper.patchedRepo("paperServer") ++ patchesDir = rootDirectory.dir("legitslimepaper-server/paper-patches") ++ outputDir = rootDirectory.dir("paper-server") ++ } ++ upstream.patchDir("aspaperServer") { ++ upstreamPath = "aspaper-server" ++ excludes = setOf("src/minecraft", "paper-patches", "minecraft-patches", "build.gradle.kts", "build.gradle.kts.patch") ++ patchesDir = rootDirectory.dir("legitslimepaper-server/aspaper-patches") ++ outputDir = rootDirectory.dir("aspaper-server") ++ } ++ } ++ ++ activeFork = legitslimepaper -+ activeFork = legitslimepaper - spigot { - enabled = true - buildDataRef = "17f77cee7117ab9d6175f088ae8962bfd04e61a9" -@@ -119,10 +_,14 @@ + // updatingMinecraft { + // oldPaperCommit = "7e80cef5198561d0db53406127e5b8bc7af51577" +@@ -101,10 +_,14 @@ main { java { srcDir("../paper-server/src/main/java") } resources { srcDir("../paper-server/src/main/resources") } @@ -39,16 +39,16 @@ } } val log4jPlugins = sourceSets.create("log4jPlugins") { -@@ -150,7 +_,7 @@ +@@ -132,7 +_,7 @@ } dependencies { - implementation(project(":aspaper-api")) //ASP + implementation(project(":legitslimepaper-api")) //ASP + Moose implementation(project(":core")) //ASP - implementation("ca.spottedleaf:concurrentutil:0.0.8") + implementation("ca.spottedleaf:concurrentutil:0.0.10") implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ -@@ -222,14 +_,14 @@ +@@ -195,14 +_,14 @@ val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch index 1e00373..c51c32f 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -9,16 +_,15 @@ +@@ -9,17 +_,15 @@ import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.mojang.brigadier.context.CommandContextBuilder; import com.mojang.brigadier.context.ContextChain; @@ -13,6 +13,7 @@ import com.mojang.logging.LogUtils; -import java.util.HashMap; -import java.util.Map; +-import java.util.Objects; -import java.util.Optional; -import java.util.Set; + @@ -20,7 +21,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; -@@ -38,7 +_,6 @@ +@@ -39,7 +_,6 @@ import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; @@ -28,15 +29,15 @@ import net.minecraft.network.chat.HoverEvent; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.protocol.game.ClientboundCommandsPacket; -@@ -186,6 +_,7 @@ +@@ -188,6 +_,7 @@ } }; private final CommandDispatcher dispatcher = new CommandDispatcher<>(); + public static CommandDispatcher vanillaCommands = new CommandDispatcher<>(); // Moose - public Commands(Commands.CommandSelection selection, CommandBuildContext context) { + public Commands(final Commands.CommandSelection commandSelection, final CommandBuildContext context) { // Paper start - Brigadier API - modern minecraft overloads that do not use redirects but are copies instead -@@ -303,6 +_,25 @@ +@@ -306,6 +_,25 @@ PublishCommand.register(this.dispatcher); } @@ -62,33 +63,33 @@ // Paper start - Vanilla command permission fixes for (final CommandNode node : this.dispatcher.getRoot().getChildren()) { if (node.getRequirement() == com.mojang.brigadier.builder.ArgumentBuilder.defaultRequirement()) { -@@ -370,6 +_,15 @@ - ContextChain contextChain = finishParsing(parseResults, command, commandSourceStack); +@@ -373,6 +_,15 @@ + ContextChain commandChain = finishParsing(command, commandString, sender); try { + // Moose start - Command block whitelist -+ if (parseResults.getContext().getSource().source instanceof net.minecraft.world.level.BaseCommandBlock.CloseableCommandBlockSource) { -+ List> context = parseResults.getContext().getNodes(); ++ if (command.getContext().getSource().source instanceof net.minecraft.world.level.BaseCommandBlock.CloseableCommandBlockSource) { ++ List> context = command.getContext().getNodes(); + if (!context.isEmpty() && !context.getFirst().getNode().commandBlockAllowed) { + throw new Exception("Non-vanilla commands cannot be executed in command blocks."); + } + } + // Moose end + - if (contextChain != null) { + if (commandChain != null) { executeCommandInContext( - commandSourceStack, -@@ -380,7 +_,7 @@ + sender, +@@ -383,7 +_,7 @@ } // Paper start } catch (Throwable var12) { // always gracefully handle it, no matter how bad:tm: - if (throwCommandError) throw var12; // rethrow directly if requested + if (throwCommandError) throw new RuntimeException(var12); // Paper + Moose - // Paper end - MutableComponent mutableComponent = Component.literal(var12.getMessage() == null ? var12.getClass().getName() : var12.getMessage()); - LOGGER.error("Command exception: /{}", command, var12); // Paper - always show execution exception in console log + MutableComponent hover = Component.literal(var12.getMessage() == null ? var12.getClass().getName() : var12.getMessage()); + LOGGER.error("Command exception: /{}", commandString, var12); // Paper - always show execution exception in console log + if (sender.getServer().isDebugging() || LOGGER.isDebugEnabled()) { // Paper - Debugging @@ -518,6 +_,20 @@ - runSync(player, bukkit, rootCommandNode); + runSync(player, bukkit, root); }); } + // Moose start - Make sure non-vanilla commands are restricted @@ -106,7 +107,7 @@ + } + // Moose end - private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) { + private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode root) { // Paper end - Perf: Async command map building @@ -532,6 +_,15 @@ } @@ -115,12 +116,12 @@ + + // Moose start - Make sure non-vanilla commands are restricted + // Put here since some events might change requirements and all -+ rootCommandNode.getChildren().forEach(commandNode -> { ++ root.getChildren().forEach(commandNode -> { + if (vanillaCommands.getRoot().getChild(commandNode.getName()) == null && !(commandNode.requirement instanceof SpecialPermissionCheck)) { + commandNode.requirement = new SpecialPermissionCheck(commandNode.requirement); + } + }); + // Moose end - player.connection.send(new ClientboundCommandsPacket(rootCommandNode, COMMAND_NODE_INSPECTOR)); + player.connection.send(new ClientboundCommandsPacket(root, COMMAND_NODE_INSPECTOR)); } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java.patch index ccff13d..608b818 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java +++ b/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java -@@ -345,7 +_,7 @@ +@@ -323,7 +_,7 @@ boolean var9; - try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { - TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector, entity.registryAccess()); -- entity.saveWithoutId(tagValueOutput); -+ entity.saveWithoutId(tagValueOutput, !com.legitimoose.lsp.MooseConfig.disableEnderchestSerializationInSelectors, false, false); // Moose - Disable enderchest serializing in nbt selectors - if (entity instanceof ServerPlayer serverPlayer) { - ItemStack selectedItem = serverPlayer.getInventory().getSelectedItem(); - if (!selectedItem.isEmpty()) { + try (ProblemReporter.ScopedCollector reporter = new ProblemReporter.ScopedCollector(e.problemPath(), LOGGER)) { + TagValueOutput output = TagValueOutput.createWithContext(reporter, e.registryAccess()); +- e.saveWithoutId(output); ++ e.saveWithoutId(output, !com.legitimoose.lsp.MooseConfig.disableEnderchestSerializationInSelectors, false, false); // Moose - Disable enderchest serializing in nbt selectors + if (e instanceof ServerPlayer player) { + ItemStack selected = player.getInventory().getSelectedItem(); + if (!selected.isEmpty()) { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch index 578f725..b4e4e5c 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/commands/functions/MacroFunction.java.patch @@ -1,9 +1,11 @@ --- a/net/minecraft/commands/functions/MacroFunction.java +++ b/net/minecraft/commands/functions/MacroFunction.java -@@ -50,6 +_,7 @@ +@@ -50,7 +_,8 @@ + } @Override - public InstantiatedFunction instantiate(@Nullable CompoundTag arguments, CommandDispatcher dispatcher) throws FunctionInstantiationException { +- public InstantiatedFunction instantiate(final @Nullable CompoundTag arguments, final CommandDispatcher dispatcher) throws FunctionInstantiationException { ++ public InstantiatedFunction instantiate(final @Nullable CompoundTag arguments, CommandDispatcher dispatcher) throws FunctionInstantiationException { + dispatcher = (CommandDispatcher) net.minecraft.commands.Commands.vanillaCommands; // Moose if (arguments == null) { throw new FunctionInstantiationException(Component.translatable("commands.function.error.missing_arguments", Component.translationArg(this.id()))); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch index ce10c62..4273547 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/resources/RegistryDataLoader.java.patch @@ -1,18 +1,26 @@ --- a/net/minecraft/resources/RegistryDataLoader.java +++ b/net/minecraft/resources/RegistryDataLoader.java -@@ -199,11 +_,12 @@ - map.put(registry.key(), new IllegalStateException("Registry must be non-empty: " + registry.key().identifier())); - } - }); -+ // Moose start - Don't throw an exception on invalid registry - if (!map.isEmpty()) { -- throw logErrors(map); -- } else { -- return new RegistryAccess.ImmutableRegistryAccess(list.stream().map(RegistryDataLoader.Loader::registry).toList()).freeze(); -+ logErrors(map); - } -+ return new RegistryAccess.ImmutableRegistryAccess(list.stream().map(RegistryDataLoader.Loader::registry).toList()).freeze(); -+ // Moose end - } - - private static RegistryOps.RegistryInfoLookup createContext( +@@ -216,18 +_,17 @@ + .thenApplyAsync( + ignored -> { + List> frozenRegistries = loadTasks.stream().filter(task -> task.freezeRegistry(loadingErrors)).toList(); ++ // Moose start - Don't throw an exception on invalid registry + if (!loadingErrors.isEmpty()) { +- throw logErrors(loadingErrors); +- } else { ++ logErrors(loadingErrors); ++ } + List> registries = frozenRegistries.stream() + .flatMap(task -> task.validateRegistry(loadingErrors).stream()) + .toList(); + if (!loadingErrors.isEmpty()) { +- throw logErrors(loadingErrors); +- } else { +- return new RegistryAccess.ImmutableRegistryAccess(registries).freeze(); ++ logErrors(loadingErrors); + } +- } ++ return new RegistryAccess.ImmutableRegistryAccess(registries).freeze(); + }, + executor + ); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch index add253f..e157af1 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch @@ -8,21 +8,35 @@ import com.mojang.datafixers.DataFixer; import com.mojang.logging.LogUtils; import com.mojang.serialization.Dynamic; -@@ -137,6 +_,8 @@ +@@ -142,6 +_,8 @@ return; } -+ MooseConfig.init((File) optionSet.valueOf("moose-settings")); // Moose - Load moose.yml ++ MooseConfig.init((File) options.valueOf("moose-settings")); // Moose - Load moose.yml + - // Spigot start + // Paper start - eula system property boolean eulaAgreed = Boolean.getBoolean("com.mojang.eula.agree"); if (eulaAgreed) { -@@ -226,7 +_,7 @@ +@@ -202,8 +_,11 @@ + LOGGER.info("This world was created by an incompatible version."); + return; + } +- +- levelDataTag = DataFixers.getFileFixer().fix(access, levelDataUnfixed, new UpgradeProgress()); ++ // Moose start - Calls the filefixer for 26.1 world folder migration, whilst keeping the "default" level.dat behavior ++ io.papermc.paper.world.migration.WorldFolderMigration.didInitialLoad = true; // Disable 30s conversion warning ++ DataFixers.getFileFixer().fix(access, levelDataUnfixed, new UpgradeProgress()); // (Note: Ensure a fake level.dat with a matching DataVersion exists when upgrading from 1.21.10) ++ levelDataTag = null; ++ // Moose end + } else { + levelDataTag = null; + } +@@ -214,7 +_,7 @@ LOGGER.warn("Safe mode active, only vanilla datapack will be loaded"); } -- PackRepository packRepository = ServerPacksSource.createPackRepository(levelStorageAccess); -+ PackRepository packRepository = hasOptionSpec ? ServerPacksSource.createVanillaTrustedRepository() : ServerPacksSource.createPackRepository(levelStorageAccess); // Moose +- PackRepository packRepository = ServerPacksSource.createPackRepository(access); ++ PackRepository packRepository = safeModeEnabled ? ServerPacksSource.createVanillaTrustedRepository() : ServerPacksSource.createPackRepository(access); // Moose // CraftBukkit start - File bukkitDataPackFolder = new File(levelStorageAccess.getLevelPath(net.minecraft.world.level.storage.LevelResource.DATAPACK_DIR).toFile(), "bukkit"); + File bukkitDataPackFolder = new File(access.getLevelPath(net.minecraft.world.level.storage.LevelResource.DATAPACK_DIR).toFile(), "bukkit"); if (!bukkitDataPackFolder.exists()) { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch new file mode 100644 index 0000000..19daa22 --- /dev/null +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/server/MinecraftServer.java ++++ b/net/minecraft/server/MinecraftServer.java +@@ -998,8 +_,9 @@ + public void saveGlobalData(final boolean flush) { + this.scoreboard.storeToSaveDataIfDirty(this.getDataStorage().computeIfAbsent(ScoreboardSaveData.TYPE)); + +- GameProfile singleplayerProfile = this.getSingleplayerProfile(); +- this.storageSource.saveDataTag(this.worldData, singleplayerProfile == null ? null : singleplayerProfile.id()); ++ // Moose - Disable level.dat saving ++ // GameProfile singleplayerProfile = this.getSingleplayerProfile(); ++ // this.storageSource.saveDataTag(this.worldData, singleplayerProfile == null ? null : singleplayerProfile.id()); + if (flush) { + this.savedDataStorage.saveAndJoin(); + } else { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch index efd45c0..7168c3f 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/ServerFunctionLibrary.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/server/ServerFunctionLibrary.java +++ b/net/minecraft/server/ServerFunctionLibrary.java -@@ -85,7 +_,7 @@ - Identifier identifier1 = LISTER.fileToId(identifier); - map1.put(identifier1, CompletableFuture.supplyAsync(() -> { +@@ -88,7 +_,7 @@ + Identifier id = LISTER.fileToId(resourceId); + result.put(id, CompletableFuture.supplyAsync(() -> { List lines = readLines(entry.getValue()); -- return CommandFunction.fromLines(identifier1, this.dispatcher, commandSourceStack, lines); -+ return CommandFunction.fromLines(identifier1, Commands.vanillaCommands, commandSourceStack, lines); - }, backgroundExecutor)); +- return CommandFunction.fromLines(id, this.dispatcher, compilationContext, lines); ++ return CommandFunction.fromLines(id, Commands.vanillaCommands, compilationContext, lines); // Moose - Ensure functions use vanilla commands + }, taskExecutor)); } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch index 2af1d4e..24734c1 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/ExecuteCommand.java.patch @@ -6,6 +6,6 @@ .requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS)) - .then(Commands.literal("run").redirect(dispatcher.getRoot())) + .then(Commands.literal("run").redirect(Commands.vanillaCommands.getRoot())) // Moose - Only run vanilla commands - .then(addConditionals(literalCommandNode, Commands.literal("if"), true, buildContext)) - .then(addConditionals(literalCommandNode, Commands.literal("unless"), false, buildContext)) - .then(Commands.literal("as").then(Commands.argument("targets", EntityArgument.entities()).fork(literalCommandNode, context -> { + .then(addConditionals(execute, Commands.literal("if"), true, context)) + .then(addConditionals(execute, Commands.literal("unless"), false, context)) + .then(Commands.literal("as").then(Commands.argument("targets", EntityArgument.entities()).fork(execute, c -> { diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch index 0bc674e..706e38e 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/TickCommand.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/server/commands/TickCommand.java +++ b/net/minecraft/server/commands/TickCommand.java @@ -20,7 +_,7 @@ - public static void register(CommandDispatcher dispatcher) { + public static void register(final CommandDispatcher dispatcher) { dispatcher.register( Commands.literal("tick") - .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) + .requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS)) - .then(Commands.literal("query").executes(commandContext -> tickQuery(commandContext.getSource()))) + .then(Commands.literal("query").executes(c -> tickQuery(c.getSource()))) .then( Commands.literal("rate") diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/data/EntityDataAccessor.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/data/EntityDataAccessor.java.patch index 89226ac..9b0d86a 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/data/EntityDataAccessor.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/commands/data/EntityDataAccessor.java.patch @@ -18,9 +18,9 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.storage.TagValueInput; import org.slf4j.Logger; -@@ -48,7 +_,65 @@ +@@ -49,7 +_,65 @@ @Override - public void setData(CompoundTag other) throws CommandSyntaxException { + public void setData(final CompoundTag tag) throws CommandSyntaxException { if (this.entity instanceof Player) { - throw ERROR_NO_PLAYERS.create(); + // Moose start - Allow modifying player data @@ -30,26 +30,26 @@ + CompoundTag oldNbt = NbtPredicate.getEntityTagToCompare(entity); + + ServerPlayer player = (ServerPlayer) entity; -+ for (String key : other.keySet()) { -+ if (other.get(key).equals(oldNbt.get(key))) { ++ for (String key : tag.keySet()) { ++ if (tag.get(key).equals(oldNbt.get(key))) { + continue; + } + switch (key) { -+ case "Air" -> player.setAirSupply(((NumericTag) other.get(key)).intValue()); -+ case "Fire" -> player.setRemainingFireTicks(((NumericTag) other.get(key)).intValue()); -+ case "Glowing" -> player.setGlowingTag(((NumericTag) other.get(key)).byteValue() != 0); -+ case "Invulnerable" -> player.setInvulnerable(((NumericTag) other.get(key)).byteValue() != 0); ++ case "Air" -> player.setAirSupply(((NumericTag) tag.get(key)).intValue()); ++ case "Fire" -> player.setRemainingFireTicks(((NumericTag) tag.get(key)).intValue()); ++ case "Glowing" -> player.setGlowingTag(((NumericTag) tag.get(key)).byteValue() != 0); ++ case "Invulnerable" -> player.setInvulnerable(((NumericTag) tag.get(key)).byteValue() != 0); + case "Motion" -> { -+ ListTag velocity = (ListTag) other.get(key); ++ ListTag velocity = (ListTag) tag.get(key); + player.setDeltaMovement(((NumericTag)velocity.get(0)).doubleValue(), ((NumericTag)velocity.get(1)).doubleValue(), ((NumericTag)velocity.get(2)).doubleValue()); + player.connection.send(new ClientboundSetEntityMotionPacket(player)); + } -+ case "NoGravity" -> player.setNoGravity(((NumericTag) other.get(key)).byteValue() != 0); -+ case "PortalCooldown" -> player.setPortalCooldown(((NumericTag) other.get(key)).intValue()); -+ case "Silent" -> player.setSilent(((NumericTag) other.get(key)).byteValue() != 0); -+ case "Health" -> player.setHealth(((NumericTag) other.get(key)).floatValue()); ++ case "NoGravity" -> player.setNoGravity(((NumericTag) tag.get(key)).byteValue() != 0); ++ case "PortalCooldown" -> player.setPortalCooldown(((NumericTag) tag.get(key)).intValue()); ++ case "Silent" -> player.setSilent(((NumericTag) tag.get(key)).byteValue() != 0); ++ case "Health" -> player.setHealth(((NumericTag) tag.get(key)).floatValue()); + case "abilities" -> { -+ CompoundTag abilities = (CompoundTag) other.get(key); ++ CompoundTag abilities = (CompoundTag) tag.get(key); + abilities.getBoolean("flying").ifPresent( flying -> player.getAbilities().flying = flying); + abilities.getFloat("flySpeed").ifPresent( flySpeed -> player.getAbilities().setFlyingSpeed(flySpeed)); + abilities.getBoolean("instabuild").ifPresent( instabuild -> player.getAbilities().instabuild = instabuild); @@ -61,24 +61,24 @@ + player.onUpdateAbilities(); + } + case "SelectedItemSlot" -> { -+ int slot = ((NumericTag) other.get(key)).intValue(); ++ int slot = ((NumericTag) tag.get(key)).intValue(); + if (Inventory.isHotbarSlot(slot)) { + player.getInventory().setSelectedSlot(slot); + player.connection.send(new ClientboundSetHeldSlotPacket(slot)); + } + } -+// case "HasVisualFire" -> player.hasVisualFire = (((NumericTag) other.get(key)).byteValue() != 0); -+ case "TicksFrozen" -> player.setTicksFrozen(((NumericTag) other.get(key)).intValue()); ++// case "HasVisualFire" -> player.hasVisualFire = (((NumericTag) tag.get(key)).byteValue() != 0); ++ case "TicksFrozen" -> player.setTicksFrozen(((NumericTag) tag.get(key)).intValue()); + case "FallFlying" -> { -+ if (((NumericTag) other.get(key)).byteValue() != 0) { ++ if (((NumericTag) tag.get(key)).byteValue() != 0) { + player.startFallFlying(); + } else { + player.stopFallFlying(); + } + } -+ case "foodExhaustionLevel" -> player.getFoodData().exhaustionLevel = ((NumericTag) other.get(key)).floatValue(); -+ case "foodLevel" -> player.getFoodData().setFoodLevel(((NumericTag) other.get(key)).intValue()); -+ case "foodSaturationLevel" -> player.getFoodData().setSaturation(((NumericTag) other.get(key)).floatValue()); ++ case "foodExhaustionLevel" -> player.getFoodData().exhaustionLevel = ((NumericTag) tag.get(key)).floatValue(); ++ case "foodLevel" -> player.getFoodData().setFoodLevel(((NumericTag) tag.get(key)).intValue()); ++ case "foodSaturationLevel" -> player.getFoodData().setSaturation(((NumericTag) tag.get(key)).floatValue()); + } + } + // Moose end - Allow modifying player data diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/PlayerSpawnFinder.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/PlayerSpawnFinder.java.patch index 6bece03..8ce69b5 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/PlayerSpawnFinder.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/PlayerSpawnFinder.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/server/level/PlayerSpawnFinder.java +++ b/net/minecraft/server/level/PlayerSpawnFinder.java @@ -63,7 +_,12 @@ - playerSpawnFinder.scheduleNext(); - return playerSpawnFinder.finishedFuture; + finder.scheduleNext(); + return finder.finishedFuture; } else { -- return CompletableFuture.completedFuture(fixupSpawnHeight(level, pos)); +- return CompletableFuture.completedFuture(fixupSpawnHeight(level, spawnSuggestion)); + // Moose start - ensure chunks are loaded for spawn search -+ int sectionPosX = SectionPos.blockToSectionCoord(pos.getX()); -+ int sectionPosZ = SectionPos.blockToSectionCoord(pos.getZ()); ++ int sectionPosX = SectionPos.blockToSectionCoord(spawnSuggestion.getX()); ++ int sectionPosZ = SectionPos.blockToSectionCoord(spawnSuggestion.getZ()); + return level.moonrise$getChunkTaskScheduler().chunkHolderManager.addTicketAndLoadWithRadius(TicketType.SPAWN_SEARCH, new ChunkPos(sectionPosX, sectionPosZ), 0, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, ca.spottedleaf.concurrentutil.util.Priority.HIGH). -+ thenApply((v) -> { return fixupSpawnHeight(level, pos); }); ++ thenApply((v) -> { return fixupSpawnHeight(level, spawnSuggestion); }); + // Moose end } } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch deleted file mode 100644 index 4dca4d7..0000000 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerChunkCache.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/server/level/ServerChunkCache.java -+++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -209,7 +_,7 @@ - } - - //ASP start - No dimension data storage -- if(level instanceof com.infernalsuite.asp.level.SlimeLevelInstance) { -+ if(level instanceof com.infernalsuite.asp.level.SlimeLevelInstance && false) { // Moose - Re-enable dat file storage - this.dataStorage = new com.infernalsuite.asp.level.ReadOnlyDimensionDataStorage(path, fixerUpper, level.registryAccess()); - } else { - this.dataStorage = new DimensionDataStorage(path, fixerUpper, level.registryAccess()); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 65c35e7..f5675ea 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -526,8 +_,8 @@ +@@ -547,8 +_,8 @@ } @Override -- protected void addAdditionalSaveData(ValueOutput output) { +- protected void addAdditionalSaveData(final ValueOutput output) { - super.addAdditionalSaveData(output); + protected void addAdditionalSaveData(ValueOutput output, boolean includeAll) { // Moose - Disable enderchest serializing in nbt selectors + super.addAdditionalSaveData(output, includeAll); // Moose diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 640d6d9..96d9135 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,29 +1,20 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1385,7 +_,7 @@ +@@ -1422,7 +_,7 @@ @Override - public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) { + public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); - if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) { + if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission Entity entity = this.player.level().getEntity(packet.getEntityId()); if (entity != null) { - try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { -@@ -1411,7 +_,7 @@ + try (ProblemReporter.ScopedCollector reporter = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { +@@ -1448,7 +_,7 @@ @Override - public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQueryPacket packet) { + public void handleBlockEntityTagQuery(final ServerboundBlockEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); - if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)) { + if (this.player.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER) || this.player.getBukkitEntity().hasPermission("minecraft.nbt.query")) { // Moose - Add nbt.query permission BlockEntity blockEntity = this.player.level().getBlockEntity(packet.getPos()); - CompoundTag compoundTag = blockEntity != null ? blockEntity.saveWithoutMetadata(this.player.registryAccess()) : null; - this.send(new ClientboundTagQueryPacket(packet.getTransactionId(), compoundTag)); -@@ -3581,7 +_,7 @@ - @Override - public void handleChangeGameMode(ServerboundChangeGameModePacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); -- if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions())) { -+ if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.gamemodeswitcher")) { // Moose: Added a permission to allow players to change their own gamemode with F3 shortcut) - LOGGER.warn( - "Player {} tried to change game mode to {} without required permissions", - this.player.getGameProfile().name(), + CompoundTag tag = blockEntity != null ? blockEntity.saveWithoutMetadata(this.player.registryAccess()) : null; + this.send(new ClientboundTagQueryPacket(packet.getTransactionId(), tag)); diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch index 03fe393..b1d6f82 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1200,6 +_,8 @@ - PlayerAdvancements playerAdvancements = player.getAdvancements(); // CraftBukkit - if (playerAdvancements == null) { - Path path = this.server.getWorldPath(LevelResource.PLAYER_ADVANCEMENTS_DIR).resolve(uuid + ".json"); +@@ -1205,6 +_,8 @@ + PlayerAdvancements result = player.getAdvancements(); // CraftBukkit + if (result == null) { + Path uuidStatsFile = this.server.getWorldPath(LevelResource.PLAYER_ADVANCEMENTS_DIR).resolve(uuid + ".json"); + if (MinecraftServer.getServer().overworld() instanceof com.infernalsuite.asp.level.SlimeLevelInstance) // Moose - Change advancements path for slime overworlds -+ path = this.server.getWorldPath(LevelResource.PLAYER_DATA_DIR).resolve("advancements" + File.separator + uuid + ".json"); // Moose - Change advancements path for slime overworlds - playerAdvancements = new PlayerAdvancements(this.server.getFixerUpper(), this, this.server.getAdvancements(), path, player); - // this.advancements.put(uuid, playerAdvancements); // CraftBukkit ++ uuidStatsFile = this.server.getWorldPath(LevelResource.PLAYER_DATA_DIR).resolve("advancements" + File.separator + uuid + ".json"); // Moose - Change advancements path for slime overworlds + result = new PlayerAdvancements(this.server.getFixerUpper(), this, this.server.getAdvancements(), uuidStatsFile, player); + // this.advancements.put(uuid, result); // CraftBukkit } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index e2041bd..57397f5 100644 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -1,25 +1,25 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -690,7 +_,7 @@ +@@ -678,7 +_,7 @@ } @Override -- protected void addAdditionalSaveData(ValueOutput output) { +- protected void addAdditionalSaveData(final ValueOutput output) { + protected void addAdditionalSaveData(ValueOutput output, boolean includeAll) { super.addAdditionalSaveData(output); NbtUtils.addCurrentDataVersion(output); this.inventory.save(output.list("Inventory", ItemStackWithSlot.CODEC)); -@@ -703,7 +_,8 @@ +@@ -691,7 +_,8 @@ output.putInt("Score", this.getScore()); this.foodData.addAdditionalSaveData(output); output.store("abilities", Abilities.Packed.CODEC, this.abilities.pack()); - this.enderChestInventory.storeAsSlots(output.list("EnderItems", ItemStackWithSlot.CODEC)); + if (includeAll) // Moose - Disable enderchest serializing in nbt selectors + this.enderChestInventory.storeAsSlots(output.list("EnderItems", ItemStackWithSlot.CODEC)); - this.lastDeathLocation.ifPresent(globalPos -> output.store("LastDeathLocation", GlobalPos.CODEC, globalPos)); - output.storeNullable("current_explosion_impact_pos", Vec3.CODEC, this.currentImpulseImpactPos); - output.putBoolean("ignore_fall_damage_from_current_explosion", this.ignoreFallDamageFromCurrentImpulse); -@@ -2019,7 +_,7 @@ + this.lastDeathLocation.ifPresent(pos -> output.store("LastDeathLocation", GlobalPos.CODEC, pos)); + } + +@@ -2013,7 +_,7 @@ } public boolean canUseGameMasterBlocks() { diff --git a/settings.gradle.kts b/settings.gradle.kts index 75da51c..72cb3d9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,21 +1,18 @@ pluginManagement { repositories { + maven("https://repo.papermc.io/repository/maven-public/") mavenLocal() mavenCentral() gradlePluginPortal() - maven("https://repo.papermc.io/repository/maven-public/") } } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } rootProject.name = "legitslimepaper" -include("legitslimepaper-api") -include("legitslimepaper-server") - fun optionalProject(path: String) { val d = file(path) if (d.isDirectory) { @@ -27,3 +24,6 @@ fun optionalProject(path: String) { optionalProject("core") optionalProject("api") + +include("legitslimepaper-api") +include("legitslimepaper-server") From 7d82f0ec598935fda5095afc8e61a5a5275175c6 Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Tue, 19 May 2026 23:54:24 -0400 Subject: [PATCH 09/10] fix: made 26.1.2 upgrading use the old custom advancement path --- .../minecraft/server/players/PlayerList.java.patch | 11 ----------- .../filefix/fixes/PlayerStorageFileFix.java.patch | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch create mode 100644 legitslimepaper-server/minecraft-patches/sources/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java.patch diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch deleted file mode 100644 index b1d6f82..0000000 --- a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/server/players/PlayerList.java -+++ b/net/minecraft/server/players/PlayerList.java -@@ -1205,6 +_,8 @@ - PlayerAdvancements result = player.getAdvancements(); // CraftBukkit - if (result == null) { - Path uuidStatsFile = this.server.getWorldPath(LevelResource.PLAYER_ADVANCEMENTS_DIR).resolve(uuid + ".json"); -+ if (MinecraftServer.getServer().overworld() instanceof com.infernalsuite.asp.level.SlimeLevelInstance) // Moose - Change advancements path for slime overworlds -+ uuidStatsFile = this.server.getWorldPath(LevelResource.PLAYER_DATA_DIR).resolve("advancements" + File.separator + uuid + ".json"); // Moose - Change advancements path for slime overworlds - result = new PlayerAdvancements(this.server.getFixerUpper(), this, this.server.getAdvancements(), uuidStatsFile, player); - // this.advancements.put(uuid, result); // CraftBukkit - } diff --git a/legitslimepaper-server/minecraft-patches/sources/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java.patch b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java.patch new file mode 100644 index 0000000..ec6e90e --- /dev/null +++ b/legitslimepaper-server/minecraft-patches/sources/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java ++++ b/net/minecraft/util/filefix/fixes/PlayerStorageFileFix.java +@@ -11,7 +_,7 @@ + + @Override + public void makeFixer() { +- this.addFileFixOperation(FileFixOperations.move("advancements", "players/advancements")); ++ this.addFileFixOperation(FileFixOperations.move("playerdata/advancements", "players/advancements")); // Moose - Move advancements from the custom path to the new vanilla one + this.addFileFixOperation(FileFixOperations.move("playerdata", "players/data")); + this.addFileFixOperation(FileFixOperations.move("stats", "players/stats")); + } From 7d06e4da218813539e61e52f7988db0bdcba483d Mon Sep 17 00:00:00 2001 From: SB2DD <45701824+Mrredstone5230@users.noreply.github.com> Date: Wed, 20 May 2026 00:14:34 -0400 Subject: [PATCH 10/10] fix: updated github actions' jdk version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4434243..9581767 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '21' + java-version: '25' - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - name: Configure Git User Details