aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-09-23 17:36:29 -0700
committerJake Potrebic <[email protected]>2024-09-23 17:36:32 -0700
commit9b1ee0d87db2867e1c2e8a7b0f02686de81f9826 (patch)
tree5a442085cdeb6f83ce590094c7bb9bf033301c89 /patches
parentacdd6d35ad448f5ad06f834c7ef8b0a1a1ab89d9 (diff)
downloadPaper-9b1ee0d87db2867e1c2e8a7b0f02686de81f9826.tar.gz
Paper-9b1ee0d87db2867e1c2e8a7b0f02686de81f9826.zip
Add missing key files and cleanup registry definition order
Diffstat (limited to 'patches')
-rw-r--r--patches/api/0004-Code-Generation.patch48
-rw-r--r--patches/api/0430-Improve-Registry.patch24
-rw-r--r--patches/api/0474-Introduce-registry-entry-and-builders.patch6
-rw-r--r--patches/server/0471-Add-RegistryAccess-for-managing-Registries.patch4
-rw-r--r--patches/server/1015-Add-registry-entry-and-builders.patch4
5 files changed, 57 insertions, 29 deletions
diff --git a/patches/api/0004-Code-Generation.patch b/patches/api/0004-Code-Generation.patch
index ba80e55b13..8a683ad5b4 100644
--- a/patches/api/0004-Code-Generation.patch
+++ b/patches/api/0004-Code-Generation.patch
@@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..2512dba27edfdccbc4430815b6cba048
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
new file mode 100644
-index 0000000000000000000000000000000000000000..7763ea28a00c25ffd8ba8941cff29bae5ae117a2
+index 0000000000000000000000000000000000000000..1e2765d296decbb3e61b8434e78b5e0214f8fee0
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
-@@ -0,0 +1,149 @@
+@@ -0,0 +1,177 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Keyed;
@@ -172,6 +172,36 @@ index 0000000000000000000000000000000000000000..7763ea28a00c25ffd8ba8941cff29bae
+ */
+ @ApiStatus.Internal
+ RegistryKey<ItemType> ITEM = create("item");
++ /**
++ * Built-in registry for cat variants.
++ * @see io.papermc.paper.registry.keys.CatVariantKeys
++ */
++ RegistryKey<Cat.Type> CAT_VARIANT = create("cat_variant");
++ /**
++ * Built-in registry for frog variants.
++ * @see io.papermc.paper.registry.keys.FrogVariantKeys
++ */
++ RegistryKey<Frog.Variant> FROG_VARIANT = create("frog_variant");
++ /**
++ * Built-in registry for villager professions.
++ * @see io.papermc.paper.registry.keys.VillagerProfessionKeys
++ */
++ RegistryKey<Villager.Profession> VILLAGER_PROFESSION = create("villager_profession");
++ /**
++ * Built-in registry for villager types.
++ * @see io.papermc.paper.registry.keys.VillagerTypeKeys
++ */
++ RegistryKey<Villager.Type> VILLAGER_TYPE = create("villager_type");
++ /**
++ * Built-in registry for map decoration types.
++ * @see io.papermc.paper.registry.keys.MapDecorationTypeKeys
++ */
++ RegistryKey<MapCursor.Type> MAP_DECORATION_TYPE = create("map_decoration_type");
++ /**
++ * Built-in registry for menu types.
++ * @see io.papermc.paper.registry.keys.MenuTypeKeys
++ */
++ RegistryKey<MenuType> MENU = create("menu");
+
+
+ /* ********************** *
@@ -214,9 +244,14 @@ index 0000000000000000000000000000000000000000..7763ea28a00c25ffd8ba8941cff29bae
+ RegistryKey<Enchantment> ENCHANTMENT = create("enchantment");
+ /**
+ * Data-driven registry for jukebox songs.
++ * @see io.papermc.paper.registry.keys.JukeboxSongKeys
+ */
-+ @ApiStatus.Experimental
+ RegistryKey<JukeboxSong> JUKEBOX_SONG = create("jukebox_song");
++ /**
++ * Data-driven registry for banner patterns.
++ * @see io.papermc.paper.registry.keys.BannerPatternKeys
++ */
++ RegistryKey<PatternType> BANNER_PATTERN = create("banner_pattern");
+
+
+ /* ******************* *
@@ -224,19 +259,12 @@ index 0000000000000000000000000000000000000000..7763ea28a00c25ffd8ba8941cff29bae
+ * ******************* */
+ RegistryKey<Art> PAINTING_VARIANT = create("painting_variant");
+ RegistryKey<Attribute> ATTRIBUTE = create("attribute");
-+ RegistryKey<PatternType> BANNER_PATTERN = create("banner_pattern");
-+ RegistryKey<Cat.Type> CAT_VARIANT = create("cat_variant");
+ RegistryKey<EntityType> ENTITY_TYPE = create("entity_type");
+ RegistryKey<Particle> PARTICLE_TYPE = create("particle_type");
+ RegistryKey<PotionType> POTION = create("potion");
+ RegistryKey<Sound> SOUND_EVENT = create("sound_event");
-+ RegistryKey<Villager.Profession> VILLAGER_PROFESSION = create("villager_profession");
-+ RegistryKey<Villager.Type> VILLAGER_TYPE = create("villager_type");
+ RegistryKey<MemoryKey<?>> MEMORY_MODULE_TYPE = create("memory_module_type");
+ RegistryKey<Fluid> FLUID = create("fluid");
-+ RegistryKey<Frog.Variant> FROG_VARIANT = create("frog_variant");
-+ RegistryKey<MapCursor.Type> MAP_DECORATION_TYPE = create("map_decoration_type");
-+ RegistryKey<MenuType> MENU = create("menu");
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java b/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java
new file mode 100644
diff --git a/patches/api/0430-Improve-Registry.patch b/patches/api/0430-Improve-Registry.patch
index ebb0b7b8e8..d0b19a0df5 100644
--- a/patches/api/0430-Improve-Registry.patch
+++ b/patches/api/0430-Improve-Registry.patch
@@ -10,7 +10,7 @@ getKey() methods on Keyed objects that have a registry
are marked as Deprecated or Obsolete.
diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java
-index 042d1d932a33022e4fc873652f70dc6ed342d46a..dbbd997d4693f1d9f551bae2ed1d7906c9f39c12 100644
+index 042d1d932a33022e4fc873652f70dc6ed342d46a..e57e34064262b90221b0621f1d13e9705e68421a 100644
--- a/src/main/java/org/bukkit/Art.java
+++ b/src/main/java/org/bukkit/Art.java
@@ -103,6 +103,13 @@ public enum Art implements Keyed {
@@ -19,8 +19,8 @@ index 042d1d932a33022e4fc873652f70dc6ed342d46a..dbbd997d4693f1d9f551bae2ed1d7906
+ // Paper start - deprecate getKey
+ /**
-+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#ART}. Painting variants
-+ * can exist without a key.
++ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
++ * and {@link io.papermc.paper.registry.RegistryKey#PAINTING_VARIANT}. Painting variants can exist without a key.
+ */
+ @Deprecated(since = "1.21")
+ // Paper end - deprecate getKey
@@ -164,7 +164,7 @@ index 8c7b50906fc5b84c5570408f357410810bbfbded..7a35120c82b88774de777d3c3176ef55
@Override
public NamespacedKey getKey() {
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
-index 9e90572745909538e942b7fbe788b5286c6cc9a3..e2afb2582a27b94a922754115dbb6b4ca35e0154 100644
+index 9e90572745909538e942b7fbe788b5286c6cc9a3..8f651d3ebd5907836b5d09363a8b60f55e4afa38 100644
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
@@ -56,6 +56,13 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
@@ -173,8 +173,8 @@ index 9e90572745909538e942b7fbe788b5286c6cc9a3..e2afb2582a27b94a922754115dbb6b4c
+ // Paper start - deprecate getKey
+ /**
-+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#BANNER_PATTERN}. PatternTypes
-+ * can exist without a key.
++ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
++ * and {@link io.papermc.paper.registry.RegistryKey#BANNER_PATTERN}. PatternTypes can exist without a key.
+ */
+ @Deprecated(since = "1.20.5")
+ // Paper end - deprecate getKey
@@ -200,7 +200,7 @@ index 1a766e68713d4014783b3224b9395644116784fa..978054ee364f9a3330525b9b50da5325
+ // Paper end - deprecate getKey
}
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
-index 941fac4eee338870d8c30cb1f64cab572cf54548..74816d6da4d7c8d2fa8a7b93fdc4bf29c8d12803 100644
+index 941fac4eee338870d8c30cb1f64cab572cf54548..9e98625d42199c169f79335bb6231ec355c3b930 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
@@ -68,4 +68,14 @@ public interface TrimMaterial extends Keyed, Translatable {
@@ -210,8 +210,8 @@ index 941fac4eee338870d8c30cb1f64cab572cf54548..74816d6da4d7c8d2fa8a7b93fdc4bf29
+
+ // Paper start - Registry#getKey
+ /**
-+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#TRIM_MATERIAL}. TrimMaterials
-+ * can exist without a key.
++ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
++ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_MATERIAL}. TrimMaterials can exist without a key.
+ */
+ @Deprecated(forRemoval = true, since = "1.20.4")
+ @Override
@@ -219,7 +219,7 @@ index 941fac4eee338870d8c30cb1f64cab572cf54548..74816d6da4d7c8d2fa8a7b93fdc4bf29
+ // Paper end - Registry#getKey
}
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
-index f2242ddc4085f7e7cdd748d860857822e3d9b007..087e99ed281c0b282d91345067bfca80762faa0b 100644
+index f2242ddc4085f7e7cdd748d860857822e3d9b007..b84e495cb4bb4f833b6193c72ae241f0c69d491c 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
@@ -100,4 +100,14 @@ public interface TrimPattern extends Keyed, Translatable {
@@ -229,8 +229,8 @@ index f2242ddc4085f7e7cdd748d860857822e3d9b007..087e99ed281c0b282d91345067bfca80
+
+ // Paper start - Registry#getKey
+ /**
-+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#TRIM_PATTERN}. TrimPatterns
-+ * can exist without a key.
++ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
++ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_PATTERN}. TrimPatterns can exist without a key.
+ */
+ @Deprecated(forRemoval = true, since = "1.20.4")
+ @Override
diff --git a/patches/api/0474-Introduce-registry-entry-and-builders.patch b/patches/api/0474-Introduce-registry-entry-and-builders.patch
index 89d0b4973e..e2e4937863 100644
--- a/patches/api/0474-Introduce-registry-entry-and-builders.patch
+++ b/patches/api/0474-Introduce-registry-entry-and-builders.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Introduce registry entry and builders
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
-index 7763ea28a00c25ffd8ba8941cff29bae5ae117a2..ccbe3fa2e01a80abb801d14891dce34ed179b5ee 100644
+index 1e2765d296decbb3e61b8434e78b5e0214f8fee0..5e580649578d25f567b0f7d40bcdc68f62701f0a 100644
--- a/src/main/java/io/papermc/paper/registry/RegistryKey.java
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -77,9 +77,10 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
@@ -19,8 +19,8 @@ index 7763ea28a00c25ffd8ba8941cff29bae5ae117a2..ccbe3fa2e01a80abb801d14891dce34e
- @ApiStatus.Internal
+ @ApiStatus.Experimental // Paper - already required for registry builders
RegistryKey<ItemType> ITEM = create("item");
-
-
+ /**
+ * Built-in registry for cat variants.
diff --git a/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/EnchantmentRegistryEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..6c7d8b98103909428bb4dcf14825fe188db6d12f
diff --git a/patches/server/0471-Add-RegistryAccess-for-managing-Registries.patch b/patches/server/0471-Add-RegistryAccess-for-managing-Registries.patch
index 5669b4fcb5..0469174819 100644
--- a/patches/server/0471-Add-RegistryAccess-for-managing-Registries.patch
+++ b/patches/server/0471-Add-RegistryAccess-for-managing-Registries.patch
@@ -12,7 +12,7 @@ public net.minecraft.server.RegistryLayer STATIC_ACCESS
diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
new file mode 100644
-index 0000000000000000000000000000000000000000..70e2c3b5cac9a0dfb043de218df20dc1ab2cc070
+index 0000000000000000000000000000000000000000..c92ce42398a9bfd00eb4e05972289c521ee255cf
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
@@ -0,0 +1,146 @@
@@ -87,9 +87,9 @@ index 0000000000000000000000000000000000000000..70e2c3b5cac9a0dfb043de218df20dc1
+ REGISTRY_ENTRIES = List.of(
+ // built-ins
+ entry(Registries.GAME_EVENT, RegistryKey.GAME_EVENT, GameEvent.class, CraftGameEvent::new),
++ entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new),
+ entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new),
+ entry(Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, PotionEffectType.class, CraftPotionEffectType::new),
-+ entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new),
+ entry(Registries.BLOCK, RegistryKey.BLOCK, BlockType.class, CraftBlockType::new),
+ entry(Registries.ITEM, RegistryKey.ITEM, ItemType.class, CraftItemType::new),
+ entry(Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT, Cat.Type.class, CraftCat.CraftType::new),
diff --git a/patches/server/1015-Add-registry-entry-and-builders.patch b/patches/server/1015-Add-registry-entry-and-builders.patch
index a37a06a160..7f581892f6 100644
--- a/patches/server/1015-Add-registry-entry-and-builders.patch
+++ b/patches/server/1015-Add-registry-entry-and-builders.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add registry entry and builders
diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
-index 38222dca2497cec5b104b21429a9ec3aaf05d99e..98b096339fe48b2fc8169ae0376e05d59236fc9a 100644
+index fba7c1758439db9044d9f7368bc9b79642d6b1b9..d59e77811e4090d0f8207e4fff3300d17b1753b2 100644
--- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java
+++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
@@ -1,6 +1,8 @@
@@ -23,9 +23,9 @@ index 38222dca2497cec5b104b21429a9ec3aaf05d99e..98b096339fe48b2fc8169ae0376e05d5
// built-ins
- entry(Registries.GAME_EVENT, RegistryKey.GAME_EVENT, GameEvent.class, CraftGameEvent::new),
+ writable(Registries.GAME_EVENT, RegistryKey.GAME_EVENT, GameEvent.class, CraftGameEvent::new, PaperGameEventRegistryEntry.PaperBuilder::new),
+ entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new),
entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new),
entry(Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, PotionEffectType.class, CraftPotionEffectType::new),
- entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new),
@@ -89,7 +91,7 @@ public final class PaperRegistries {
entry(Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, TrimPattern.class, CraftTrimPattern::new).delayed(),
entry(Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, DamageType.class, CraftDamageType::new).delayed(),