From 3b9db2b19422c8cd6f4c01cc0bdf40974712b744 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Mon, 21 Oct 2024 00:06:54 +0200 Subject: Updated Upstream (Bukkit/CraftBukkit) (#11501) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: bb4e97c6 Add support for Java 23 bc6874dd Bump asm to 9.7.1 50e8a00b PR-1064: Add specific getTopInventory methods for InventoryView derivatives 758b0a0f SPIGOT-7911: Fix Location#isWorldLoaded() for re-loaded worlds 133a64a7 Improve Registry#getOrThrow messages be0f5957 PR-1058: Add tests for Minecraft registry <-> Bukkit fields d1b31df2 PR-1062: Clarify BeaconView documentation 3fab4384 PR-1060: Cache Material to BlockType and ItemType conversion 967a7301 SPIGOT-7906: Increase YAML nesting limit to 100 6ecf033d SPIGOT-7899: Smithing recipes don't require inputs CraftBukkit Changes: 0a7bd6c81 PR-1493: Improve reroute performance and add some tests 54941524c Add support for Java 23 f4d957fff SPIGOT-7915: Fix World#getKeepSpawnInMemory() using Spawn Radius rather than Spawn Chunk Radius ded183674 Fix HIDE_ENCHANTS flag in items without enchantments 308785a0a Bump asm to 9.7.1 and re-add ClassReader to ClassWriter 72ce823cd PR-1487: Add specific getTopInventory methods for InventoryView derivatives 11a5e840c SPIGOT-7907, PR-1484: Improve merchant recipe item matching behavior to more closely align with older versions 45b66f7e4 SPIGOT-7909: Always set HIDE_ENCHANTS flag to item if flag is set 963459791 Increase outdated build delay fc5b2d75f SPIGOT-7910: Fix launching breeze wind charge from API and improve dispenser launch API c7d6428f2 SPIGOT-7856, PR-1483: End platform not dropping items after replacing blocks 2a5572b52 SPIGOT-7780, PR-1482: Cannot edit chunks during unload event 527041ab5 SPIGOT-7902, PR-1477: Fix CraftMetaPotion#hasCustomEffects() does not check if customEffects (List) is empty 5529a1769 Implement base methods for tags 30fbdbaaf Improve Registry#getOrThrow messages 6b71a7322 PR-1475: Add tests for Minecraft registry <-> Bukkit fields 5f24c255c SPIGOT-7908: Mark junit-platform-suite-engine as test scope e4c92ef65 PR-1473: Change tests to use suites, to run tests in different environments and feature flags d25e1e722 PR-1481: Fix BeaconView#set[X]Effect(null) d69a05362 PR-1480: Fix PerMaterialTest#isEdible test running for legacy materials bb3284a89 PR-1479: Use custom #isBlock method in legacy init instead of the one in Material, since it relies on legacy being init 98c57cbbe SPIGOT-7904: Fix NPE for PlayerItemBreakEvent f35bae9ec Fix missing hasJukeboxPlayable 8a6f8b6d8 SPIGOT-7881: CTRL+Pick Block saves position data into item 7913b3be7 SPIGOT-7899: Smithing recipes don't require inputs --- .../server/0965-Brigadier-based-command-API.patch | 67 +++++++++------------- 1 file changed, 28 insertions(+), 39 deletions(-) (limited to 'patches/server/0965-Brigadier-based-command-API.patch') diff --git a/patches/server/0965-Brigadier-based-command-API.patch b/patches/server/0965-Brigadier-based-command-API.patch index 997c10e4b7..6334fcc1c8 100644 --- a/patches/server/0965-Brigadier-based-command-API.patch +++ b/patches/server/0965-Brigadier-based-command-API.patch @@ -2392,7 +2392,7 @@ index e0c46e548a34c963750c9411dfd3c0946d67a7c7..5215783353021583e7a726d281e4d173 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e0b92ca7f 100644 +index 0fc6e659915a4547c2db9205fed205a1d28f21d4..35d1dcabb182b0a31727e5ddefe33955c804603b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -272,11 +272,11 @@ public final class CraftServer implements Server { @@ -2423,7 +2423,7 @@ index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e CraftRegistry.setMinecraftRegistry(console.registryAccess()); -@@ -602,48 +608,11 @@ public final class CraftServer implements Server { +@@ -603,48 +609,11 @@ public final class CraftServer implements Server { } private void setVanillaCommands(boolean first) { // Spigot @@ -2474,7 +2474,7 @@ index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e // Refresh commands for (ServerPlayer player : this.getHandle().players) { -@@ -1030,17 +999,31 @@ public final class CraftServer implements Server { +@@ -1031,17 +1000,31 @@ public final class CraftServer implements Server { return true; } @@ -2516,7 +2516,7 @@ index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e return false; } -@@ -1049,7 +1032,7 @@ public final class CraftServer implements Server { +@@ -1050,7 +1033,7 @@ public final class CraftServer implements Server { public void reload() { // Paper start - lifecycle events if (io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.blocksPluginReloading()) { @@ -2525,7 +2525,7 @@ index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e } // Paper end - lifecycle events org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload -@@ -1103,8 +1086,9 @@ public final class CraftServer implements Server { +@@ -1105,8 +1088,9 @@ public final class CraftServer implements Server { } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper @@ -2536,7 +2536,7 @@ index cd747daf186fa3a540db08232a57683492f0131f..df15ce8d1da2737e339880d3d2f6731e // Paper start for (Plugin plugin : pluginClone) { entityMetadata.removeAll(plugin); -@@ -1144,6 +1128,12 @@ public final class CraftServer implements Server { +@@ -1146,6 +1130,12 @@ public final class CraftServer implements Server { this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins @@ -2714,45 +2714,34 @@ index 0000000000000000000000000000000000000000..b2fdb8351c2abb55283850a929d2a87a +io.papermc.paper.command.brigadier.argument.VanillaArgumentProviderImpl diff --git a/src/test/java/io/papermc/paper/command/brigadier/BukkitCommandConversionTest.java b/src/test/java/io/papermc/paper/command/brigadier/BukkitCommandConversionTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..6475510ea1084a003fb2c8645cb4538b3f48e1c7 +index 0000000000000000000000000000000000000000..4b419ce023f61d5af9ff7a34e6879de1991cf4df --- /dev/null +++ b/src/test/java/io/papermc/paper/command/brigadier/BukkitCommandConversionTest.java -@@ -0,0 +1,113 @@ +@@ -0,0 +1,102 @@ +package io.papermc.paper.command.brigadier; + +import com.mojang.brigadier.CommandDispatcher; -+import com.mojang.brigadier.ResultConsumer; -+import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.suggestion.Suggestions; -+import com.mojang.brigadier.tree.CommandNode; +import io.papermc.paper.command.brigadier.bukkit.BukkitBrigForwardingMap; -+import net.minecraft.server.MinecraftServer; -+import net.minecraft.world.flag.FeatureFlags; -+import org.apache.logging.log4j.core.util.Assert; ++import java.util.List; ++import java.util.Map; +import org.bukkit.Bukkit; +import org.bukkit.Location; -+import org.bukkit.World; +import org.bukkit.command.Command; +import org.bukkit.command.CommandMap; +import org.bukkit.command.CommandSender; +import org.bukkit.command.SimpleCommandMap; -+import org.bukkit.craftbukkit.command.CraftCommandMap; -+import org.bukkit.craftbukkit.command.VanillaCommandWrapper; -+import org.bukkit.entity.Entity; -+import org.bukkit.plugin.PluginManager; -+import org.bukkit.support.AbstractTestingBase; ++import org.bukkit.support.RegistryHelper; ++import org.bukkit.support.environment.AllFeatures; ++import org.bukkit.support.environment.Normal; +import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + -+import java.util.List; -+import java.util.Map; -+import java.util.logging.Logger; -+ -+public class BukkitCommandConversionTest extends AbstractTestingBase { ++@Normal ++public class BukkitCommandConversionTest { + + private CommandSender getSender() { + return Mockito.mock(CommandSender.class); @@ -2764,7 +2753,7 @@ index 0000000000000000000000000000000000000000..6475510ea1084a003fb2c8645cb4538b + CommandSourceStack object = Mockito.mock(CommandSourceStack.class); + Mockito.when(object.getLocation()).thenReturn(new Location(null, 0, 0, 0));; + -+ CommandDispatcher dispatcher = DATA_PACK.commands.getDispatcher(); ++ CommandDispatcher dispatcher = RegistryHelper.getDataPack().commands.getDispatcher(); + dispatcher.setConsumer((context, success, result) -> {}); + CommandMap commandMap = new SimpleCommandMap(Bukkit.getServer(), new BukkitBrigForwardingMap()); + Map stringCommandMap = commandMap.getKnownCommands(); @@ -2831,16 +2820,16 @@ index 0000000000000000000000000000000000000000..6475510ea1084a003fb2c8645cb4538b + } + } +} -diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java -index cce9e2226ef554c10e1df1dbaa1791656d5d0799..6e9ee1b56b4151c31c373e58172055e02fd7875a 100644 ---- a/src/test/java/org/bukkit/support/DummyServer.java -+++ b/src/test/java/org/bukkit/support/DummyServer.java -@@ -100,7 +100,7 @@ public final class DummyServer { - final Thread currentThread = Thread.currentThread(); - when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); - -- final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null); -+ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance, new java.util.HashMap<>()), null); // Paper - when(instance.getPluginManager()).thenReturn(pluginManager); - // paper end - testing additions +diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java +index 5d24b95e3eec351ec1e9444533dd5f9d376ec4c6..fb4b7625b4ea4b4918ade95829e10e98d1bac70f 100644 +--- a/src/test/java/org/bukkit/support/DummyServerHelper.java ++++ b/src/test/java/org/bukkit/support/DummyServerHelper.java +@@ -87,7 +87,7 @@ public final class DummyServerHelper { + // Paper start - testing additions + final Thread currentThread = Thread.currentThread(); + when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); +- final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null); ++ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance, new java.util.HashMap<>()), null); + when(instance.getPluginManager()).thenReturn(pluginManager); + // Paper end - testing additions -- cgit v1.2.3