aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api')
-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
3 files changed, 53 insertions, 25 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