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
This commit is contained in:
Bjarne Koll 2024-10-21 00:06:54 +02:00 committed by GitHub
parent 755a7753af
commit 3b9db2b194
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
212 changed files with 1502 additions and 1329 deletions

View file

@ -207,10 +207,10 @@ index e0f652117e585882693736de8165ae9c689e1d68..fbe14c327ee9c1ac07893853ca7c699e
return server.getRegistry(tClass);
}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f2125babf61c 100644
index 4e67b944351ec3743e5eeaba3f5de99e0df15154..39997047be9f3796d8d5d8934eb361e23d273ebd 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -88,8 +88,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -98,8 +98,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Server banner patterns.
*
* @see PatternType
@ -222,7 +222,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Server biomes.
*
@@ -103,7 +105,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -113,7 +115,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @apiNote BlockType is not ready for public usage yet
*/
@ApiStatus.Internal
@ -231,7 +231,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Custom boss bars.
*
@@ -135,13 +137,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -155,13 +157,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see Cat.Type
*/
@ -249,7 +249,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Server entity types.
*
@@ -153,7 +157,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -173,7 +177,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see MusicInstrument
*/
@ -258,7 +258,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Server item types.
*
@@ -161,7 +165,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -181,7 +185,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @apiNote ItemType is not ready for public usage yet
*/
@ApiStatus.Internal
@ -267,7 +267,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Default server loot tables.
*
@@ -180,13 +184,13 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -200,13 +204,13 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see MenuType
*/
@ApiStatus.Experimental
@ -283,13 +283,13 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Server particles.
*
@@ -209,14 +213,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -229,14 +233,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Server structures.
*
* @see Structure
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#STRUCTURE}
*/
- Registry<Structure> STRUCTURE = Bukkit.getRegistry(Structure.class);
- Registry<Structure> STRUCTURE = Objects.requireNonNull(Bukkit.getRegistry(Structure.class), "No registry present for Structure. This is a bug.");
+ @Deprecated(since = "1.20.6") // Paper
+ Registry<Structure> STRUCTURE = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(Structure.class), "No registry present for Structure. This is a bug."); // Paper
/**
@ -297,18 +297,18 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
*
* @see StructureType
*/
- Registry<StructureType> STRUCTURE_TYPE = Bukkit.getRegistry(StructureType.class);
+ Registry<StructureType> STRUCTURE_TYPE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.STRUCTURE_TYPE); // Paper
- Registry<StructureType> STRUCTURE_TYPE = Objects.requireNonNull(Bukkit.getRegistry(StructureType.class), "No registry present for StructureType. This is a bug.");
+ Registry<StructureType> STRUCTURE_TYPE = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.STRUCTURE_TYPE), "No registry present for StructureType. This is a bug."); // Paper
/**
* Sound keys.
*
@@ -227,40 +233,47 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -247,40 +253,47 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Trim materials.
*
* @see TrimMaterial
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#TRIM_MATERIAL}
*/
- Registry<TrimMaterial> TRIM_MATERIAL = Bukkit.getRegistry(TrimMaterial.class);
- Registry<TrimMaterial> TRIM_MATERIAL = Objects.requireNonNull(Bukkit.getRegistry(TrimMaterial.class), "No registry present for TrimMaterial. This is a bug.");
+ @Deprecated(since = "1.20.6") // Paper
+ Registry<TrimMaterial> TRIM_MATERIAL = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(TrimMaterial.class), "No registry present for TrimMaterial. This is a bug."); // Paper
/**
@ -317,7 +317,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
* @see TrimPattern
+ * @deprecated use {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)} with {@link io.papermc.paper.registry.RegistryKey#TRIM_PATTERN}
*/
- Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
- Registry<TrimPattern> TRIM_PATTERN = Objects.requireNonNull(Bukkit.getRegistry(TrimPattern.class), "No registry present for TrimPattern. This is a bug.");
+ @Deprecated(since = "1.20.6")
+ Registry<TrimPattern> TRIM_PATTERN = Objects.requireNonNull(io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(TrimPattern.class), "No registry present for TrimPattern. This is a bug."); // Paper
/**
@ -357,7 +357,7 @@ index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f212
/**
* Memory Keys.
*
@@ -297,25 +310,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -327,25 +340,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see Frog.Variant
*/
@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..f5ece852f97017f71bc129e194cb2129
+ }
+}
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
index c79faf4197f9c0a7256cefe2b001182102d2b796..55f1bc7d01e5184172559c43b8327ac86d58041b 100644
index 2a3ae4afef2716a5fdcefbb6d5e0e011d1db9934..494419922f11e494c9de6f757bb76f0cfe5d7c81 100644
--- a/src/test/java/org/bukkit/support/TestServer.java
+++ b/src/test/java/org/bukkit/support/TestServer.java
@@ -37,36 +37,11 @@ public final class TestServer {
@@ -38,46 +38,11 @@ public final class TestServer {
when(instance.getBukkitVersion()).thenReturn("BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion());
@ -460,6 +460,16 @@ index c79faf4197f9c0a7256cefe2b001182102d2b796..55f1bc7d01e5184172559c43b8327ac8
-
- @NotNull
- @Override
- public Keyed getOrThrow(@NotNull NamespacedKey key) {
- Keyed keyed = get(key);
-
- Preconditions.checkArgument(keyed != null, "No %s registry entry found for key %s.", aClass, key);
-
- return keyed;
- }
-
- @NotNull
- @Override
- public Stream<Keyed> stream() {
- throw new UnsupportedOperationException("Not supported");
- }