update generator

This commit is contained in:
Lulu13022002 2024-10-26 18:03:25 +02:00
parent 2946dbb832
commit 98af0e0d3b
No known key found for this signature in database
GPG Key ID: 491C8F0B8ACDEB01
39 changed files with 1134 additions and 364 deletions

View File

@ -15,7 +15,7 @@ dependencies {
implementation("com.squareup:javapoet:1.13.0") implementation("com.squareup:javapoet:1.13.0")
implementation(project(":paper-api")) implementation(project(":paper-api"))
implementation("io.github.classgraph:classgraph:4.8.47") implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:24.0.1") implementation("org.jetbrains:annotations:24.1.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")
} }

View File

@ -66,7 +66,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
public interface VanillaGoal<T extends Mob> extends Goal<T> { public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class); GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
@ -102,6 +102,10 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Bee> BEE_WANDER = create("bee_wander", Bee.class); GoalKey<Bee> BEE_WANDER = create("bee_wander", Bee.class);
GoalKey<Bee> VALIDATE_FLOWER = create("validate_flower", Bee.class);
GoalKey<Bee> VALIDATE_HIVE = create("validate_hive", Bee.class);
GoalKey<Blaze> BLAZE_ATTACK = create("blaze_attack", Blaze.class); GoalKey<Blaze> BLAZE_ATTACK = create("blaze_attack", Blaze.class);
GoalKey<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class); GoalKey<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class);

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class BannerPatternKeys { public final class BannerPatternKeys {
/** /**

View File

@ -6,6 +6,7 @@ import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
@ -23,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class BiomeKeys { public final class BiomeKeys {
/** /**
@ -299,6 +300,15 @@ public final class BiomeKeys {
*/ */
public static final TypedKey<Biome> OLD_GROWTH_SPRUCE_TAIGA = create(key("old_growth_spruce_taiga")); public static final TypedKey<Biome> OLD_GROWTH_SPRUCE_TAIGA = create(key("old_growth_spruce_taiga"));
/**
* {@code minecraft:pale_garden}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<Biome> PALE_GARDEN = create(key("pale_garden"));
/** /**
* {@code minecraft:plains} * {@code minecraft:plains}
* *

View File

@ -6,6 +6,7 @@ import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.BlockType; import org.bukkit.block.BlockType;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
@ -23,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class BlockTypeKeys { public final class BlockTypeKeys {
/** /**
@ -1622,6 +1623,15 @@ public final class BlockTypeKeys {
*/ */
public static final TypedKey<BlockType> CRAFTING_TABLE = create(key("crafting_table")); public static final TypedKey<BlockType> CRAFTING_TABLE = create(key("crafting_table"));
/**
* {@code minecraft:creaking_heart}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> CREAKING_HEART = create(key("creaking_heart"));
/** /**
* {@code minecraft:creeper_head} * {@code minecraft:creeper_head}
* *
@ -4562,6 +4572,186 @@ public final class BlockTypeKeys {
*/ */
public static final TypedKey<BlockType> PACKED_MUD = create(key("packed_mud")); public static final TypedKey<BlockType> PACKED_MUD = create(key("packed_mud"));
/**
* {@code minecraft:pale_hanging_moss}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_HANGING_MOSS = create(key("pale_hanging_moss"));
/**
* {@code minecraft:pale_moss_block}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_MOSS_BLOCK = create(key("pale_moss_block"));
/**
* {@code minecraft:pale_moss_carpet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_MOSS_CARPET = create(key("pale_moss_carpet"));
/**
* {@code minecraft:pale_oak_button}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_BUTTON = create(key("pale_oak_button"));
/**
* {@code minecraft:pale_oak_door}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_DOOR = create(key("pale_oak_door"));
/**
* {@code minecraft:pale_oak_fence}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_FENCE = create(key("pale_oak_fence"));
/**
* {@code minecraft:pale_oak_fence_gate}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_FENCE_GATE = create(key("pale_oak_fence_gate"));
/**
* {@code minecraft:pale_oak_hanging_sign}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_HANGING_SIGN = create(key("pale_oak_hanging_sign"));
/**
* {@code minecraft:pale_oak_leaves}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_LEAVES = create(key("pale_oak_leaves"));
/**
* {@code minecraft:pale_oak_log}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_LOG = create(key("pale_oak_log"));
/**
* {@code minecraft:pale_oak_planks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_PLANKS = create(key("pale_oak_planks"));
/**
* {@code minecraft:pale_oak_pressure_plate}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_PRESSURE_PLATE = create(key("pale_oak_pressure_plate"));
/**
* {@code minecraft:pale_oak_sapling}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_SAPLING = create(key("pale_oak_sapling"));
/**
* {@code minecraft:pale_oak_sign}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_SIGN = create(key("pale_oak_sign"));
/**
* {@code minecraft:pale_oak_slab}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_SLAB = create(key("pale_oak_slab"));
/**
* {@code minecraft:pale_oak_stairs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_STAIRS = create(key("pale_oak_stairs"));
/**
* {@code minecraft:pale_oak_trapdoor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_TRAPDOOR = create(key("pale_oak_trapdoor"));
/**
* {@code minecraft:pale_oak_wall_hanging_sign}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_WALL_HANGING_SIGN = create(key("pale_oak_wall_hanging_sign"));
/**
* {@code minecraft:pale_oak_wall_sign}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_WALL_SIGN = create(key("pale_oak_wall_sign"));
/**
* {@code minecraft:pale_oak_wood}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> PALE_OAK_WOOD = create(key("pale_oak_wood"));
/** /**
* {@code minecraft:pearlescent_froglight} * {@code minecraft:pearlescent_froglight}
* *
@ -5143,6 +5333,15 @@ public final class BlockTypeKeys {
*/ */
public static final TypedKey<BlockType> POTTED_OXEYE_DAISY = create(key("potted_oxeye_daisy")); public static final TypedKey<BlockType> POTTED_OXEYE_DAISY = create(key("potted_oxeye_daisy"));
/**
* {@code minecraft:potted_pale_oak_sapling}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> POTTED_PALE_OAK_SAPLING = create(key("potted_pale_oak_sapling"));
/** /**
* {@code minecraft:potted_pink_tulip} * {@code minecraft:potted_pink_tulip}
* *
@ -6410,6 +6609,24 @@ public final class BlockTypeKeys {
*/ */
public static final TypedKey<BlockType> STRIPPED_OAK_WOOD = create(key("stripped_oak_wood")); public static final TypedKey<BlockType> STRIPPED_OAK_WOOD = create(key("stripped_oak_wood"));
/**
* {@code minecraft:stripped_pale_oak_log}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> STRIPPED_PALE_OAK_LOG = create(key("stripped_pale_oak_log"));
/**
* {@code minecraft:stripped_pale_oak_wood}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TypedKey<BlockType> STRIPPED_PALE_OAK_WOOD = create(key("stripped_pale_oak_wood"));
/** /**
* {@code minecraft:stripped_spruce_log} * {@code minecraft:stripped_spruce_log}
* *

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class CatVariantKeys { public final class CatVariantKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class DamageTypeKeys { public final class DamageTypeKeys {
/** /**
@ -82,6 +82,13 @@ public final class DamageTypeKeys {
*/ */
public static final TypedKey<DamageType> DRY_OUT = create(key("dry_out")); public static final TypedKey<DamageType> DRY_OUT = create(key("dry_out"));
/**
* {@code minecraft:ender_pearl}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DamageType> ENDER_PEARL = create(key("ender_pearl"));
/** /**
* {@code minecraft:explosion} * {@code minecraft:explosion}
* *
@ -201,6 +208,13 @@ public final class DamageTypeKeys {
*/ */
public static final TypedKey<DamageType> LIGHTNING_BOLT = create(key("lightning_bolt")); public static final TypedKey<DamageType> LIGHTNING_BOLT = create(key("lightning_bolt"));
/**
* {@code minecraft:mace_smash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DamageType> MACE_SMASH = create(key("mace_smash"));
/** /**
* {@code minecraft:magic} * {@code minecraft:magic}
* *

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class EnchantmentKeys { public final class EnchantmentKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class FrogVariantKeys { public final class FrogVariantKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class GameEventKeys { public final class GameEventKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class InstrumentKeys { public final class InstrumentKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class JukeboxSongKeys { public final class JukeboxSongKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class MapDecorationTypeKeys { public final class MapDecorationTypeKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class MenuTypeKeys { public final class MenuTypeKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class MobEffectKeys { public final class MobEffectKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class StructureKeys { public final class StructureKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class StructureTypeKeys { public final class StructureTypeKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class TrimMaterialKeys { public final class TrimMaterialKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class TrimPatternKeys { public final class TrimPatternKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class VillagerProfessionKeys { public final class VillagerProfessionKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class VillagerTypeKeys { public final class VillagerTypeKeys {
/** /**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class WolfVariantKeys { public final class WolfVariantKeys {
/** /**

View File

@ -24,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class EnchantmentTagKeys { public final class EnchantmentTagKeys {
/** /**

View File

@ -6,6 +6,7 @@ import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey; import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.inventory.ItemType; import org.bukkit.inventory.ItemType;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
@ -23,7 +24,7 @@ import org.jetbrains.annotations.ApiStatus;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.21.1") @GeneratedFrom("1.21.3")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class ItemTypeTagKeys { public final class ItemTypeTagKeys {
/** /**
@ -131,6 +132,20 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> BREAKS_DECORATED_POTS = create(key("breaks_decorated_pots")); public static final TagKey<ItemType> BREAKS_DECORATED_POTS = create(key("breaks_decorated_pots"));
/**
* {@code #minecraft:brewing_fuel}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> BREWING_FUEL = create(key("brewing_fuel"));
/**
* {@code #minecraft:bundles}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> BUNDLES = create(key("bundles"));
/** /**
* {@code #minecraft:buttons} * {@code #minecraft:buttons}
* *
@ -292,6 +307,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> DIAMOND_ORES = create(key("diamond_ores")); public static final TagKey<ItemType> DIAMOND_ORES = create(key("diamond_ores"));
/**
* {@code #minecraft:diamond_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DIAMOND_TOOL_MATERIALS = create(key("diamond_tool_materials"));
/** /**
* {@code #minecraft:dirt} * {@code #minecraft:dirt}
* *
@ -306,6 +328,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> DOORS = create(key("doors")); public static final TagKey<ItemType> DOORS = create(key("doors"));
/**
* {@code #minecraft:duplicates_allays}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DUPLICATES_ALLAYS = create(key("duplicates_allays"));
/** /**
* {@code #minecraft:dyeable} * {@code #minecraft:dyeable}
* *
@ -509,6 +538,20 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> FROG_FOOD = create(key("frog_food")); public static final TagKey<ItemType> FROG_FOOD = create(key("frog_food"));
/**
* {@code #minecraft:furnace_minecart_fuel}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> FURNACE_MINECART_FUEL = create(key("furnace_minecart_fuel"));
/**
* {@code #minecraft:gaze_disguise_equipment}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> GAZE_DISGUISE_EQUIPMENT = create(key("gaze_disguise_equipment"));
/** /**
* {@code #minecraft:goat_food} * {@code #minecraft:goat_food}
* *
@ -523,6 +566,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> GOLD_ORES = create(key("gold_ores")); public static final TagKey<ItemType> GOLD_ORES = create(key("gold_ores"));
/**
* {@code #minecraft:gold_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> GOLD_TOOL_MATERIALS = create(key("gold_tool_materials"));
/** /**
* {@code #minecraft:hanging_signs} * {@code #minecraft:hanging_signs}
* *
@ -579,6 +629,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> IRON_ORES = create(key("iron_ores")); public static final TagKey<ItemType> IRON_ORES = create(key("iron_ores"));
/**
* {@code #minecraft:iron_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> IRON_TOOL_MATERIALS = create(key("iron_tool_materials"));
/** /**
* {@code #minecraft:jungle_logs} * {@code #minecraft:jungle_logs}
* *
@ -649,6 +706,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> MANGROVE_LOGS = create(key("mangrove_logs")); public static final TagKey<ItemType> MANGROVE_LOGS = create(key("mangrove_logs"));
/**
* {@code #minecraft:map_invisibility_equipment}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> MAP_INVISIBILITY_EQUIPMENT = create(key("map_invisibility_equipment"));
/** /**
* {@code #minecraft:meat} * {@code #minecraft:meat}
* *
@ -656,6 +720,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> MEAT = create(key("meat")); public static final TagKey<ItemType> MEAT = create(key("meat"));
/**
* {@code #minecraft:netherite_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> NETHERITE_TOOL_MATERIALS = create(key("netherite_tool_materials"));
/** /**
* {@code #minecraft:non_flammable_wood} * {@code #minecraft:non_flammable_wood}
* *
@ -684,6 +755,22 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> OCELOT_FOOD = create(key("ocelot_food")); public static final TagKey<ItemType> OCELOT_FOOD = create(key("ocelot_food"));
/**
* {@code #minecraft:pale_oak_logs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
public static final TagKey<ItemType> PALE_OAK_LOGS = create(key("pale_oak_logs"));
/**
* {@code #minecraft:panda_eats_from_ground}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PANDA_EATS_FROM_GROUND = create(key("panda_eats_from_ground"));
/** /**
* {@code #minecraft:panda_food} * {@code #minecraft:panda_food}
* *
@ -740,6 +827,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> PIGLIN_REPELLENTS = create(key("piglin_repellents")); public static final TagKey<ItemType> PIGLIN_REPELLENTS = create(key("piglin_repellents"));
/**
* {@code #minecraft:piglin_safe_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PIGLIN_SAFE_ARMOR = create(key("piglin_safe_armor"));
/** /**
* {@code #minecraft:planks} * {@code #minecraft:planks}
* *
@ -768,6 +862,62 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> REDSTONE_ORES = create(key("redstone_ores")); public static final TagKey<ItemType> REDSTONE_ORES = create(key("redstone_ores"));
/**
* {@code #minecraft:repairs_chain_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_CHAIN_ARMOR = create(key("repairs_chain_armor"));
/**
* {@code #minecraft:repairs_diamond_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_DIAMOND_ARMOR = create(key("repairs_diamond_armor"));
/**
* {@code #minecraft:repairs_gold_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_GOLD_ARMOR = create(key("repairs_gold_armor"));
/**
* {@code #minecraft:repairs_iron_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_IRON_ARMOR = create(key("repairs_iron_armor"));
/**
* {@code #minecraft:repairs_leather_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_LEATHER_ARMOR = create(key("repairs_leather_armor"));
/**
* {@code #minecraft:repairs_netherite_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_NETHERITE_ARMOR = create(key("repairs_netherite_armor"));
/**
* {@code #minecraft:repairs_turtle_helmet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_TURTLE_HELMET = create(key("repairs_turtle_helmet"));
/**
* {@code #minecraft:repairs_wolf_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_WOLF_ARMOR = create(key("repairs_wolf_armor"));
/** /**
* {@code #minecraft:sand} * {@code #minecraft:sand}
* *
@ -796,6 +946,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> SHOVELS = create(key("shovels")); public static final TagKey<ItemType> SHOVELS = create(key("shovels"));
/**
* {@code #minecraft:shulker_boxes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> SHULKER_BOXES = create(key("shulker_boxes"));
/** /**
* {@code #minecraft:signs} * {@code #minecraft:signs}
* *
@ -957,6 +1114,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> TURTLE_FOOD = create(key("turtle_food")); public static final TagKey<ItemType> TURTLE_FOOD = create(key("turtle_food"));
/**
* {@code #minecraft:villager_picks_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> VILLAGER_PICKS_UP = create(key("villager_picks_up"));
/** /**
* {@code #minecraft:villager_plantable_seeds} * {@code #minecraft:villager_plantable_seeds}
* *
@ -1034,6 +1198,13 @@ public final class ItemTypeTagKeys {
*/ */
public static final TagKey<ItemType> WOODEN_STAIRS = create(key("wooden_stairs")); public static final TagKey<ItemType> WOODEN_STAIRS = create(key("wooden_stairs"));
/**
* {@code #minecraft:wooden_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> WOODEN_TOOL_MATERIALS = create(key("wooden_tool_materials"));
/** /**
* {@code #minecraft:wooden_trapdoors} * {@code #minecraft:wooden_trapdoors}
* *

View File

@ -7,22 +7,25 @@ import io.papermc.generator.utils.TagCollector;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.List;
import java.util.Map; import java.util.Map;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import net.minecraft.commands.Commands; import net.minecraft.commands.Commands;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.LayeredRegistryAccess; import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess; import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.RegistryDataLoader; import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.server.Bootstrap; import net.minecraft.server.Bootstrap;
import net.minecraft.server.RegistryLayer; import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerResources; import net.minecraft.server.ReloadableServerResources;
import net.minecraft.server.WorldLoader;
import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.repository.Pack; import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackRepository; import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource; import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.MultiPackResourceManager; import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.flag.FeatureFlags;
import org.apache.commons.io.file.PathUtils; import org.apache.commons.io.file.PathUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -42,11 +45,22 @@ public final class Main {
resourceRepository.reload(); resourceRepository.reload();
final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList()); final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList());
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess(); LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES); final List<Registry.PendingTags<?>> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC));
final List<HolderLookup.RegistryLookup<?>> worldGenLayer = TagLoader.buildUpdatedLookups(layers.getAccessForLoading(RegistryLayer.WORLDGEN), pendingTags);
final RegistryAccess.Frozen frozenWorldgenRegistries = RegistryDataLoader.load(resourceManager, worldGenLayer, RegistryDataLoader.WORLDGEN_REGISTRIES);
layers = layers.replaceFrom(RegistryLayer.WORLDGEN, frozenWorldgenRegistries);
REGISTRY_ACCESS = layers.compositeAccess().freeze(); REGISTRY_ACCESS = layers.compositeAccess().freeze();
final ReloadableServerResources datapack = ReloadableServerResources.loadResources(resourceManager, layers, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join(); final ReloadableServerResources reloadableServerResources = ReloadableServerResources.loadResources(
datapack.updateRegistryTags(); resourceManager,
layers,
pendingTags,
FeatureFlags.VANILLA_SET,
Commands.CommandSelection.DEDICATED,
0,
MoreExecutors.directExecutor(),
MoreExecutors.directExecutor()
).join();
reloadableServerResources.updateStaticRegistryTags();
EXPERIMENTAL_TAGS = TagCollector.grabExperimental(resourceManager); EXPERIMENTAL_TAGS = TagCollector.grabExperimental(resourceManager);
} }

View File

@ -23,14 +23,19 @@ import java.util.IdentityHashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.lang.model.SourceVersion;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.core.RegistrySetBuilder; import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.registries.VanillaRegistries; import net.minecraft.data.registries.VanillaRegistries;
import net.minecraft.data.registries.WinterDropRegistries;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.world.flag.FeatureElement; import net.minecraft.world.flag.FeatureElement;
import net.minecraft.world.flag.FeatureFlags;
import org.bukkit.MinecraftExperimental;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier; import org.checkerframework.framework.qual.DefaultQualifier;
@ -51,7 +56,8 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream() private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap)); .collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap));
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = Collections.emptyMap(); // Update for Experimental API private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = WinterDropRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap)); // Update for Experimental API
private static final Map<RegistryKey<?>, String> REGISTRY_KEY_FIELD_NAMES; private static final Map<RegistryKey<?>, String> REGISTRY_KEY_FIELD_NAMES;
static { static {
@ -116,6 +122,13 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
); );
} }
@Deprecated
private static final Map<String, String> JUKEBOX_SONG_NAMES = Map.of(
"5", "FIVE",
"11", "ELEVEN",
"13", "THIRTEEN"
);
@Override @Override
protected TypeSpec getTypeSpec() { protected TypeSpec getTypeSpec() {
final TypeName typedKey = ParameterizedTypeName.get(TypedKey.class, this.apiType); final TypeName typedKey = ParameterizedTypeName.get(TypedKey.class, this.apiType);
@ -123,19 +136,23 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
final TypeSpec.Builder typeBuilder = this.keyHolderType(); final TypeSpec.Builder typeBuilder = this.keyHolderType();
final MethodSpec.Builder createMethod = this.createMethod(typedKey); final MethodSpec.Builder createMethod = this.createMethod(typedKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey); final Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
final Set<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry); final Set<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry);
boolean allExperimental = true; boolean allExperimental = true;
for (final Holder.Reference<T> reference : registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) { for (final Holder.Reference<T> reference : registry.listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) {
final ResourceKey<T> key = reference.key(); final ResourceKey<T> key = reference.key();
final String keyPath = key.location().getPath(); final String keyPath = key.location().getPath();
final String fieldName = Formatting.formatKeyAsField(keyPath); String fieldName = Formatting.formatKeyAsField(keyPath);
if (!SourceVersion.isIdentifier(fieldName) && this.registryKey.equals(Registries.JUKEBOX_SONG) && JUKEBOX_SONG_NAMES.containsKey(fieldName)) {
fieldName = JUKEBOX_SONG_NAMES.get(fieldName);
}
final FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL) final FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), keyPath) .initializer("$N(key($S))", createMethod.build(), keyPath)
.addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString()); .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString());
if (experimental.contains(key)) { if (experimental.contains(key)) {
fieldBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.WINTER_DROP)); // Update for Experimental API
} else { } else {
allExperimental = false; allExperimental = false;
} }
@ -150,6 +167,7 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
return typeBuilder.addMethod(createMethod.build()).build(); return typeBuilder.addMethod(createMethod.build()).build();
} }
// todo at some point this should be per feature data pack not all merged
private Set<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) { private Set<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) {
if (FeatureElement.FILTERED_REGISTRIES.contains(registry.key())) { if (FeatureElement.FILTERED_REGISTRIES.contains(registry.key())) {
return this.collectExperimentalKeysBuiltIn(registry); return this.collectExperimentalKeysBuiltIn(registry);
@ -159,8 +177,8 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
} }
private Set<ResourceKey<T>> collectExperimentalKeysBuiltIn(final Registry<T> registry) { private Set<ResourceKey<T>> collectExperimentalKeysBuiltIn(final Registry<T> registry) {
final HolderLookup.RegistryLookup<T> filteredLookup = registry.asLookup().filterElements(v -> { final HolderLookup.RegistryLookup<T> filteredLookup = registry.filterElements(v -> {
return false; // Update for Experimental API return v instanceof final FeatureElement featureElement && FeatureFlags.isExperimental(featureElement.requiredFeatures()); // Update for Experimental API
}); });
return filteredLookup.listElementIds().collect(Collectors.toUnmodifiableSet()); return filteredLookup.listElementIds().collect(Collectors.toUnmodifiableSet());
} }

View File

@ -16,6 +16,7 @@ import io.papermc.paper.registry.tag.TagKey;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
@ -105,16 +106,17 @@ public class GeneratedTagKeyType<T, A> extends SimpleGenerator {
final TypeSpec.Builder typeBuilder = this.keyHolderType(); final TypeSpec.Builder typeBuilder = this.keyHolderType();
final MethodSpec.Builder createMethod = this.createMethod(tagKey); final MethodSpec.Builder createMethod = this.createMethod(tagKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey); final Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
final AtomicBoolean allExperimental = new AtomicBoolean(true); final AtomicBoolean allExperimental = new AtomicBoolean(true);
registry.getTagNames().sorted(Formatting.alphabeticKeyOrder(nmsTagKey -> nmsTagKey.location().getPath())).forEach(nmsTagKey -> { registry.listTagIds().sorted(Formatting.alphabeticKeyOrder(nmsTagKey -> nmsTagKey.location().getPath())).forEach(nmsTagKey -> {
final String fieldName = Formatting.formatKeyAsField(nmsTagKey.location().getPath()); final String fieldName = Formatting.formatKeyAsField(nmsTagKey.location().getPath());
final FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKey, fieldName, PUBLIC, STATIC, FINAL) final FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), nmsTagKey.location().getPath()) .initializer("$N(key($S))", createMethod.build(), nmsTagKey.location().getPath())
.addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), "#" + nmsTagKey.location()); .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), "#" + nmsTagKey.location());
if (Main.EXPERIMENTAL_TAGS.containsKey(nmsTagKey)) { final String featureFlagName = Main.EXPERIMENTAL_TAGS.get(nmsTagKey);
fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.TRADE_REBALANCE)); // Update for Experimental API if (featureFlagName != null) {
fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.valueOf(featureFlagName.toUpperCase(Locale.ENGLISH)))); // Update for Experimental API
} else { } else {
allExperimental.set(false); allExperimental.set(false);
} }

View File

@ -31,5 +31,4 @@ public abstract class SimpleGenerator implements SourceGenerator {
builder.build().writeTo(parent, StandardCharsets.UTF_8); builder.build().writeTo(parent, StandardCharsets.UTF_8);
} }
} }

View File

@ -1,6 +1,5 @@
package io.papermc.generator.types.goal; package io.papermc.generator.types.goal;
import com.destroystokyo.paper.entity.RangedEntity;
import com.destroystokyo.paper.entity.ai.GoalKey; import com.destroystokyo.paper.entity.ai.GoalKey;
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.FieldSpec;
@ -19,44 +18,10 @@ import io.papermc.generator.utils.Formatting;
import io.papermc.generator.utils.Javadocs; import io.papermc.generator.utils.Javadocs;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import javax.lang.model.element.Modifier;
import net.minecraft.world.entity.ai.goal.Goal; import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.WrappedGoal; import net.minecraft.world.entity.ai.goal.WrappedGoal;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.Blaze;
import org.bukkit.entity.Cat;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Dolphin;
import org.bukkit.entity.Drowned;
import org.bukkit.entity.Enderman;
import org.bukkit.entity.Evoker;
import org.bukkit.entity.Fish;
import org.bukkit.entity.Fox;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Llama;
import org.bukkit.entity.Mob; import org.bukkit.entity.Mob;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Panda;
import org.bukkit.entity.Parrot;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.PolarBear;
import org.bukkit.entity.Rabbit;
import org.bukkit.entity.Raider;
import org.bukkit.entity.Ravager;
import org.bukkit.entity.Shulker;
import org.bukkit.entity.Silverfish;
import org.bukkit.entity.SkeletonHorse;
import org.bukkit.entity.Slime;
import org.bukkit.entity.Spellcaster;
import org.bukkit.entity.Spider;
import org.bukkit.entity.Squid;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.TraderLlama;
import org.bukkit.entity.Turtle;
import org.bukkit.entity.Vex;
import org.bukkit.entity.Vindicator;
import org.bukkit.entity.WanderingTrader;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier; import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -134,10 +99,4 @@ public class MobGoalGenerator extends SimpleGenerator {
protected JavaFile.Builder file(JavaFile.Builder builder) { protected JavaFile.Builder file(JavaFile.Builder builder) {
return builder; return builder;
} }
record DeprecatedEntry(Class<?> entity, String entryName, @Nullable String removalVersion,
@Nullable String removedVersion) {
}
} }

View File

@ -236,6 +236,9 @@ public class MobGoalNames {
bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, org.bukkit.entity.Breeze.class); bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, org.bukkit.entity.Breeze.class);
bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class); bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class);
bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class); bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class);
bukkitMap.put(net.minecraft.world.entity.monster.creaking.Creaking.class, org.bukkit.entity.Creaking.class);
bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, org.bukkit.entity.CreakingTransient.class);
bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, org.bukkit.entity.Squid.class); // close enough
//</editor-fold> //</editor-fold>
} }
@ -268,6 +271,7 @@ public class MobGoalNames {
name = cut; name = cut;
} }
} }
name = name.replace("PathfinderGoal", ""); name = name.replace("PathfinderGoal", "");
name = name.replace("TargetGoal", ""); name = name.replace("TargetGoal", "");
name = name.replace("Goal", ""); name = name.replace("Goal", "");

View File

@ -18,11 +18,11 @@ public record CollectingContext<T>(Set<ResourceKey<T>> registered,
@Override @Override
public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) { public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) {
this.registered.add(resourceKey); this.registered.add(resourceKey);
return Holder.Reference.createStandAlone(this.registry.holderOwner(), resourceKey); return Holder.Reference.createStandAlone(this.registry, resourceKey);
} }
@Override @Override
public <S> HolderGetter<S> lookup(final ResourceKey<? extends Registry<? extends S>> resourceKey) { public <S> HolderGetter<S> lookup(final ResourceKey<? extends Registry<? extends S>> resourceKey) {
return Main.REGISTRY_ACCESS.registryOrThrow(resourceKey).asLookup(); return Main.REGISTRY_ACCESS.lookupOrThrow(resourceKey);
} }
} }

View File

@ -1,6 +1,5 @@
package io.papermc.generator.utils; package io.papermc.generator.utils;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import java.util.Comparator; import java.util.Comparator;
@ -13,13 +12,8 @@ public final class Formatting {
private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]"); private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]");
private static final Map<String, String> MANUAL_OVERRIDES = Map.of(
"5", "five",
"11", "eleven",
"13", "thirteen"
);
public static String formatKeyAsField(String path) { public static String formatKeyAsField(String path) {
return ILLEGAL_FIELD_CHARACTERS.matcher(MANUAL_OVERRIDES.getOrDefault(path, path).toUpperCase(Locale.ROOT)).replaceAll("_"); return ILLEGAL_FIELD_CHARACTERS.matcher(path.toUpperCase(Locale.ROOT)).replaceAll("_");
} }
public static Optional<String> formatTagKey(String tagDir, String resourcePath) { public static Optional<String> formatTagKey(String tagDir, String resourcePath) {

View File

@ -47,7 +47,7 @@ public final class TagCollector {
return; return;
} }
result.put(entry.value().getTagNames() result.put(entry.value().listTagIds()
.filter(tagKey -> tagKey.location().getPath().equals(path)) .filter(tagKey -> tagKey.location().getPath().equals(path))
.findFirst() .findFirst()
.orElseThrow(), packId); .orElseThrow(), packId);

View File

@ -3,5 +3,6 @@ public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/serve
# for auto-marking experimental stuff # for auto-marking experimental stuff
public net/minecraft/core/RegistrySetBuilder entries public net/minecraft/core/RegistrySetBuilder entries
public net/minecraft/core/RegistrySetBuilder$RegistryStub public net/minecraft/core/RegistrySetBuilder$RegistryStub
public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER
public net/minecraft/data/registries/VanillaRegistries BUILDER public net/minecraft/data/registries/VanillaRegistries BUILDER
public net/minecraft/data/registries/WinterDropRegistries BUILDER
public net/minecraft/data/registries/TradeRebalanceRegistries BUILDER

View File

@ -366,13 +366,17 @@ index 0000000000000000000000000000000000000000..99375deaa6b90b33cd6a77e0df651236
+record TypedKeyImpl<T>(Key key, RegistryKey<T> registryKey) implements TypedKey<T> { +record TypedKeyImpl<T>(Key key, RegistryKey<T> registryKey) implements TypedKey<T> {
+} +}
diff --git a/src/main/java/org/bukkit/MinecraftExperimental.java b/src/main/java/org/bukkit/MinecraftExperimental.java diff --git a/src/main/java/org/bukkit/MinecraftExperimental.java b/src/main/java/org/bukkit/MinecraftExperimental.java
index b7845523e8587e13b86516c0012fe097d904846c..765a691f5b4f91425bb3057ceb4bbff06c6df1e8 100644 index b7845523e8587e13b86516c0012fe097d904846c..d92a75f610cb2a95203b3f22dc67bdbfb5c3405a 100644
--- a/src/main/java/org/bukkit/MinecraftExperimental.java --- a/src/main/java/org/bukkit/MinecraftExperimental.java
+++ b/src/main/java/org/bukkit/MinecraftExperimental.java +++ b/src/main/java/org/bukkit/MinecraftExperimental.java
@@ -48,5 +48,6 @@ public @interface MinecraftExperimental { @@ -48,5 +48,10 @@ public @interface MinecraftExperimental {
public enum Requires { public enum Requires {
WINTER_DROP, WINTER_DROP,
+ TRADE_REBALANCE // Paper + // Paper start
+ TRADE_REBALANCE,
+ REDSTONE_EXPERIMENTS,
+ MINECART_IMPROVEMENTS
+ // Paper end
} }
} }

View File

@ -30,6 +30,19 @@ index a96600443a0997c3a696a637422ab66ee1884fb0..20eb27ee041f77f295eb271f878c524c
public static final FeatureFlag MINECART_IMPROVEMENTS = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("minecart_improvements")); public static final FeatureFlag MINECART_IMPROVEMENTS = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("minecart_improvements"));
} }
diff --git a/src/main/java/org/bukkit/GameRule.java b/src/main/java/org/bukkit/GameRule.java
index 8b6584fae0a9d5cccbe350d889fa8b4a14c78ca3..89f1820ae94c48f51a44df750904bb285013720c 100644
--- a/src/main/java/org/bukkit/GameRule.java
+++ b/src/main/java/org/bukkit/GameRule.java
@@ -287,6 +287,8 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
* The maximum speed of minecarts (when the new movement algorithm is
* enabled).
*/
+ @MinecraftExperimental(MinecraftExperimental.Requires.MINECART_IMPROVEMENTS) // Paper - add missing annotation
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final GameRule<Integer> MINECART_MAX_SPEED = new GameRule<>("minecartMaxSpeed", Integer.class);
/**
diff --git a/src/main/java/org/bukkit/block/Crafter.java b/src/main/java/org/bukkit/block/Crafter.java diff --git a/src/main/java/org/bukkit/block/Crafter.java b/src/main/java/org/bukkit/block/Crafter.java
index 8d2dd78fc588a6817dfede8040b9909a7d5bde67..f737a2aae3f57a1bfe4cf68ea66f603da4eebd47 100644 index 8d2dd78fc588a6817dfede8040b9909a7d5bde67..f737a2aae3f57a1bfe4cf68ea66f603da4eebd47 100644
--- a/src/main/java/org/bukkit/block/Crafter.java --- a/src/main/java/org/bukkit/block/Crafter.java

View File

@ -18,10 +18,10 @@ index da2f9c5afb2994f403a1128af0f7acbd6b73b862..38585b7f0b8e1e287b37820924a1b0d4
testImplementation("org.hamcrest:hamcrest:2.2") testImplementation("org.hamcrest:hamcrest:2.2")
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd853df055f index 0000000000000000000000000000000000000000..05e793e722bbb367ca64cd7f26156fa3dabb8474
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
@@ -0,0 +1,377 @@ @@ -0,0 +1,380 @@
+package com.destroystokyo.paper.entity.ai; +package com.destroystokyo.paper.entity.ai;
+ +
+import com.destroystokyo.paper.entity.RangedEntity; +import com.destroystokyo.paper.entity.RangedEntity;
@ -271,6 +271,9 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8
+ bukkitMap.put(Breeze.class, org.bukkit.entity.Breeze.class); + bukkitMap.put(Breeze.class, org.bukkit.entity.Breeze.class);
+ bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class); + bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class);
+ bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class); + bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class);
+ bukkitMap.put(net.minecraft.world.entity.monster.creaking.Creaking.class, org.bukkit.entity.Creaking.class);
+ bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, org.bukkit.entity.CreakingTransient.class);
+ bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, org.bukkit.entity.Squid.class); // close enough
+ } + }
+ +
+ public static String getUsableName(Class<?> clazz) { + public static String getUsableName(Class<?> clazz) {

View File

@ -45,7 +45,7 @@ Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
Co-authored-by: TotalledZebra <Holappa57@gmail.com> Co-authored-by: TotalledZebra <Holappa57@gmail.com>
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
index c99eafab2103c7f5bca7ffba68a10bd853df055f..f7241c5292f1c012404eea11256813fbc2c2df1a 100644 index 05e793e722bbb367ca64cd7f26156fa3dabb8474..3470720466fc81f977c18e3a97bb918926025a22 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java --- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
@@ -164,7 +164,7 @@ public class MobGoalHelper { @@ -164,7 +164,7 @@ public class MobGoalHelper {