From ce0286332237a3797bc6f63d88bace751c4b0e02 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/add-missing-Experimental-annotations.patch | 4 ++-- 6 files changed, 11 insertions(+), 11 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/add-missing-Experimental-annotations.patch b/patches/api/add-missing-Experimental-annotations.patch index ad9eb05a7f..9662af6e2a 100644 --- a/patches/api/add-missing-Experimental-annotations.patch +++ b/patches/api/add-missing-Experimental-annotations.patch @@ -839,7 +839,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * 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 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * 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.