From d2ef0622c92f55e3fe5567e1db2f8b847af25544 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:09:21 -0700 Subject: [PATCH] generator fix --- .../generated/io/papermc/paper/registry/keys/BiomeKeys.java | 4 ++-- .../io/papermc/paper/registry/keys/StructureKeys.java | 2 +- .../io/papermc/paper/registry/keys/TrimPatternKeys.java | 4 ++-- .../java/io/papermc/generator/types/GeneratedKeyType.java | 6 +++--- .../main/java/io/papermc/generator/utils/Annotations.java | 2 +- patches/api/0442-add-missing-Experimental-annotations.patch | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java b/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java index 2d2d06e2a8..fc62be44d6 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java +++ b/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java @@ -250,7 +250,7 @@ public final class BiomeKeys { * @apiNote This field is version-dependant and may be removed in future Minecraft versions */ @ApiStatus.Experimental - @MinecraftExperimental("update 1.21") + @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) public static final TypedKey MANGROVE_SWAMP = create(key("mangrove_swamp")); /** @@ -406,7 +406,7 @@ public final class BiomeKeys { * @apiNote This field is version-dependant and may be removed in future Minecraft versions */ @ApiStatus.Experimental - @MinecraftExperimental("update 1.21") + @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) public static final TypedKey SWAMP = create(key("swamp")); /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java b/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java index 91ae4dc2ff..8b679c044e 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java +++ b/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java @@ -229,7 +229,7 @@ public final class StructureKeys { * @apiNote This field is version-dependant and may be removed in future Minecraft versions */ @ApiStatus.Experimental - @MinecraftExperimental("update 1.21") + @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) public static final TypedKey TRIAL_CHAMBERS = create(key("trial_chambers")); /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java b/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java index 35c4acb498..72d23426af 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java +++ b/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java @@ -33,7 +33,7 @@ public final class TrimPatternKeys { * @apiNote This field is version-dependant and may be removed in future Minecraft versions */ @ApiStatus.Experimental - @MinecraftExperimental("update 1.21") + @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) public static final TypedKey BOLT = create(key("bolt")); /** @@ -63,7 +63,7 @@ public final class TrimPatternKeys { * @apiNote This field is version-dependant and may be removed in future Minecraft versions */ @ApiStatus.Experimental - @MinecraftExperimental("update 1.21") + @MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21) public static final TypedKey FLOW = create(key("flow")); /** diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java index 2c1a72d715..b5ad821c1c 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java +++ b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java @@ -130,15 +130,15 @@ public class GeneratedKeyType extends SimpleGenerator { .initializer("$N(key($S))", createMethod.build(), keyPath) .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString()); if (experimental.contains(key)) { - fieldBuilder.addAnnotations(experimentalAnnotations("update 1.21")); + fieldBuilder.addAnnotations(experimentalAnnotations("MinecraftExperimental.Requires.UPDATE_1_21")); } else { allExperimental = false; } typeBuilder.addField(fieldBuilder.build()); } if (allExperimental) { - typeBuilder.addAnnotations(experimentalAnnotations("update 1.21")); - createMethod.addAnnotations(experimentalAnnotations("update 1.21")); + typeBuilder.addAnnotations(experimentalAnnotations("MinecraftExperimental.Requires.UPDATE_1_21")); + createMethod.addAnnotations(experimentalAnnotations("MinecraftExperimental.Requires.UPDATE_1_21")); } return typeBuilder.addMethod(createMethod.build()).build(); } diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java b/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java index 0d897ecfb4..5c82a94e7a 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java +++ b/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java @@ -16,7 +16,7 @@ public final class Annotations { return List.of( AnnotationSpec.builder(ApiStatus.Experimental.class).build(), AnnotationSpec.builder(MinecraftExperimental.class) - .addMember("value", "$S", version) + .addMember("value", "$L", version) .build() ); } diff --git a/patches/api/0442-add-missing-Experimental-annotations.patch b/patches/api/0442-add-missing-Experimental-annotations.patch index aeb27acad3..ea9a525017 100644 --- a/patches/api/0442-add-missing-Experimental-annotations.patch +++ b/patches/api/0442-add-missing-Experimental-annotations.patch @@ -832,14 +832,14 @@ index 375172e05a78611deb3003f780867516cb6cd1a4..b31a8ff47e28440b5e91ddd2fe3f07fd MUSIC_CREATIVE("music.creative"), MUSIC_CREDITS("music.credits"), diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index cb5890e0e7bccfee2ba32dd4776f1ae1fdd539e8..7f1dc4288c2d324281e11dc582b6f4ef54bde632 100644 +index cb5890e0e7bccfee2ba32dd4776f1ae1fdd539e8..511980c6d190fb80e23d0015dee5ee170bb673ac 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java @@ -1234,6 +1234,7 @@ public interface Tag extends Keyed { /** * Vanilla tag representing entities which deflect projectiles. */ -+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental // Paper - add missing annotation ++ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental(value = MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation Tag ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class); /** * Vanilla tag representing entities which deflect arrows. @@ -847,7 +847,7 @@ index cb5890e0e7bccfee2ba32dd4776f1ae1fdd539e8..7f1dc4288c2d324281e11dc582b6f4ef /** * Vanilla tag representing entities which can turn in boats. */ -+ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental // Paper - add missing annotation ++ @org.jetbrains.annotations.ApiStatus.Experimental @MinecraftExperimental(value = MinecraftExperimental.Requires.UPDATE_1_21) // Paper - add missing annotation Tag ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class); /** * Vanilla tag representing all entities sensitive to illager enchantments.