port some generator fixes

- fix a regression for minecart entity type's class
- stable alphanumeric order for fields and data holder fields for CraftBlockData
- properly register bed and conduit block entity metas
This commit is contained in:
Lulu13022002
2025-06-10 17:04:49 +02:00
parent 7e68259ce9
commit 8d5be7ed9f
23 changed files with 447 additions and 437 deletions

View File

@@ -2972,321 +2972,6 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> DIRT_PATH = create(key("dirt_path")); public static final TypedKey<ItemType> DIRT_PATH = create(key("dirt_path"));
/**
* {@code minecraft:dragon_breath}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DRAGON_BREATH = create(key("dragon_breath"));
/**
* {@code minecraft:dragon_head}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DRAGON_HEAD = create(key("dragon_head"));
/**
* {@code minecraft:enchanted_book}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENCHANTED_BOOK = create(key("enchanted_book"));
/**
* {@code minecraft:end_crystal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> END_CRYSTAL = create(key("end_crystal"));
/**
* {@code minecraft:ender_dragon_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDER_DRAGON_SPAWN_EGG = create(key("ender_dragon_spawn_egg"));
/**
* {@code minecraft:enderman_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDERMAN_SPAWN_EGG = create(key("enderman_spawn_egg"));
/**
* {@code minecraft:endermite_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDERMITE_SPAWN_EGG = create(key("endermite_spawn_egg"));
/**
* {@code minecraft:evoker_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> EVOKER_SPAWN_EGG = create(key("evoker_spawn_egg"));
/**
* {@code minecraft:experience_bottle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> EXPERIENCE_BOTTLE = create(key("experience_bottle"));
/**
* {@code minecraft:fire_charge}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIRE_CHARGE = create(key("fire_charge"));
/**
* {@code minecraft:firework_rocket}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIREWORK_ROCKET = create(key("firework_rocket"));
/**
* {@code minecraft:firework_star}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIREWORK_STAR = create(key("firework_star"));
/**
* {@code minecraft:flow_banner_pattern}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FLOW_BANNER_PATTERN = create(key("flow_banner_pattern"));
/**
* {@code minecraft:flower_pot}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FLOWER_POT = create(key("flower_pot"));
/**
* {@code minecraft:fox_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FOX_SPAWN_EGG = create(key("fox_spawn_egg"));
/**
* {@code minecraft:frog_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FROG_SPAWN_EGG = create(key("frog_spawn_egg"));
/**
* {@code minecraft:ghast_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GHAST_SPAWN_EGG = create(key("ghast_spawn_egg"));
/**
* {@code minecraft:glow_item_frame}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GLOW_ITEM_FRAME = create(key("glow_item_frame"));
/**
* {@code minecraft:glow_squid_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GLOW_SQUID_SPAWN_EGG = create(key("glow_squid_spawn_egg"));
/**
* {@code minecraft:goat_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOAT_SPAWN_EGG = create(key("goat_spawn_egg"));
/**
* {@code minecraft:golden_carrot}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_CARROT = create(key("golden_carrot"));
/**
* {@code minecraft:golden_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_HORSE_ARMOR = create(key("golden_horse_armor"));
/**
* {@code minecraft:gray_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GRAY_BANNER = create(key("gray_banner"));
/**
* {@code minecraft:green_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GREEN_BANNER = create(key("green_banner"));
/**
* {@code minecraft:guardian_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GUARDIAN_SPAWN_EGG = create(key("guardian_spawn_egg"));
/**
* {@code minecraft:happy_ghast_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HAPPY_GHAST_SPAWN_EGG = create(key("happy_ghast_spawn_egg"));
/**
* {@code minecraft:hoglin_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HOGLIN_SPAWN_EGG = create(key("hoglin_spawn_egg"));
/**
* {@code minecraft:horse_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HORSE_SPAWN_EGG = create(key("horse_spawn_egg"));
/**
* {@code minecraft:husk_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HUSK_SPAWN_EGG = create(key("husk_spawn_egg"));
/**
* {@code minecraft:iron_golem_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_GOLEM_SPAWN_EGG = create(key("iron_golem_spawn_egg"));
/**
* {@code minecraft:iron_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_HORSE_ARMOR = create(key("iron_horse_armor"));
/**
* {@code minecraft:item_frame}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ITEM_FRAME = create(key("item_frame"));
/**
* {@code minecraft:lead}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LEAD = create(key("lead"));
/**
* {@code minecraft:leather_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LEATHER_HORSE_ARMOR = create(key("leather_horse_armor"));
/**
* {@code minecraft:light_blue_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIGHT_BLUE_BANNER = create(key("light_blue_banner"));
/**
* {@code minecraft:light_gray_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIGHT_GRAY_BANNER = create(key("light_gray_banner"));
/**
* {@code minecraft:lime_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIME_BANNER = create(key("lime_banner"));
/**
* {@code minecraft:llama_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LLAMA_SPAWN_EGG = create(key("llama_spawn_egg"));
/**
* {@code minecraft:mace}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MACE = create(key("mace"));
/**
* {@code minecraft:magenta_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAGENTA_BANNER = create(key("magenta_banner"));
/**
* {@code minecraft:magma_cube_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAGMA_CUBE_SPAWN_EGG = create(key("magma_cube_spawn_egg"));
/**
* {@code minecraft:map}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAP = create(key("map"));
/**
* {@code minecraft:mooshroom_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MOOSHROOM_SPAWN_EGG = create(key("mooshroom_spawn_egg"));
/**
* {@code minecraft:mule_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MULE_SPAWN_EGG = create(key("mule_spawn_egg"));
/**
* {@code minecraft:music_disc_5}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MUSIC_DISC_5 = create(key("music_disc_5"));
/** /**
* {@code minecraft:disc_fragment_5} * {@code minecraft:disc_fragment_5}
* *
@@ -3315,6 +3000,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> DONKEY_SPAWN_EGG = create(key("donkey_spawn_egg")); public static final TypedKey<ItemType> DONKEY_SPAWN_EGG = create(key("donkey_spawn_egg"));
/**
* {@code minecraft:dragon_breath}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DRAGON_BREATH = create(key("dragon_breath"));
/** /**
* {@code minecraft:dragon_egg} * {@code minecraft:dragon_egg}
* *
@@ -3322,6 +3014,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> DRAGON_EGG = create(key("dragon_egg")); public static final TypedKey<ItemType> DRAGON_EGG = create(key("dragon_egg"));
/**
* {@code minecraft:dragon_head}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DRAGON_HEAD = create(key("dragon_head"));
/** /**
* {@code minecraft:dried_ghast} * {@code minecraft:dried_ghast}
* *
@@ -3420,6 +3119,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> EMERALD_ORE = create(key("emerald_ore")); public static final TypedKey<ItemType> EMERALD_ORE = create(key("emerald_ore"));
/**
* {@code minecraft:enchanted_book}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENCHANTED_BOOK = create(key("enchanted_book"));
/** /**
* {@code minecraft:enchanted_golden_apple} * {@code minecraft:enchanted_golden_apple}
* *
@@ -3434,6 +3140,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> ENCHANTING_TABLE = create(key("enchanting_table")); public static final TypedKey<ItemType> ENCHANTING_TABLE = create(key("enchanting_table"));
/**
* {@code minecraft:end_crystal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> END_CRYSTAL = create(key("end_crystal"));
/** /**
* {@code minecraft:end_portal_frame} * {@code minecraft:end_portal_frame}
* *
@@ -3490,6 +3203,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> ENDER_CHEST = create(key("ender_chest")); public static final TypedKey<ItemType> ENDER_CHEST = create(key("ender_chest"));
/**
* {@code minecraft:ender_dragon_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDER_DRAGON_SPAWN_EGG = create(key("ender_dragon_spawn_egg"));
/** /**
* {@code minecraft:ender_eye} * {@code minecraft:ender_eye}
* *
@@ -3504,6 +3224,34 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> ENDER_PEARL = create(key("ender_pearl")); public static final TypedKey<ItemType> ENDER_PEARL = create(key("ender_pearl"));
/**
* {@code minecraft:enderman_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDERMAN_SPAWN_EGG = create(key("enderman_spawn_egg"));
/**
* {@code minecraft:endermite_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ENDERMITE_SPAWN_EGG = create(key("endermite_spawn_egg"));
/**
* {@code minecraft:evoker_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> EVOKER_SPAWN_EGG = create(key("evoker_spawn_egg"));
/**
* {@code minecraft:experience_bottle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> EXPERIENCE_BOTTLE = create(key("experience_bottle"));
/** /**
* {@code minecraft:explorer_pottery_sherd} * {@code minecraft:explorer_pottery_sherd}
* *
@@ -3623,6 +3371,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FILLED_MAP = create(key("filled_map")); public static final TypedKey<ItemType> FILLED_MAP = create(key("filled_map"));
/**
* {@code minecraft:fire_charge}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIRE_CHARGE = create(key("fire_charge"));
/** /**
* {@code minecraft:fire_coral} * {@code minecraft:fire_coral}
* *
@@ -3651,6 +3406,20 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FIREFLY_BUSH = create(key("firefly_bush")); public static final TypedKey<ItemType> FIREFLY_BUSH = create(key("firefly_bush"));
/**
* {@code minecraft:firework_rocket}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIREWORK_ROCKET = create(key("firework_rocket"));
/**
* {@code minecraft:firework_star}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FIREWORK_STAR = create(key("firework_star"));
/** /**
* {@code minecraft:fishing_rod} * {@code minecraft:fishing_rod}
* *
@@ -3686,6 +3455,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FLOW_ARMOR_TRIM_SMITHING_TEMPLATE = create(key("flow_armor_trim_smithing_template")); public static final TypedKey<ItemType> FLOW_ARMOR_TRIM_SMITHING_TEMPLATE = create(key("flow_armor_trim_smithing_template"));
/**
* {@code minecraft:flow_banner_pattern}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FLOW_BANNER_PATTERN = create(key("flow_banner_pattern"));
/** /**
* {@code minecraft:flow_pottery_sherd} * {@code minecraft:flow_pottery_sherd}
* *
@@ -3700,6 +3476,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FLOWER_BANNER_PATTERN = create(key("flower_banner_pattern")); public static final TypedKey<ItemType> FLOWER_BANNER_PATTERN = create(key("flower_banner_pattern"));
/**
* {@code minecraft:flower_pot}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FLOWER_POT = create(key("flower_pot"));
/** /**
* {@code minecraft:flowering_azalea} * {@code minecraft:flowering_azalea}
* *
@@ -3714,6 +3497,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FLOWERING_AZALEA_LEAVES = create(key("flowering_azalea_leaves")); public static final TypedKey<ItemType> FLOWERING_AZALEA_LEAVES = create(key("flowering_azalea_leaves"));
/**
* {@code minecraft:fox_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FOX_SPAWN_EGG = create(key("fox_spawn_egg"));
/** /**
* {@code minecraft:friend_pottery_sherd} * {@code minecraft:friend_pottery_sherd}
* *
@@ -3721,6 +3511,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FRIEND_POTTERY_SHERD = create(key("friend_pottery_sherd")); public static final TypedKey<ItemType> FRIEND_POTTERY_SHERD = create(key("friend_pottery_sherd"));
/**
* {@code minecraft:frog_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> FROG_SPAWN_EGG = create(key("frog_spawn_egg"));
/** /**
* {@code minecraft:frogspawn} * {@code minecraft:frogspawn}
* *
@@ -3742,6 +3539,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> FURNACE_MINECART = create(key("furnace_minecart")); public static final TypedKey<ItemType> FURNACE_MINECART = create(key("furnace_minecart"));
/**
* {@code minecraft:ghast_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GHAST_SPAWN_EGG = create(key("ghast_spawn_egg"));
/** /**
* {@code minecraft:ghast_tear} * {@code minecraft:ghast_tear}
* *
@@ -3805,6 +3609,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GLOW_INK_SAC = create(key("glow_ink_sac")); public static final TypedKey<ItemType> GLOW_INK_SAC = create(key("glow_ink_sac"));
/**
* {@code minecraft:glow_item_frame}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GLOW_ITEM_FRAME = create(key("glow_item_frame"));
/** /**
* {@code minecraft:glow_lichen} * {@code minecraft:glow_lichen}
* *
@@ -3812,6 +3623,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GLOW_LICHEN = create(key("glow_lichen")); public static final TypedKey<ItemType> GLOW_LICHEN = create(key("glow_lichen"));
/**
* {@code minecraft:glow_squid_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GLOW_SQUID_SPAWN_EGG = create(key("glow_squid_spawn_egg"));
/** /**
* {@code minecraft:glowstone} * {@code minecraft:glowstone}
* *
@@ -3833,6 +3651,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GOAT_HORN = create(key("goat_horn")); public static final TypedKey<ItemType> GOAT_HORN = create(key("goat_horn"));
/**
* {@code minecraft:goat_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOAT_SPAWN_EGG = create(key("goat_spawn_egg"));
/** /**
* {@code minecraft:gold_block} * {@code minecraft:gold_block}
* *
@@ -3882,6 +3707,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GOLDEN_BOOTS = create(key("golden_boots")); public static final TypedKey<ItemType> GOLDEN_BOOTS = create(key("golden_boots"));
/**
* {@code minecraft:golden_carrot}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_CARROT = create(key("golden_carrot"));
/** /**
* {@code minecraft:golden_chestplate} * {@code minecraft:golden_chestplate}
* *
@@ -3903,6 +3735,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GOLDEN_HOE = create(key("golden_hoe")); public static final TypedKey<ItemType> GOLDEN_HOE = create(key("golden_hoe"));
/**
* {@code minecraft:golden_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_HORSE_ARMOR = create(key("golden_horse_armor"));
/** /**
* {@code minecraft:golden_leggings} * {@code minecraft:golden_leggings}
* *
@@ -3973,6 +3812,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GRAVEL = create(key("gravel")); public static final TypedKey<ItemType> GRAVEL = create(key("gravel"));
/**
* {@code minecraft:gray_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GRAY_BANNER = create(key("gray_banner"));
/** /**
* {@code minecraft:gray_bed} * {@code minecraft:gray_bed}
* *
@@ -4071,6 +3917,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GRAY_WOOL = create(key("gray_wool")); public static final TypedKey<ItemType> GRAY_WOOL = create(key("gray_wool"));
/**
* {@code minecraft:green_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GREEN_BANNER = create(key("green_banner"));
/** /**
* {@code minecraft:green_bed} * {@code minecraft:green_bed}
* *
@@ -4176,6 +4029,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> GRINDSTONE = create(key("grindstone")); public static final TypedKey<ItemType> GRINDSTONE = create(key("grindstone"));
/**
* {@code minecraft:guardian_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GUARDIAN_SPAWN_EGG = create(key("guardian_spawn_egg"));
/** /**
* {@code minecraft:gunpowder} * {@code minecraft:gunpowder}
* *
@@ -4204,6 +4064,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> HANGING_ROOTS = create(key("hanging_roots")); public static final TypedKey<ItemType> HANGING_ROOTS = create(key("hanging_roots"));
/**
* {@code minecraft:happy_ghast_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HAPPY_GHAST_SPAWN_EGG = create(key("happy_ghast_spawn_egg"));
/** /**
* {@code minecraft:hay_block} * {@code minecraft:hay_block}
* *
@@ -4246,6 +4113,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> HEAVY_WEIGHTED_PRESSURE_PLATE = create(key("heavy_weighted_pressure_plate")); public static final TypedKey<ItemType> HEAVY_WEIGHTED_PRESSURE_PLATE = create(key("heavy_weighted_pressure_plate"));
/**
* {@code minecraft:hoglin_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HOGLIN_SPAWN_EGG = create(key("hoglin_spawn_egg"));
/** /**
* {@code minecraft:honey_block} * {@code minecraft:honey_block}
* *
@@ -4309,6 +4183,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> HORN_CORAL_FAN = create(key("horn_coral_fan")); public static final TypedKey<ItemType> HORN_CORAL_FAN = create(key("horn_coral_fan"));
/**
* {@code minecraft:horse_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HORSE_SPAWN_EGG = create(key("horse_spawn_egg"));
/** /**
* {@code minecraft:host_armor_trim_smithing_template} * {@code minecraft:host_armor_trim_smithing_template}
* *
@@ -4323,6 +4204,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> HOWL_POTTERY_SHERD = create(key("howl_pottery_sherd")); public static final TypedKey<ItemType> HOWL_POTTERY_SHERD = create(key("howl_pottery_sherd"));
/**
* {@code minecraft:husk_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> HUSK_SPAWN_EGG = create(key("husk_spawn_egg"));
/** /**
* {@code minecraft:ice} * {@code minecraft:ice}
* *
@@ -4428,6 +4316,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> IRON_DOOR = create(key("iron_door")); public static final TypedKey<ItemType> IRON_DOOR = create(key("iron_door"));
/**
* {@code minecraft:iron_golem_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_GOLEM_SPAWN_EGG = create(key("iron_golem_spawn_egg"));
/** /**
* {@code minecraft:iron_helmet} * {@code minecraft:iron_helmet}
* *
@@ -4442,6 +4337,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> IRON_HOE = create(key("iron_hoe")); public static final TypedKey<ItemType> IRON_HOE = create(key("iron_hoe"));
/**
* {@code minecraft:iron_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_HORSE_ARMOR = create(key("iron_horse_armor"));
/** /**
* {@code minecraft:iron_ingot} * {@code minecraft:iron_ingot}
* *
@@ -4498,6 +4400,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> IRON_TRAPDOOR = create(key("iron_trapdoor")); public static final TypedKey<ItemType> IRON_TRAPDOOR = create(key("iron_trapdoor"));
/**
* {@code minecraft:item_frame}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ITEM_FRAME = create(key("item_frame"));
/** /**
* {@code minecraft:jack_o_lantern} * {@code minecraft:jack_o_lantern}
* *
@@ -4708,6 +4617,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LAVA_BUCKET = create(key("lava_bucket")); public static final TypedKey<ItemType> LAVA_BUCKET = create(key("lava_bucket"));
/**
* {@code minecraft:lead}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LEAD = create(key("lead"));
/** /**
* {@code minecraft:leaf_litter} * {@code minecraft:leaf_litter}
* *
@@ -4743,6 +4659,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LEATHER_HELMET = create(key("leather_helmet")); public static final TypedKey<ItemType> LEATHER_HELMET = create(key("leather_helmet"));
/**
* {@code minecraft:leather_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LEATHER_HORSE_ARMOR = create(key("leather_horse_armor"));
/** /**
* {@code minecraft:leather_leggings} * {@code minecraft:leather_leggings}
* *
@@ -4771,6 +4694,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LIGHT = create(key("light")); public static final TypedKey<ItemType> LIGHT = create(key("light"));
/**
* {@code minecraft:light_blue_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIGHT_BLUE_BANNER = create(key("light_blue_banner"));
/** /**
* {@code minecraft:light_blue_bed} * {@code minecraft:light_blue_bed}
* *
@@ -4869,6 +4799,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LIGHT_BLUE_WOOL = create(key("light_blue_wool")); public static final TypedKey<ItemType> LIGHT_BLUE_WOOL = create(key("light_blue_wool"));
/**
* {@code minecraft:light_gray_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIGHT_GRAY_BANNER = create(key("light_gray_banner"));
/** /**
* {@code minecraft:light_gray_bed} * {@code minecraft:light_gray_bed}
* *
@@ -5002,6 +4939,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LILY_PAD = create(key("lily_pad")); public static final TypedKey<ItemType> LILY_PAD = create(key("lily_pad"));
/**
* {@code minecraft:lime_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LIME_BANNER = create(key("lime_banner"));
/** /**
* {@code minecraft:lime_bed} * {@code minecraft:lime_bed}
* *
@@ -5107,6 +5051,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LINGERING_POTION = create(key("lingering_potion")); public static final TypedKey<ItemType> LINGERING_POTION = create(key("lingering_potion"));
/**
* {@code minecraft:llama_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> LLAMA_SPAWN_EGG = create(key("llama_spawn_egg"));
/** /**
* {@code minecraft:lodestone} * {@code minecraft:lodestone}
* *
@@ -5121,6 +5072,20 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> LOOM = create(key("loom")); public static final TypedKey<ItemType> LOOM = create(key("loom"));
/**
* {@code minecraft:mace}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MACE = create(key("mace"));
/**
* {@code minecraft:magenta_banner}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAGENTA_BANNER = create(key("magenta_banner"));
/** /**
* {@code minecraft:magenta_bed} * {@code minecraft:magenta_bed}
* *
@@ -5233,6 +5198,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> MAGMA_CREAM = create(key("magma_cream")); public static final TypedKey<ItemType> MAGMA_CREAM = create(key("magma_cream"));
/**
* {@code minecraft:magma_cube_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAGMA_CUBE_SPAWN_EGG = create(key("magma_cube_spawn_egg"));
/** /**
* {@code minecraft:mangrove_boat} * {@code minecraft:mangrove_boat}
* *
@@ -5359,6 +5331,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> MANGROVE_WOOD = create(key("mangrove_wood")); public static final TypedKey<ItemType> MANGROVE_WOOD = create(key("mangrove_wood"));
/**
* {@code minecraft:map}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MAP = create(key("map"));
/** /**
* {@code minecraft:medium_amethyst_bud} * {@code minecraft:medium_amethyst_bud}
* *
@@ -5415,6 +5394,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> MOJANG_BANNER_PATTERN = create(key("mojang_banner_pattern")); public static final TypedKey<ItemType> MOJANG_BANNER_PATTERN = create(key("mojang_banner_pattern"));
/**
* {@code minecraft:mooshroom_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MOOSHROOM_SPAWN_EGG = create(key("mooshroom_spawn_egg"));
/** /**
* {@code minecraft:moss_block} * {@code minecraft:moss_block}
* *
@@ -5534,6 +5520,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> MUDDY_MANGROVE_ROOTS = create(key("muddy_mangrove_roots")); public static final TypedKey<ItemType> MUDDY_MANGROVE_ROOTS = create(key("muddy_mangrove_roots"));
/**
* {@code minecraft:mule_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MULE_SPAWN_EGG = create(key("mule_spawn_egg"));
/** /**
* {@code minecraft:mushroom_stem} * {@code minecraft:mushroom_stem}
* *
@@ -5548,6 +5541,13 @@ public final class ItemTypeKeys {
*/ */
public static final TypedKey<ItemType> MUSHROOM_STEW = create(key("mushroom_stew")); public static final TypedKey<ItemType> MUSHROOM_STEW = create(key("mushroom_stew"));
/**
* {@code minecraft:music_disc_5}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> MUSIC_DISC_5 = create(key("music_disc_5"));
/** /**
* {@code minecraft:music_disc_11} * {@code minecraft:music_disc_11}
* *

View File

@@ -262,92 +262,70 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
DIAMOND_PICKAXE(-1, 1), DIAMOND_PICKAXE(-1, 1),
DIAMOND_SHOVEL(-1, 1), DIAMOND_SHOVEL(-1, 1),
DIAMOND_SWORD(-1, 1), DIAMOND_SWORD(-1, 1),
DISC_FRAGMENT_5(-1),
DOLPHIN_SPAWN_EGG(-1), DOLPHIN_SPAWN_EGG(-1),
DONKEY_SPAWN_EGG(-1), DONKEY_SPAWN_EGG(-1),
DRAGON_BREATH(-1), DRAGON_BREATH(-1),
DRIED_KELP(-1),
DROWNED_SPAWN_EGG(-1), DROWNED_SPAWN_EGG(-1),
DUNE_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
ECHO_SHARD(-1),
EGG(-1, 16),
ELDER_GUARDIAN_SPAWN_EGG(-1), ELDER_GUARDIAN_SPAWN_EGG(-1),
ELYTRA(-1, 1),
EMERALD(-1),
ENCHANTED_BOOK(-1, 1), ENCHANTED_BOOK(-1, 1),
ENCHANTED_GOLDEN_APPLE(-1),
END_CRYSTAL(-1), END_CRYSTAL(-1),
ENDER_DRAGON_SPAWN_EGG(-1), ENDER_DRAGON_SPAWN_EGG(-1),
ENDER_EYE(-1), ENDER_EYE(-1),
ENDER_PEARL(-1, 16),
ENDERMAN_SPAWN_EGG(-1), ENDERMAN_SPAWN_EGG(-1),
ENDERMITE_SPAWN_EGG(-1), ENDERMITE_SPAWN_EGG(-1),
EVOKER_SPAWN_EGG(-1), EVOKER_SPAWN_EGG(-1),
EXPERIENCE_BOTTLE(-1), EXPERIENCE_BOTTLE(-1),
FIRE_CHARGE(-1),
FIREWORK_ROCKET(-1),
FIREWORK_STAR(-1),
FLOWER_BANNER_PATTERN(-1, 1),
FOX_SPAWN_EGG(-1),
FROG_SPAWN_EGG(-1),
GHAST_SPAWN_EGG(-1),
GLISTERING_MELON_SLICE(-1),
GLOBE_BANNER_PATTERN(-1, 1),
GLOW_ITEM_FRAME(-1),
GLOW_SQUID_SPAWN_EGG(-1),
GOAT_SPAWN_EGG(-1),
GOLDEN_CARROT(-1),
GOLDEN_HORSE_ARMOR(-1, 1),
GUARDIAN_SPAWN_EGG(-1),
HAPPY_GHAST_SPAWN_EGG(-1),
HOGLIN_SPAWN_EGG(-1),
HORSE_SPAWN_EGG(-1),
HUSK_SPAWN_EGG(-1),
IRON_GOLEM_SPAWN_EGG(-1),
IRON_HORSE_ARMOR(-1, 1),
IRON_NUGGET(-1),
ITEM_FRAME(-1),
KNOWLEDGE_BOOK(-1, 1),
LEAD(-1),
LEATHER_HORSE_ARMOR(-1, 1),
LINGERING_POTION(-1, 1),
LLAMA_SPAWN_EGG(-1),
MACE(-1, 1),
MAGMA_CREAM(-1),
MAGMA_CUBE_SPAWN_EGG(-1),
MAP(-1),
MOJANG_BANNER_PATTERN(-1, 1),
MOOSHROOM_SPAWN_EGG(-1),
MULE_SPAWN_EGG(-1),
MUSIC_DISC_5(-1, 1),
DISC_FRAGMENT_5(-1),
DRIED_KELP(-1),
DUNE_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
ECHO_SHARD(-1),
EGG(-1, 16),
ELYTRA(-1, 1),
EMERALD(-1),
ENCHANTED_GOLDEN_APPLE(-1),
ENDER_PEARL(-1, 16),
EXPLORER_POTTERY_SHERD(-1), EXPLORER_POTTERY_SHERD(-1),
EYE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), EYE_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
FEATHER(-1), FEATHER(-1),
FERMENTED_SPIDER_EYE(-1), FERMENTED_SPIDER_EYE(-1),
FIELD_MASONED_BANNER_PATTERN(-1, 1), FIELD_MASONED_BANNER_PATTERN(-1, 1),
FILLED_MAP(-1), FILLED_MAP(-1),
FIRE_CHARGE(-1),
FIREWORK_ROCKET(-1),
FIREWORK_STAR(-1),
FISHING_ROD(-1, 1), FISHING_ROD(-1, 1),
FLINT(-1), FLINT(-1),
FLINT_AND_STEEL(-1, 1), FLINT_AND_STEEL(-1, 1),
FLOW_ARMOR_TRIM_SMITHING_TEMPLATE(-1), FLOW_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
FLOW_BANNER_PATTERN(-1, 1), FLOW_BANNER_PATTERN(-1, 1),
FLOW_POTTERY_SHERD(-1), FLOW_POTTERY_SHERD(-1),
FLOWER_BANNER_PATTERN(-1, 1),
FOX_SPAWN_EGG(-1),
FRIEND_POTTERY_SHERD(-1), FRIEND_POTTERY_SHERD(-1),
FROG_SPAWN_EGG(-1),
FURNACE_MINECART(-1, 1), FURNACE_MINECART(-1, 1),
GHAST_SPAWN_EGG(-1),
GHAST_TEAR(-1), GHAST_TEAR(-1),
GLASS_BOTTLE(-1), GLASS_BOTTLE(-1),
GLISTERING_MELON_SLICE(-1),
GLOBE_BANNER_PATTERN(-1, 1),
GLOW_BERRIES(-1), GLOW_BERRIES(-1),
GLOW_INK_SAC(-1), GLOW_INK_SAC(-1),
GLOW_ITEM_FRAME(-1),
GLOW_SQUID_SPAWN_EGG(-1),
GLOWSTONE_DUST(-1), GLOWSTONE_DUST(-1),
GOAT_HORN(-1, 1), GOAT_HORN(-1, 1),
GOAT_SPAWN_EGG(-1),
GOLD_INGOT(-1), GOLD_INGOT(-1),
GOLD_NUGGET(-1), GOLD_NUGGET(-1),
GOLDEN_APPLE(-1), GOLDEN_APPLE(-1),
GOLDEN_AXE(-1, 1), GOLDEN_AXE(-1, 1),
GOLDEN_BOOTS(-1, 1), GOLDEN_BOOTS(-1, 1),
GOLDEN_CARROT(-1),
GOLDEN_CHESTPLATE(-1, 1), GOLDEN_CHESTPLATE(-1, 1),
GOLDEN_HELMET(-1, 1), GOLDEN_HELMET(-1, 1),
GOLDEN_HOE(-1, 1), GOLDEN_HOE(-1, 1),
GOLDEN_HORSE_ARMOR(-1, 1),
GOLDEN_LEGGINGS(-1, 1), GOLDEN_LEGGINGS(-1, 1),
GOLDEN_PICKAXE(-1, 1), GOLDEN_PICKAXE(-1, 1),
GOLDEN_SHOVEL(-1, 1), GOLDEN_SHOVEL(-1, 1),
@@ -358,36 +336,48 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
GREEN_BUNDLE(-1, 1), GREEN_BUNDLE(-1, 1),
GREEN_DYE(-1), GREEN_DYE(-1),
GREEN_HARNESS(-1, 1), GREEN_HARNESS(-1, 1),
GUARDIAN_SPAWN_EGG(-1),
GUNPOWDER(-1), GUNPOWDER(-1),
GUSTER_BANNER_PATTERN(-1, 1), GUSTER_BANNER_PATTERN(-1, 1),
GUSTER_POTTERY_SHERD(-1), GUSTER_POTTERY_SHERD(-1),
HAPPY_GHAST_SPAWN_EGG(-1),
HEART_OF_THE_SEA(-1), HEART_OF_THE_SEA(-1),
HEART_POTTERY_SHERD(-1), HEART_POTTERY_SHERD(-1),
HEARTBREAK_POTTERY_SHERD(-1), HEARTBREAK_POTTERY_SHERD(-1),
HOGLIN_SPAWN_EGG(-1),
HONEY_BOTTLE(-1, 16), HONEY_BOTTLE(-1, 16),
HONEYCOMB(-1), HONEYCOMB(-1),
HOPPER_MINECART(-1, 1), HOPPER_MINECART(-1, 1),
HORSE_SPAWN_EGG(-1),
HOST_ARMOR_TRIM_SMITHING_TEMPLATE(-1), HOST_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
HOWL_POTTERY_SHERD(-1), HOWL_POTTERY_SHERD(-1),
HUSK_SPAWN_EGG(-1),
INK_SAC(-1), INK_SAC(-1),
IRON_AXE(-1, 1), IRON_AXE(-1, 1),
IRON_BOOTS(-1, 1), IRON_BOOTS(-1, 1),
IRON_CHESTPLATE(-1, 1), IRON_CHESTPLATE(-1, 1),
IRON_GOLEM_SPAWN_EGG(-1),
IRON_HELMET(-1, 1), IRON_HELMET(-1, 1),
IRON_HOE(-1, 1), IRON_HOE(-1, 1),
IRON_HORSE_ARMOR(-1, 1),
IRON_INGOT(-1), IRON_INGOT(-1),
IRON_LEGGINGS(-1, 1), IRON_LEGGINGS(-1, 1),
IRON_NUGGET(-1),
IRON_PICKAXE(-1, 1), IRON_PICKAXE(-1, 1),
IRON_SHOVEL(-1, 1), IRON_SHOVEL(-1, 1),
IRON_SWORD(-1, 1), IRON_SWORD(-1, 1),
ITEM_FRAME(-1),
JUNGLE_BOAT(-1, 1), JUNGLE_BOAT(-1, 1),
JUNGLE_CHEST_BOAT(-1, 1), JUNGLE_CHEST_BOAT(-1, 1),
KNOWLEDGE_BOOK(-1, 1),
LAPIS_LAZULI(-1), LAPIS_LAZULI(-1),
LAVA_BUCKET(-1, 1), LAVA_BUCKET(-1, 1),
LEAD(-1),
LEATHER(-1), LEATHER(-1),
LEATHER_BOOTS(-1, 1), LEATHER_BOOTS(-1, 1),
LEATHER_CHESTPLATE(-1, 1), LEATHER_CHESTPLATE(-1, 1),
LEATHER_HELMET(-1, 1), LEATHER_HELMET(-1, 1),
LEATHER_HORSE_ARMOR(-1, 1),
LEATHER_LEGGINGS(-1, 1), LEATHER_LEGGINGS(-1, 1),
LIGHT_BLUE_BUNDLE(-1, 1), LIGHT_BLUE_BUNDLE(-1, 1),
LIGHT_BLUE_DYE(-1), LIGHT_BLUE_DYE(-1),
@@ -398,18 +388,28 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
LIME_BUNDLE(-1, 1), LIME_BUNDLE(-1, 1),
LIME_DYE(-1), LIME_DYE(-1),
LIME_HARNESS(-1, 1), LIME_HARNESS(-1, 1),
LINGERING_POTION(-1, 1),
LLAMA_SPAWN_EGG(-1),
MACE(-1, 1),
MAGENTA_BUNDLE(-1, 1), MAGENTA_BUNDLE(-1, 1),
MAGENTA_DYE(-1), MAGENTA_DYE(-1),
MAGENTA_HARNESS(-1, 1), MAGENTA_HARNESS(-1, 1),
MAGMA_CREAM(-1),
MAGMA_CUBE_SPAWN_EGG(-1),
MANGROVE_BOAT(-1, 1), MANGROVE_BOAT(-1, 1),
MANGROVE_CHEST_BOAT(-1, 1), MANGROVE_CHEST_BOAT(-1, 1),
MAP(-1),
MELON_SEEDS(-1), MELON_SEEDS(-1),
MELON_SLICE(-1), MELON_SLICE(-1),
MILK_BUCKET(-1, 1), MILK_BUCKET(-1, 1),
MINECART(-1, 1), MINECART(-1, 1),
MINER_POTTERY_SHERD(-1), MINER_POTTERY_SHERD(-1),
MOJANG_BANNER_PATTERN(-1, 1),
MOOSHROOM_SPAWN_EGG(-1),
MOURNER_POTTERY_SHERD(-1), MOURNER_POTTERY_SHERD(-1),
MULE_SPAWN_EGG(-1),
MUSHROOM_STEW(-1, 1), MUSHROOM_STEW(-1, 1),
MUSIC_DISC_5(-1, 1),
MUSIC_DISC_11(-1, 1), MUSIC_DISC_11(-1, 1),
MUSIC_DISC_13(-1, 1), MUSIC_DISC_13(-1, 1),
MUSIC_DISC_BLOCKS(-1, 1), MUSIC_DISC_BLOCKS(-1, 1),

View File

@@ -131,7 +131,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
MANGROVE_BOAT("mangrove_boat", MangroveBoat.class, -1), MANGROVE_BOAT("mangrove_boat", MangroveBoat.class, -1),
MANGROVE_CHEST_BOAT("mangrove_chest_boat", MangroveChestBoat.class, -1), MANGROVE_CHEST_BOAT("mangrove_chest_boat", MangroveChestBoat.class, -1),
MARKER("marker", Marker.class, -1), MARKER("marker", Marker.class, -1),
MINECART("minecart", Minecart.class, 42), MINECART("minecart", RideableMinecart.class, 42),
MOOSHROOM("mooshroom", MushroomCow.class, 96), MOOSHROOM("mooshroom", MushroomCow.class, 96),
MULE("mule", Mule.class, 32), MULE("mule", Mule.class, 32),
OAK_BOAT("oak_boat", OakBoat.class, -1), OAK_BOAT("oak_boat", OakBoat.class, -1),

View File

@@ -281,7 +281,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> BLACK_BANNER = getItemType("black_banner"); ItemType.Typed<BannerMeta> BLACK_BANNER = getItemType("black_banner");
ItemType.Typed<ItemMeta> BLACK_BED = getItemType("black_bed"); ItemType.Typed<BlockStateMeta> BLACK_BED = getItemType("black_bed");
ItemType.Typed<BundleMeta> BLACK_BUNDLE = getItemType("black_bundle"); ItemType.Typed<BundleMeta> BLACK_BUNDLE = getItemType("black_bundle");
@@ -329,7 +329,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> BLUE_BANNER = getItemType("blue_banner"); ItemType.Typed<BannerMeta> BLUE_BANNER = getItemType("blue_banner");
ItemType.Typed<ItemMeta> BLUE_BED = getItemType("blue_bed"); ItemType.Typed<BlockStateMeta> BLUE_BED = getItemType("blue_bed");
ItemType.Typed<BundleMeta> BLUE_BUNDLE = getItemType("blue_bundle"); ItemType.Typed<BundleMeta> BLUE_BUNDLE = getItemType("blue_bundle");
@@ -411,7 +411,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> BROWN_BANNER = getItemType("brown_banner"); ItemType.Typed<BannerMeta> BROWN_BANNER = getItemType("brown_banner");
ItemType.Typed<ItemMeta> BROWN_BED = getItemType("brown_bed"); ItemType.Typed<BlockStateMeta> BROWN_BED = getItemType("brown_bed");
ItemType.Typed<BundleMeta> BROWN_BUNDLE = getItemType("brown_bundle"); ItemType.Typed<BundleMeta> BROWN_BUNDLE = getItemType("brown_bundle");
@@ -635,7 +635,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> COMPOSTER = getItemType("composter"); ItemType.Typed<ItemMeta> COMPOSTER = getItemType("composter");
ItemType.Typed<ItemMeta> CONDUIT = getItemType("conduit"); ItemType.Typed<BlockStateMeta> CONDUIT = getItemType("conduit");
ItemType.Typed<ItemMeta> COOKED_BEEF = getItemType("cooked_beef"); ItemType.Typed<ItemMeta> COOKED_BEEF = getItemType("cooked_beef");
@@ -747,7 +747,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> CYAN_BANNER = getItemType("cyan_banner"); ItemType.Typed<BannerMeta> CYAN_BANNER = getItemType("cyan_banner");
ItemType.Typed<ItemMeta> CYAN_BED = getItemType("cyan_bed"); ItemType.Typed<BlockStateMeta> CYAN_BED = getItemType("cyan_bed");
ItemType.Typed<BundleMeta> CYAN_BUNDLE = getItemType("cyan_bundle"); ItemType.Typed<BundleMeta> CYAN_BUNDLE = getItemType("cyan_bundle");
@@ -1219,7 +1219,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> GRAVEL = getItemType("gravel"); ItemType.Typed<ItemMeta> GRAVEL = getItemType("gravel");
ItemType.Typed<ItemMeta> GRAY_BED = getItemType("gray_bed"); ItemType.Typed<BlockStateMeta> GRAY_BED = getItemType("gray_bed");
ItemType.Typed<BundleMeta> GRAY_BUNDLE = getItemType("gray_bundle"); ItemType.Typed<BundleMeta> GRAY_BUNDLE = getItemType("gray_bundle");
@@ -1247,7 +1247,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> GRAY_WOOL = getItemType("gray_wool"); ItemType.Typed<ItemMeta> GRAY_WOOL = getItemType("gray_wool");
ItemType.Typed<ItemMeta> GREEN_BED = getItemType("green_bed"); ItemType.Typed<BlockStateMeta> GREEN_BED = getItemType("green_bed");
ItemType.Typed<BundleMeta> GREEN_BUNDLE = getItemType("green_bundle"); ItemType.Typed<BundleMeta> GREEN_BUNDLE = getItemType("green_bundle");
@@ -1447,7 +1447,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> LIGHT = getItemType("light"); ItemType.Typed<ItemMeta> LIGHT = getItemType("light");
ItemType.Typed<ItemMeta> LIGHT_BLUE_BED = getItemType("light_blue_bed"); ItemType.Typed<BlockStateMeta> LIGHT_BLUE_BED = getItemType("light_blue_bed");
ItemType.Typed<BundleMeta> LIGHT_BLUE_BUNDLE = getItemType("light_blue_bundle"); ItemType.Typed<BundleMeta> LIGHT_BLUE_BUNDLE = getItemType("light_blue_bundle");
@@ -1475,7 +1475,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> LIGHT_BLUE_WOOL = getItemType("light_blue_wool"); ItemType.Typed<ItemMeta> LIGHT_BLUE_WOOL = getItemType("light_blue_wool");
ItemType.Typed<ItemMeta> LIGHT_GRAY_BED = getItemType("light_gray_bed"); ItemType.Typed<BlockStateMeta> LIGHT_GRAY_BED = getItemType("light_gray_bed");
ItemType.Typed<BundleMeta> LIGHT_GRAY_BUNDLE = getItemType("light_gray_bundle"); ItemType.Typed<BundleMeta> LIGHT_GRAY_BUNDLE = getItemType("light_gray_bundle");
@@ -1513,7 +1513,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> LILY_PAD = getItemType("lily_pad"); ItemType.Typed<ItemMeta> LILY_PAD = getItemType("lily_pad");
ItemType.Typed<ItemMeta> LIME_BED = getItemType("lime_bed"); ItemType.Typed<BlockStateMeta> LIME_BED = getItemType("lime_bed");
ItemType.Typed<BundleMeta> LIME_BUNDLE = getItemType("lime_bundle"); ItemType.Typed<BundleMeta> LIME_BUNDLE = getItemType("lime_bundle");
@@ -1547,7 +1547,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> LOOM = getItemType("loom"); ItemType.Typed<ItemMeta> LOOM = getItemType("loom");
ItemType.Typed<ItemMeta> MAGENTA_BED = getItemType("magenta_bed"); ItemType.Typed<BlockStateMeta> MAGENTA_BED = getItemType("magenta_bed");
ItemType.Typed<BundleMeta> MAGENTA_BUNDLE = getItemType("magenta_bundle"); ItemType.Typed<BundleMeta> MAGENTA_BUNDLE = getItemType("magenta_bundle");
@@ -1819,7 +1819,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> ORANGE_BANNER = getItemType("orange_banner"); ItemType.Typed<BannerMeta> ORANGE_BANNER = getItemType("orange_banner");
ItemType.Typed<ItemMeta> ORANGE_BED = getItemType("orange_bed"); ItemType.Typed<BlockStateMeta> ORANGE_BED = getItemType("orange_bed");
ItemType.Typed<BundleMeta> ORANGE_BUNDLE = getItemType("orange_bundle"); ItemType.Typed<BundleMeta> ORANGE_BUNDLE = getItemType("orange_bundle");
@@ -1945,7 +1945,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> PINK_BANNER = getItemType("pink_banner"); ItemType.Typed<BannerMeta> PINK_BANNER = getItemType("pink_banner");
ItemType.Typed<ItemMeta> PINK_BED = getItemType("pink_bed"); ItemType.Typed<BlockStateMeta> PINK_BED = getItemType("pink_bed");
ItemType.Typed<BundleMeta> PINK_BUNDLE = getItemType("pink_bundle"); ItemType.Typed<BundleMeta> PINK_BUNDLE = getItemType("pink_bundle");
@@ -2099,7 +2099,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> PURPLE_BANNER = getItemType("purple_banner"); ItemType.Typed<BannerMeta> PURPLE_BANNER = getItemType("purple_banner");
ItemType.Typed<ItemMeta> PURPLE_BED = getItemType("purple_bed"); ItemType.Typed<BlockStateMeta> PURPLE_BED = getItemType("purple_bed");
ItemType.Typed<BundleMeta> PURPLE_BUNDLE = getItemType("purple_bundle"); ItemType.Typed<BundleMeta> PURPLE_BUNDLE = getItemType("purple_bundle");
@@ -2179,7 +2179,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> RED_BANNER = getItemType("red_banner"); ItemType.Typed<BannerMeta> RED_BANNER = getItemType("red_banner");
ItemType.Typed<ItemMeta> RED_BED = getItemType("red_bed"); ItemType.Typed<BlockStateMeta> RED_BED = getItemType("red_bed");
ItemType.Typed<BundleMeta> RED_BUNDLE = getItemType("red_bundle"); ItemType.Typed<BundleMeta> RED_BUNDLE = getItemType("red_bundle");
@@ -2815,7 +2815,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> WHITE_BANNER = getItemType("white_banner"); ItemType.Typed<BannerMeta> WHITE_BANNER = getItemType("white_banner");
ItemType.Typed<ItemMeta> WHITE_BED = getItemType("white_bed"); ItemType.Typed<BlockStateMeta> WHITE_BED = getItemType("white_bed");
ItemType.Typed<BundleMeta> WHITE_BUNDLE = getItemType("white_bundle"); ItemType.Typed<BundleMeta> WHITE_BUNDLE = getItemType("white_bundle");
@@ -2881,7 +2881,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BannerMeta> YELLOW_BANNER = getItemType("yellow_banner"); ItemType.Typed<BannerMeta> YELLOW_BANNER = getItemType("yellow_banner");
ItemType.Typed<ItemMeta> YELLOW_BED = getItemType("yellow_bed"); ItemType.Typed<BlockStateMeta> YELLOW_BED = getItemType("yellow_bed");
ItemType.Typed<BundleMeta> YELLOW_BUNDLE = getItemType("yellow_bundle"); ItemType.Typed<BundleMeta> YELLOW_BUNDLE = getItemType("yellow_bundle");

View File

@@ -1,6 +1,5 @@
package io.papermc.generator; package io.papermc.generator;
import com.google.common.util.concurrent.MoreExecutors;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import io.papermc.generator.rewriter.registration.PaperPatternSourceSetRewriter; import io.papermc.generator.rewriter.registration.PaperPatternSourceSetRewriter;
import io.papermc.generator.rewriter.registration.PatternSourceSetRewriter; import io.papermc.generator.rewriter.registration.PatternSourceSetRewriter;
@@ -84,11 +83,11 @@ public class Main implements Callable<Integer> {
resourceManager, resourceManager,
layers, layers,
pendingTags, pendingTags,
FeatureFlags.VANILLA_SET, FeatureFlags.REGISTRY.allFlags(),
Commands.CommandSelection.DEDICATED, Commands.CommandSelection.DEDICATED,
0, Commands.LEVEL_GAMEMASTERS,
MoreExecutors.directExecutor(), Runnable::run,
MoreExecutors.directExecutor() Runnable::run
).whenComplete((result, ex) -> { ).whenComplete((result, ex) -> {
if (ex != null) { if (ex != null) {
resourceManager.close(); resourceManager.close();

View File

@@ -43,7 +43,7 @@ public class EnumRegistryRewriter<T> extends EnumRewriter<Holder.Reference<T>> {
@Override @Override
protected Iterable<Holder.Reference<T>> getValues() { protected Iterable<Holder.Reference<T>> getValues() {
return this.registry.get().listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; return this.registry.get().listElements().sorted(Formatting.HOLDER_ORDER)::iterator;
} }
@Override @Override

View File

@@ -71,7 +71,7 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
boolean isInterface = Objects.requireNonNull(this.fieldClass.knownClass()).isInterface(); boolean isInterface = Objects.requireNonNull(this.fieldClass.knownClass()).isInterface();
Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey); Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
this.experimentalKeys = Suppliers.memoize(() -> ExperimentalCollector.collectDataDrivenElementIds(registry)); this.experimentalKeys = Suppliers.memoize(() -> ExperimentalCollector.collectDataDrivenElementIds(registry));
Iterator<Holder.Reference<T>> referenceIterator = registry.listElements().filter(this::canPrintField).sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).iterator(); Iterator<Holder.Reference<T>> referenceIterator = registry.listElements().filter(this::canPrintField).sorted(Formatting.HOLDER_ORDER).iterator();
while (referenceIterator.hasNext()) { while (referenceIterator.hasNext()) {
Holder.Reference<T> reference = referenceIterator.next(); Holder.Reference<T> reference = referenceIterator.next();

View File

@@ -57,7 +57,7 @@ public class RegistryTagRewriter<T> extends SearchReplaceRewriter {
@Override @Override
protected void insert(SearchMetadata metadata, StringBuilder builder) { protected void insert(SearchMetadata metadata, StringBuilder builder) {
Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey); Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
Iterator<? extends TagKey<T>> keyIterator = registry.listTagIds().sorted(Formatting.alphabeticKeyOrder(reference -> reference.location().getPath())).iterator(); Iterator<? extends TagKey<T>> keyIterator = registry.listTagIds().sorted(Formatting.TAG_ORDER).iterator();
while (keyIterator.hasNext()) { while (keyIterator.hasNext()) {
TagKey<T> tagKey = keyIterator.next(); TagKey<T> tagKey = keyIterator.next();

View File

@@ -62,7 +62,7 @@ public class TagRewriter extends SearchReplaceRewriter {
builder.append('\n'); builder.append('\n');
builder.append('\n'); builder.append('\n');
Iterator<? extends TagKey<?>> keyIterator = registry.listTagIds().sorted(Formatting.alphabeticKeyOrder(tagKey -> tagKey.location().getPath())).iterator(); Iterator<? extends TagKey<?>> keyIterator = registry.listTagIds().sorted(Formatting.TAG_ORDER).iterator();
while (keyIterator.hasNext()) { while (keyIterator.hasNext()) {
TagKey<?> tagKey = keyIterator.next(); TagKey<?> tagKey = keyIterator.next();

View File

@@ -44,6 +44,7 @@ public class EntityTypeRewriter extends EnumRegistryRewriter<EntityType<?>> {
.put("LeashKnot", "LeashHitch") .put("LeashKnot", "LeashHitch")
.put("LightningBolt", "LightningStrike") .put("LightningBolt", "LightningStrike")
.put("Tnt", "TNTPrimed") .put("Tnt", "TNTPrimed")
.put("Minecart", "RideableMinecart")
.put("ChestMinecart", "StorageMinecart") .put("ChestMinecart", "StorageMinecart")
.put("CommandBlockMinecart", "CommandMinecart") .put("CommandBlockMinecart", "CommandMinecart")
.put("TntMinecart", "ExplosiveMinecart") .put("TntMinecart", "ExplosiveMinecart")

View File

@@ -30,7 +30,7 @@ public class MaterialRewriter {
@Override @Override
protected Iterable<Holder.Reference<Block>> getValues() { protected Iterable<Holder.Reference<Block>> getValues() {
return BuiltInRegistries.BLOCK.listElements().filter(reference -> !reference.value().equals(net.minecraft.world.level.block.Blocks.AIR)) return BuiltInRegistries.BLOCK.listElements().filter(reference -> !reference.value().equals(net.minecraft.world.level.block.Blocks.AIR))
.sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; .sorted(Formatting.HOLDER_ORDER)::iterator;
} }
@Override @Override
@@ -86,7 +86,7 @@ public class MaterialRewriter {
@Override @Override
protected Iterable<Holder.Reference<Item>> getValues() { protected Iterable<Holder.Reference<Item>> getValues() {
return BuiltInRegistries.ITEM.listElements().filter(reference -> BuiltInRegistries.BLOCK.getOptional(reference.key().location()).isEmpty() || reference.value().equals(net.minecraft.world.item.Items.AIR)) return BuiltInRegistries.ITEM.listElements().filter(reference -> BuiltInRegistries.BLOCK.getOptional(reference.key().location()).isEmpty() || reference.value().equals(net.minecraft.world.item.Items.AIR))
.sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; .sorted(Formatting.HOLDER_ORDER)::iterator;
} }
@Override @Override

View File

@@ -131,7 +131,7 @@ public class StatisticRewriter {
@Override @Override
protected Iterable<Holder.Reference<StatType<?>>> getValues() { protected Iterable<Holder.Reference<StatType<?>>> getValues() {
return BuiltInRegistries.STAT_TYPE.listElements().filter(reference -> reference.value() != Stats.CUSTOM) return BuiltInRegistries.STAT_TYPE.listElements().filter(reference -> reference.value() != Stats.CUSTOM)
.sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; .sorted(Formatting.HOLDER_ORDER)::iterator;
} }
@Override @Override
@@ -157,7 +157,7 @@ public class StatisticRewriter {
@Override @Override
protected Iterable<Holder.Reference<StatType<?>>> getValues() { protected Iterable<Holder.Reference<StatType<?>>> getValues() {
return BuiltInRegistries.STAT_TYPE.listElements().filter(reference -> reference.value() != Stats.CUSTOM) return BuiltInRegistries.STAT_TYPE.listElements().filter(reference -> reference.value() != Stats.CUSTOM)
.sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; .sorted(Formatting.HOLDER_ORDER)::iterator;
} }
@Override @Override

View File

@@ -6,9 +6,11 @@ import io.papermc.generator.utils.Formatting;
import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.Pair;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.level.block.state.properties.Property;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
@@ -16,11 +18,11 @@ import org.jspecify.annotations.NullMarked;
@NullMarked @NullMarked
public abstract class DataPropertyWriterBase implements DataPropertyMaker { public abstract class DataPropertyWriterBase implements DataPropertyMaker {
protected final Collection<? extends Property<?>> properties; protected final Stream<? extends Property<?>> properties;
protected final Class<? extends Block> blockClass; protected final Class<? extends Block> blockClass;
protected DataPropertyWriterBase(Collection<? extends Property<?>> properties, Class<? extends Block> blockClass) { protected DataPropertyWriterBase(Collection<? extends Property<?>> properties, Class<? extends Block> blockClass) {
this.properties = properties; this.properties = properties.stream().sorted(Comparator.comparing(Property::getName));
this.blockClass = blockClass; this.blockClass = blockClass;
} }
@@ -31,12 +33,12 @@ public abstract class DataPropertyWriterBase implements DataPropertyMaker {
code.add("$T.of(\n", List.class); code.add("$T.of(\n", List.class);
} }
code.indent(); code.indent();
Iterator<? extends Property<?>> it = this.properties.iterator(); Iterator<? extends Property<?>> properties = this.properties.iterator();
while (it.hasNext()) { while (properties.hasNext()) {
Property<?> property = it.next(); Property<?> property = properties.next();
Pair<Class<?>, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields); Pair<Class<?>, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields);
code.add("$T.$L", fieldName.left(), fieldName.right()); code.add("$T.$L", fieldName.left(), fieldName.right());
if (it.hasNext()) { if (properties.hasNext()) {
code.add(","); code.add(",");
} }
code.add("\n"); code.add("\n");
@@ -47,13 +49,13 @@ public abstract class DataPropertyWriterBase implements DataPropertyMaker {
protected void createSyntheticMap(CodeBlock.Builder code, Class<?> indexClass, Map<Property<?>, Field> fields) { protected void createSyntheticMap(CodeBlock.Builder code, Class<?> indexClass, Map<Property<?>, Field> fields) {
// assume indexClass is an enum with its values matching the property names // assume indexClass is an enum with its values matching the property names
code.add("$T.of(\n", Map.class).indent(); code.add("$T.of(\n", Map.class).indent();
Iterator<? extends Property<?>> it = this.properties.iterator(); Iterator<? extends Property<?>> properties = this.properties.iterator();
while (it.hasNext()) { while (properties.hasNext()) {
Property<?> property = it.next(); Property<?> property = properties.next();
String name = Formatting.formatKeyAsField(property.getName()); String name = Formatting.formatKeyAsField(property.getName());
Pair<Class<?>, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields); Pair<Class<?>, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields);
code.add("$T.$L, $T.$L", indexClass, name, fieldName.left(), fieldName.right()); code.add("$T.$L, $T.$L", indexClass, name, fieldName.left(), fieldName.right());
if (it.hasNext()) { if (properties.hasNext()) {
code.add(","); code.add(",");
} }
code.add("\n"); code.add("\n");

View File

@@ -84,7 +84,7 @@ public class GeneratedKeyType<T> extends SimpleGenerator {
MethodSpec.Builder createMethod = this.createMethod(typedKeyType); MethodSpec.Builder createMethod = this.createMethod(typedKeyType);
boolean allExperimental = true; boolean allExperimental = true;
for (Holder.Reference<T> reference : this.entry.registry().listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) { for (Holder.Reference<T> reference : this.entry.registry().listElements().sorted(Formatting.HOLDER_ORDER).toList()) {
ResourceKey<T> key = reference.key(); ResourceKey<T> key = reference.key();
String keyPath = key.location().getPath(); String keyPath = key.location().getPath();
String fieldName = Formatting.formatKeyAsField(keyPath); String fieldName = Formatting.formatKeyAsField(keyPath);

View File

@@ -73,7 +73,7 @@ public class GeneratedTagKeyType extends SimpleGenerator {
MethodSpec.Builder createMethod = this.createMethod(tagKeyType); MethodSpec.Builder createMethod = this.createMethod(tagKeyType);
AtomicBoolean allExperimental = new AtomicBoolean(true); AtomicBoolean allExperimental = new AtomicBoolean(true);
this.entry.registry().listTagIds().sorted(Formatting.alphabeticKeyOrder(tagKey -> tagKey.location().getPath())).forEach(tagKey -> { this.entry.registry().listTagIds().sorted(Formatting.TAG_ORDER).forEach(tagKey -> {
String fieldName = Formatting.formatKeyAsField(tagKey.location().getPath()); String fieldName = Formatting.formatKeyAsField(tagKey.location().getPath());
FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKeyType, fieldName, PUBLIC, STATIC, FINAL) FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKeyType, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), tagKey.location().getPath()) .initializer("$N(key($S))", createMethod.build(), tagKey.location().getPath())

View File

@@ -1,10 +1,11 @@
package io.papermc.generator.utils; package io.papermc.generator.utils;
import java.util.Optional; import java.util.Optional;
import net.minecraft.core.Holder;
import net.minecraft.tags.TagKey;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import java.util.Comparator; import java.util.Comparator;
import java.util.Locale; import java.util.Locale;
import java.util.OptionalInt;
import java.util.function.Function; import java.util.function.Function;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.IntStream; import java.util.stream.IntStream;
@@ -12,6 +13,7 @@ import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked @NullMarked
public final class Formatting { public final class Formatting {
@@ -73,33 +75,36 @@ public final class Formatting {
return newName; return newName;
} }
public static final Comparator<String> ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path); public static final Comparator<Holder.Reference<?>> HOLDER_ORDER = alphabeticKeyOrder(reference -> reference.key().location().getPath());
public static final Comparator<TagKey<?>> TAG_ORDER = alphabeticKeyOrder(tagKey -> tagKey.location().getPath());
public static <T> Comparator<T> alphabeticKeyOrder(Function<T, String> mapper) { public static <T> Comparator<T> alphabeticKeyOrder(Function<T, String> pathConverter) {
return (o1, o2) -> { return Comparator.comparing(pathConverter, (path1, path2) -> {
String path1 = mapper.apply(o1); TrailingInt trailingInt1 = tryParseTrailingInt(path1);
String path2 = mapper.apply(o2); TrailingInt trailingInt2 = tryParseTrailingInt(path2);
OptionalInt trailingInt1 = tryParseTrailingInt(path1); if (trailingInt1 != null && trailingInt2 != null &&
OptionalInt trailingInt2 = tryParseTrailingInt(path2); trailingInt1.prefix().equals(trailingInt2.prefix())) {
return Integer.compareUnsigned(trailingInt1.value(), trailingInt2.value());
if (trailingInt1.isPresent() && trailingInt2.isPresent()) {
return Integer.compare(trailingInt1.getAsInt(), trailingInt2.getAsInt());
} }
return path1.compareTo(path2); return path1.compareTo(path2);
}; });
} }
private static OptionalInt tryParseTrailingInt(String path) { private static @Nullable TrailingInt tryParseTrailingInt(String path) {
int delimiterIndex = path.lastIndexOf('_'); int delimiterIndex = path.lastIndexOf('_');
if (delimiterIndex != -1) { if (delimiterIndex != -1) {
String score = path.substring(delimiterIndex + 1); String value = path.substring(delimiterIndex + 1);
if (NumberUtils.isDigits(score)) { if (NumberUtils.isDigits(value)) {
return OptionalInt.of(Integer.parseInt(score)); String prefix = path.substring(0, delimiterIndex);
return new TrailingInt(prefix, Integer.parseInt(value));
} }
} }
return OptionalInt.empty(); return null;
}
private record TrailingInt(String prefix, int value) {
} }
private Formatting() { private Formatting() {

View File

@@ -21,11 +21,11 @@ public class CraftGlowLichen extends CraftBlockData implements GlowLichen {
private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of( private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of(
BlockFace.DOWN, BlockStateProperties.DOWN, BlockFace.DOWN, BlockStateProperties.DOWN,
BlockFace.UP, BlockStateProperties.UP, BlockFace.EAST, BlockStateProperties.EAST,
BlockFace.NORTH, BlockStateProperties.NORTH, BlockFace.NORTH, BlockStateProperties.NORTH,
BlockFace.SOUTH, BlockStateProperties.SOUTH, BlockFace.SOUTH, BlockStateProperties.SOUTH,
BlockFace.WEST, BlockStateProperties.WEST, BlockFace.UP, BlockStateProperties.UP,
BlockFace.EAST, BlockStateProperties.EAST BlockFace.WEST, BlockStateProperties.WEST
); );
public CraftGlowLichen(BlockState state) { public CraftGlowLichen(BlockState state) {

View File

@@ -18,11 +18,11 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
public class CraftHugeMushroom extends CraftBlockData implements MultipleFacing { public class CraftHugeMushroom extends CraftBlockData implements MultipleFacing {
private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of( private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of(
BlockFace.DOWN, HugeMushroomBlock.DOWN, BlockFace.DOWN, HugeMushroomBlock.DOWN,
BlockFace.UP, HugeMushroomBlock.UP, BlockFace.EAST, HugeMushroomBlock.EAST,
BlockFace.NORTH, HugeMushroomBlock.NORTH, BlockFace.NORTH, HugeMushroomBlock.NORTH,
BlockFace.SOUTH, HugeMushroomBlock.SOUTH, BlockFace.SOUTH, HugeMushroomBlock.SOUTH,
BlockFace.WEST, HugeMushroomBlock.WEST, BlockFace.UP, HugeMushroomBlock.UP,
BlockFace.EAST, HugeMushroomBlock.EAST BlockFace.WEST, HugeMushroomBlock.WEST
); );
public CraftHugeMushroom(BlockState state) { public CraftHugeMushroom(BlockState state) {

View File

@@ -21,11 +21,11 @@ public class CraftMultiface extends CraftBlockData implements ResinClump {
private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of( private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of(
BlockFace.DOWN, BlockStateProperties.DOWN, BlockFace.DOWN, BlockStateProperties.DOWN,
BlockFace.UP, BlockStateProperties.UP, BlockFace.EAST, BlockStateProperties.EAST,
BlockFace.NORTH, BlockStateProperties.NORTH, BlockFace.NORTH, BlockStateProperties.NORTH,
BlockFace.SOUTH, BlockStateProperties.SOUTH, BlockFace.SOUTH, BlockStateProperties.SOUTH,
BlockFace.WEST, BlockStateProperties.WEST, BlockFace.UP, BlockStateProperties.UP,
BlockFace.EAST, BlockStateProperties.EAST BlockFace.WEST, BlockStateProperties.WEST
); );
public CraftMultiface(BlockState state) { public CraftMultiface(BlockState state) {

View File

@@ -21,11 +21,11 @@ public class CraftSculkVein extends CraftBlockData implements SculkVein {
private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of( private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of(
BlockFace.DOWN, BlockStateProperties.DOWN, BlockFace.DOWN, BlockStateProperties.DOWN,
BlockFace.UP, BlockStateProperties.UP, BlockFace.EAST, BlockStateProperties.EAST,
BlockFace.NORTH, BlockStateProperties.NORTH, BlockFace.NORTH, BlockStateProperties.NORTH,
BlockFace.SOUTH, BlockStateProperties.SOUTH, BlockFace.SOUTH, BlockStateProperties.SOUTH,
BlockFace.WEST, BlockStateProperties.WEST, BlockFace.UP, BlockStateProperties.UP,
BlockFace.EAST, BlockStateProperties.EAST BlockFace.WEST, BlockStateProperties.WEST
); );
public CraftSculkVein(BlockState state) { public CraftSculkVein(BlockState state) {

View File

@@ -23,8 +23,8 @@ public class CraftTripWire extends CraftBlockData implements Tripwire {
private static final BooleanProperty POWERED = TripWireBlock.POWERED; private static final BooleanProperty POWERED = TripWireBlock.POWERED;
private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of( private static final Map<BlockFace, BooleanProperty> PROPERTY_BY_DIRECTION = Map.of(
BlockFace.NORTH, TripWireBlock.NORTH,
BlockFace.EAST, TripWireBlock.EAST, BlockFace.EAST, TripWireBlock.EAST,
BlockFace.NORTH, TripWireBlock.NORTH,
BlockFace.SOUTH, TripWireBlock.SOUTH, BlockFace.SOUTH, TripWireBlock.SOUTH,
BlockFace.WEST, TripWireBlock.WEST BlockFace.WEST, TripWireBlock.WEST
); );

View File

@@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.inventory;
import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; import com.destroystokyo.paper.inventory.meta.ArmorStandMeta;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import net.minecraft.world.item.BannerItem; import net.minecraft.world.item.BannerItem;
import net.minecraft.world.item.BedItem;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.BundleItem; import net.minecraft.world.item.BundleItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@@ -247,7 +248,8 @@ public final class CraftItemMetas {
|| itemType == ItemType.SUSPICIOUS_GRAVEL || itemType == ItemType.CRAFTER || itemType == ItemType.SUSPICIOUS_GRAVEL || itemType == ItemType.CRAFTER
|| itemType == ItemType.TRIAL_SPAWNER || itemType == ItemType.VAULT || itemType == ItemType.TRIAL_SPAWNER || itemType == ItemType.VAULT
|| itemType == ItemType.CREAKING_HEART || itemType == ItemType.TEST_BLOCK || itemType == ItemType.CREAKING_HEART || itemType == ItemType.TEST_BLOCK
|| itemType == ItemType.TEST_INSTANCE_BLOCK) { || itemType == ItemType.TEST_INSTANCE_BLOCK || itemHandle instanceof BedItem
|| itemType == ItemType.CONDUIT) {
return CraftItemMetas.asType(CraftItemMetas.BLOCK_STATE_META_DATA); return CraftItemMetas.asType(CraftItemMetas.BLOCK_STATE_META_DATA);
} }
if (itemType == ItemType.SHIELD) { if (itemType == ItemType.SHIELD) {

View File

@@ -12,6 +12,8 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.StandingAndWallBlockItem; import net.minecraft.world.item.StandingAndWallBlockItem;
import net.minecraft.world.level.block.AbstractBannerBlock;
import net.minecraft.world.level.block.AbstractSkullBlock;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.EntityBlock;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -174,9 +176,8 @@ public class ItemMetaTest {
if (block != null) { if (block != null) {
ItemStack stack = CraftItemStack.asNewCraftStack(Item.byBlock(block)); ItemStack stack = CraftItemStack.asNewCraftStack(Item.byBlock(block));
// Command blocks aren't unit testable atm if (block instanceof AbstractSkullBlock || block instanceof AbstractBannerBlock) {
if (stack.getType() == Material.COMMAND_BLOCK || stack.getType() == Material.CHAIN_COMMAND_BLOCK || stack.getType() == Material.REPEATING_COMMAND_BLOCK) { continue; // those blocks have a special meta
return;
} }
ItemMeta meta = stack.getItemMeta(); ItemMeta meta = stack.getItemMeta();