diff --git a/gradle.properties b/gradle.properties index 522c365..3e835f5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ group=com.legitimoose.legitslimepaper -version=1.21.8-R0.1-SNAPSHOT -mcVersion=1.21.8 +version=1.21.10-R0.1-SNAPSHOT +mcVersion=1.21.10 #Update with ASP!! (also update gradle/libs.versions.toml) -aspRef=6e2b4ea58f6686dd7b2601d0c83012537d9db29d +aspRef=8ff5a5f93c921c668a937e2d864a00634cc964f2 apiVersion=4.2.0-SNAPSHOT org.gradle.caching=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d1ab5a7..0cb3aa9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -adventure = "4.23.0" +adventure = "4.24.0" annotations = "26.0.1" autoservice = "1.1.1" blossom = "2.1.0" @@ -15,9 +15,9 @@ lettuce = "6.5.1.RELEASE" lombok = "1.18.36" lombok-plugin = "8.11" mongo = "5.2.1" -paperweight = "2.0.0-beta.17" +paperweight = "2.0.0-beta.18" plugin-yml-paper = "0.6.0" -shadow = "8.3.5" +shadow = "9.2.2" slf4j = "2.0.16" zstd = "1.5.6-8" diff --git a/legitslimepaper-api/build.gradle.kts.patch b/legitslimepaper-api/build.gradle.kts.patch index 6b5c5df..02e9a93 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 -@@ -102,17 +_,21 @@ +@@ -101,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 412deb1..c265c76 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,6 +1,6 @@ --- a/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java +++ b/src/main/java/com/infernalsuite/asp/SlimeNMSBridgeImpl.java -@@ -82,6 +_,7 @@ +@@ -79,6 +_,7 @@ // Some stuff is needed when loading overworld world SlimeLevelInstance instance = ((SlimeInMemoryWorld) this.loadInstance(defaultWorld, Level.OVERWORLD)).getInstance(); DimensionDataStorage worldpersistentdata = instance.getDataStorage(); 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 745e896..3c9c94a 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 -@@ -57,16 +_,10 @@ +@@ -68,16 +_,10 @@ public static LevelStorageSource CUSTOM_LEVEL_STORAGE; static { @@ -21,20 +21,20 @@ } private static final ExecutorService WORLD_SAVER_SERVICE = Executors.newFixedThreadPool(4, new ThreadFactoryBuilder() -@@ -80,7 +_,7 @@ +@@ -91,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, - MinecraftServer.getServer().progressListenerFactory.create(11), false, 0, + primaryLevelData, worldKey, worldDimension, false, 0, Collections.emptyList(), true, null, environment, null, null); -@@ -132,6 +_,7 @@ + this.slimeInstance = new SlimeInMemoryWorld(slimeBootstrap, this); +@@ -169,6 +_,7 @@ Bukkit.getPluginManager().callEvent(new WorldSaveEvent(getWorld())); //this.getChunkSource().save(forceSave); + this.getDataStorage().saveAndJoin(); // Moose - this.serverLevelData.setWorldBorder(this.getWorldBorder().createSettings()); this.serverLevelData.setCustomBossEvents(MinecraftServer.getServer().getCustomBossEvents().save(MinecraftServer.getServer().registryAccess())); + if (MinecraftServer.getServer().isStopped()) { // Make sure the world gets saved before stopping the server by running it from the main thread diff --git a/legitslimepaper-server/build.gradle.kts.patch b/legitslimepaper-server/build.gradle.kts.patch index 1bb3712..23c5238 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 -@@ -35,7 +_,22 @@ +@@ -32,7 +_,22 @@ } } @@ -8,23 +8,23 @@ + 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") -+ } ++ 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") -+ } ++ 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 spigot { enabled = true -@@ -122,10 +_,14 @@ +@@ -119,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") { -@@ -152,7 +_,7 @@ +@@ -150,7 +_,7 @@ } dependencies { - implementation(project(":aspaper-api")) //ASP + implementation(project(":legitslimepaper-api")) //ASP + Moose implementation(project(":core")) //ASP - implementation("ca.spottedleaf:concurrentutil:0.0.3") + implementation("ca.spottedleaf:concurrentutil:0.0.7") implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ -@@ -224,14 +_,14 @@ +@@ -221,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 147316a..a6c73e5 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 @@ -28,7 +28,7 @@ import net.minecraft.network.chat.HoverEvent; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.protocol.game.ClientboundCommandsPacket; -@@ -143,6 +_,7 @@ +@@ -145,6 +_,7 @@ import net.minecraft.util.profiling.jfr.JvmProfiler; import net.minecraft.world.flag.FeatureFlagSet; import net.minecraft.world.flag.FeatureFlags; @@ -36,7 +36,7 @@ import net.minecraft.world.level.GameRules; import org.slf4j.Logger; -@@ -175,6 +_,7 @@ +@@ -177,6 +_,7 @@ } }; private final CommandDispatcher dispatcher = new CommandDispatcher<>(); @@ -44,7 +44,7 @@ public Commands(Commands.CommandSelection selection, CommandBuildContext context) { // Paper start - Brigadier API - modern minecraft overloads that do not use redirects but are copies instead -@@ -286,6 +_,25 @@ +@@ -293,6 +_,25 @@ PublishCommand.register(this.dispatcher); } @@ -70,7 +70,7 @@ // Paper start - Vanilla command permission fixes for (final CommandNode node : this.dispatcher.getRoot().getChildren()) { if (node.getRequirement() == com.mojang.brigadier.builder.ArgumentBuilder.defaultRequirement()) { -@@ -353,6 +_,15 @@ +@@ -360,6 +_,15 @@ ContextChain contextChain = finishParsing(parseResults, command, commandSourceStack); try { @@ -86,7 +86,7 @@ if (contextChain != null) { executeCommandInContext( commandSourceStack, -@@ -363,7 +_,7 @@ +@@ -370,7 +_,7 @@ } // Paper start } catch (Throwable var12) { // always gracefully handle it, no matter how bad:tm: @@ -95,7 +95,7 @@ // 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 -@@ -494,12 +_,27 @@ +@@ -501,12 +_,27 @@ for (CommandNode node : rootCommandNode.getChildren()) { bukkit.add(node.getName()); } @@ -123,7 +123,7 @@ private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) { // Paper end - Perf: Async command map building -@@ -514,6 +_,15 @@ +@@ -521,6 +_,15 @@ } } // CraftBukkit end 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 93122b4..ccff13d 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,6 +1,6 @@ --- a/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java +++ b/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java -@@ -341,7 +_,7 @@ +@@ -345,7 +_,7 @@ boolean var9; try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(entity.problemPath(), LOGGER)) { TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector, entity.registryAccess()); 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 6337f69..903cf16 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 @@ -8,7 +8,7 @@ import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; -@@ -88,7 +_,20 @@ +@@ -86,7 +_,20 @@ this.underlined = underlined; this.strikethrough = strikethrough; this.obfuscated = obfuscated; 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 9fa95df..ee2527c 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 @@ -22,7 +22,7 @@ import net.minecraft.SharedConstants; import net.minecraft.SuppressForbidden; import net.minecraft.Util; -@@ -54,11 +_,7 @@ +@@ -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; @@ -35,7 +35,7 @@ import org.slf4j.Logger; public class Main { -@@ -141,6 +_,8 @@ +@@ -139,6 +_,8 @@ return; } @@ -44,7 +44,7 @@ // Spigot start boolean eulaAgreed = Boolean.getBoolean("com.mojang.eula.agree"); if (eulaAgreed) { -@@ -230,7 +_,7 @@ +@@ -228,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 626c93a..b93ef68 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 @@ -8,7 +8,7 @@ import net.minecraft.commands.functions.CommandFunction; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; -@@ -89,7 +_,7 @@ +@@ -90,7 +_,7 @@ ResourceLocation resourceLocation1 = LISTER.fileToId(resourceLocation); map1.put(resourceLocation1, CompletableFuture.supplyAsync(() -> { List lines = readLines(entry.getValue()); 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 e9aefb0..71347b6 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 -@@ -565,8 +_,8 @@ +@@ -535,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 c01a0a6..0c93ea7 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 -@@ -1361,7 +_,7 @@ +@@ -1366,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)) { -@@ -1387,7 +_,7 @@ +@@ -1392,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)); -@@ -3492,7 +_,7 @@ +@@ -3508,7 +_,7 @@ @Override public void handleChangeGameMode(ServerboundChangeGameModePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); @@ -26,4 +26,4 @@ + 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 LOGGER.warn( "Player {} tried to change game mode to {} without required permissions", - this.player.getGameProfile().getName(), + this.player.getGameProfile().name(), 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 fd4fd55..c07aa61 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 -@@ -834,7 +_,7 @@ +@@ -694,7 +_,7 @@ } @Override @@ -9,17 +9,17 @@ super.addAdditionalSaveData(output); NbtUtils.addCurrentDataVersion(output); this.inventory.save(output.list("Inventory", ItemStackWithSlot.CODEC)); -@@ -847,7 +_,8 @@ +@@ -707,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)); - if (!this.getShoulderEntityLeft().isEmpty()) { - output.store("ShoulderEntityLeft", CompoundTag.CODEC, this.getShoulderEntityLeft()); - } -@@ -2105,7 +_,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); +@@ -1890,7 +_,7 @@ } public boolean canUseGameMasterBlocks() {