1.21.6 dev

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
Bjarne Koll
2025-05-28 13:23:32 +02:00
committed by Nassim Jahnke
parent 39203a65e0
commit a24f9b204c
788 changed files with 41006 additions and 6324 deletions

View File

@ -21,6 +21,7 @@ import org.bukkit.entity.Fish;
import org.bukkit.entity.Fox;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.HappyGhast;
import org.bukkit.entity.Illager;
import org.bukkit.entity.Illusioner;
import org.bukkit.entity.IronGolem;
@ -67,17 +68,17 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> RUN_AROUND_LIKE_CRAZY = create("run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RUN_AROUND_LIKE_CRAZY = create("horse_run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractSkeleton> ABSTRACT_SKELETON_MELEE = create("abstract_skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractSkeleton> SKELETON_MELEE = create("skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractVillager> LOOK_AT_TRADING_PLAYER = create("look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> VILLAGER_LOOK_AT_TRADING_PLAYER = create("villager_look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> TRADE_WITH_PLAYER = create("trade_with_player", AbstractVillager.class);
GoalKey<AbstractVillager> VILLAGER_TRADE_WITH_PLAYER = create("villager_trade_with_player", AbstractVillager.class);
GoalKey<Animals> BREED = create("breed", Animals.class);
@ -101,12 +102,12 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Bee> BEE_POLLINATE = create("bee_pollinate", Bee.class);
GoalKey<Bee> BEE_VALIDATE_FLOWER = create("bee_validate_flower", Bee.class);
GoalKey<Bee> BEE_VALIDATE_HIVE = create("bee_validate_hive", 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<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class);
@ -165,16 +166,16 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Creature> WATER_AVOIDING_RANDOM_STROLL = create("water_avoiding_random_stroll", Creature.class);
GoalKey<Creeper> SWELL = create("swell", Creeper.class);
GoalKey<Creeper> CREEPER_SWELL = create("creeper_swell", Creeper.class);
GoalKey<Dolphin> DOLPHIN_JUMP = create("dolphin_jump", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_PLAY_WITH_ITEMS = create("dolphin_play_with_items", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_TO_TREASURE = create("dolphin_swim_to_treasure", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_WITH_PLAYER = create("dolphin_swim_with_player", Dolphin.class);
GoalKey<Dolphin> PLAY_WITH_ITEMS = create("play_with_items", Dolphin.class);
GoalKey<Drowned> DROWNED_ATTACK = create("drowned_attack", Drowned.class);
GoalKey<Drowned> DROWNED_GO_TO_BEACH = create("drowned_go_to_beach", Drowned.class);
@ -199,14 +200,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fish> FISH_SWIM = create("fish_swim", Fish.class);
GoalKey<Fox> DEFEND_TRUSTED = create("defend_trusted", Fox.class);
GoalKey<Fox> FACEPLANT = create("faceplant", Fox.class);
GoalKey<Fox> FOX_BREED = create("fox_breed", Fox.class);
GoalKey<Fox> FOX_DEFEND_TRUSTED = create("fox_defend_trusted", Fox.class);
GoalKey<Fox> FOX_EAT_BERRIES = create("fox_eat_berries", Fox.class);
GoalKey<Fox> FOX_FACEPLANT = create("fox_faceplant", Fox.class);
GoalKey<Fox> FOX_FLOAT = create("fox_float", Fox.class);
GoalKey<Fox> FOX_FOLLOW_PARENT = create("fox_follow_parent", Fox.class);
@ -217,29 +218,27 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fox> FOX_PANIC = create("fox_panic", Fox.class);
GoalKey<Fox> FOX_PERCH_AND_SEARCH = create("fox_perch_and_search", Fox.class);
GoalKey<Fox> FOX_POUNCE = create("fox_pounce", Fox.class);
GoalKey<Fox> FOX_SEARCH_FOR_ITEMS = create("fox_search_for_items", Fox.class);
GoalKey<Fox> FOX_SEEK_SHELTER = create("fox_seek_shelter", Fox.class);
GoalKey<Fox> FOX_SLEEP = create("fox_sleep", Fox.class);
GoalKey<Fox> FOX_STALK_PREY = create("fox_stalk_prey", Fox.class);
GoalKey<Fox> FOX_STROLL_THROUGH_VILLAGE = create("fox_stroll_through_village", Fox.class);
GoalKey<Fox> PERCH_AND_SEARCH = create("perch_and_search", Fox.class);
GoalKey<Fox> SEEK_SHELTER = create("seek_shelter", Fox.class);
GoalKey<Fox> SLEEP = create("sleep", Fox.class);
GoalKey<Fox> STALK_PREY = create("stalk_prey", Fox.class);
GoalKey<Ghast> GHAST_LOOK = create("ghast_look", Ghast.class);
GoalKey<Ghast> GHAST_SHOOT_FIREBALL = create("ghast_shoot_fireball", Ghast.class);
GoalKey<Ghast> RANDOM_FLOAT_AROUND = create("random_float_around", Ghast.class);
GoalKey<Guardian> GUARDIAN_ATTACK = create("guardian_attack", Guardian.class);
GoalKey<Illager> HOLD_GROUND_ATTACK = create("hold_ground_attack", Illager.class);
GoalKey<HappyGhast> HAPPY_GHAST_FLOAT = create("happy_ghast_float", HappyGhast.class);
GoalKey<Illager> ILLAGER_HOLD_GROUND_ATTACK = create("illager_hold_ground_attack", Illager.class);
GoalKey<Illager> RAIDER_OPEN_DOOR = create("raider_open_door", Illager.class);
@ -247,9 +246,9 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Illusioner> ILLUSIONER_MIRROR_SPELL = create("illusioner_mirror_spell", Illusioner.class);
GoalKey<IronGolem> DEFEND_VILLAGE = create("defend_village", IronGolem.class);
GoalKey<IronGolem> IRON_GOLEM_DEFEND_VILLAGE = create("iron_golem_defend_village", IronGolem.class);
GoalKey<IronGolem> OFFER_FLOWER = create("offer_flower", IronGolem.class);
GoalKey<IronGolem> IRON_GOLEM_OFFER_FLOWER = create("iron_golem_offer_flower", IronGolem.class);
GoalKey<Llama> LLAMA_ATTACK_WOLF = create("llama_attack_wolf", Llama.class);
@ -269,6 +268,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> FOLLOW_MOB = create("follow_mob", Mob.class);
GoalKey<Mob> GHAST_LOOK = create("ghast_look", Mob.class);
GoalKey<Mob> INTERACT = create("interact", Mob.class);
GoalKey<Mob> LEAP_AT = create("leap_at", Mob.class);
@ -281,10 +282,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> OPEN_DOOR = create("open_door", Mob.class);
GoalKey<Mob> RANDOM_FLOAT_AROUND = create("random_float_around", Mob.class);
GoalKey<Mob> RANDOM_LOOK_AROUND = create("random_look_around", Mob.class);
GoalKey<Mob> RESET_UNIVERSAL_ANGER = create("reset_universal_anger", Mob.class);
GoalKey<Mob> TEMPT_FOR_NON_PATHFINDERS = create("tempt_for_non_pathfinders", Mob.class);
GoalKey<Mob> USE_ITEM = create("use_item", Mob.class);
GoalKey<Mob> VINDICATOR_BREAK_DOOR = create("vindicator_break_door", Mob.class);
@ -317,7 +322,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Panda> PANDA_SNEEZE = create("panda_sneeze", Panda.class);
GoalKey<Parrot> LAND_ON_OWNERS_SHOULDER = create("land_on_owners_shoulder", Parrot.class);
GoalKey<Parrot> PARROT_LAND_ON_OWNERS_SHOULDER = create("parrot_land_on_owners_shoulder", Parrot.class);
GoalKey<Phantom> PHANTOM_ATTACK_PLAYER = create("phantom_attack_player", Phantom.class);
@ -339,27 +344,27 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Rabbit> RABBIT_PANIC = create("rabbit_panic", Rabbit.class);
GoalKey<Rabbit> RAID_GARDEN = create("raid_garden", Rabbit.class);
GoalKey<Raider> LONG_DISTANCE_PATROL = create("long_distance_patrol", Raider.class);
GoalKey<Raider> NEAREST_ATTACKABLE_WITCH = create("nearest_attackable_witch", Raider.class);
GoalKey<Raider> NEAREST_HEALABLE_RAIDER = create("nearest_healable_raider", Raider.class);
GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = create("obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> PATHFIND_TO_RAID = create("pathfind_to_raid", Raider.class);
GoalKey<Rabbit> RABBIT_RAID_GARDEN = create("rabbit_raid_garden", Rabbit.class);
GoalKey<Raider> RAIDER_CELEBRATION = create("raider_celebration", Raider.class);
GoalKey<Raider> RAIDER_LONG_DISTANCE_PATROL = create("raider_long_distance_patrol", Raider.class);
GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = create("raider_move_through_village", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_ATTACKABLE_WITCH = create("raider_nearest_attackable_witch", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_HEALABLE_RAIDER = create("raider_nearest_healable_raider", Raider.class);
GoalKey<Raider> RAIDER_OBTAIN_RAID_LEADER_BANNER = create("raider_obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> RAIDER_PATHFIND_TO_RAID = create("raider_pathfind_to_raid", Raider.class);
GoalKey<RangedEntity> DROWNED_TRIDENT_ATTACK = create("drowned_trident_attack", RangedEntity.class);
GoalKey<RangedEntity> RANGED_ATTACK = create("ranged_attack", RangedEntity.class);
GoalKey<SchoolableFish> FOLLOW_FLOCK_LEADER = create("follow_flock_leader", SchoolableFish.class);
GoalKey<SchoolableFish> SCHOOLABLE_FISH_FOLLOW_FLOCK_LEADER = create("schoolable_fish_follow_flock_leader", SchoolableFish.class);
GoalKey<Shulker> SHULKER_ATTACK = create("shulker_attack", Shulker.class);
@ -373,7 +378,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Silverfish> SILVERFISH_WAKE_UP_FRIENDS = create("silverfish_wake_up_friends", Silverfish.class);
GoalKey<SkeletonHorse> SKELETON_TRAP = create("skeleton_trap", SkeletonHorse.class);
GoalKey<SkeletonHorse> SKELETON_HORSE_SKELETON_TRAP = create("skeleton_horse_skeleton_trap", SkeletonHorse.class);
GoalKey<Slime> SLIME_ATTACK = create("slime_attack", Slime.class);
@ -429,14 +434,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Vindicator> VINDICATOR_JOHNNY_ATTACK = create("vindicator_johnny_attack", Vindicator.class);
GoalKey<WanderingTrader> WANDER_TO_POSITION = create("wander_to_position", WanderingTrader.class);
GoalKey<WanderingTrader> WANDERING_TRADER_WANDER_TO_POSITION = create("wandering_trader_wander_to_position", WanderingTrader.class);
GoalKey<Wither> WITHER_DO_NOTHING = create("wither_do_nothing", Wither.class);
GoalKey<Wolf> BEG = create("beg", Wolf.class);
GoalKey<Wolf> WOLF_AVOID_ENTITY = create("wolf_avoid_entity", Wolf.class);
GoalKey<Wolf> WOLF_BEG = create("wolf_beg", Wolf.class);
GoalKey<Zombie> ZOMBIE_ATTACK = create("zombie_attack", Zombie.class);
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class AttributeKeys {
/**
* {@code minecraft:armor}
@ -81,6 +81,13 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> BURNING_TIME = create(key("burning_time"));
/**
* {@code minecraft:camera_distance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> CAMERA_DISTANCE = create(key("camera_distance"));
/**
* {@code minecraft:entity_interaction_range}
*
@ -249,6 +256,20 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> WATER_MOVEMENT_EFFICIENCY = create(key("water_movement_efficiency"));
/**
* {@code minecraft:waypoint_receive_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_RECEIVE_RANGE = create(key("waypoint_receive_range"));
/**
* {@code minecraft:waypoint_transmit_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_TRANSMIT_RANGE = create(key("waypoint_transmit_range"));
private AttributeKeys() {
}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class BannerPatternKeys {
/**
* {@code minecraft:base}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class BiomeKeys {
/**
* {@code minecraft:badlands}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}
@ -2475,6 +2475,13 @@ public final class BlockTypeKeys {
*/
public static final TypedKey<BlockType> DRAGON_WALL_HEAD = create(key("dragon_wall_head"));
/**
* {@code minecraft:dried_ghast}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<BlockType> DRIED_GHAST = create(key("dried_ghast"));
/**
* {@code minecraft:dried_kelp_block}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class ChickenVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class CowVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attribute_modifiers}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class FluidKeys {
/**
* {@code minecraft:empty}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
@ -144,6 +144,13 @@ public final class JukeboxSongKeys {
*/
public static final TypedKey<JukeboxSong> STRAD = create(key("strad"));
/**
* {@code minecraft:tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> TEARS = create(key("tears"));
/**
* {@code minecraft:wait}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class PigVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}
@ -1929,6 +1929,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DISPENSER_LAUNCH = create(key("block.dispenser.launch"));
/**
* {@code minecraft:block.dried_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT = create(key("block.dried_ghast.ambient"));
/**
* {@code minecraft:block.dried_ghast.ambient_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT_WATER = create(key("block.dried_ghast.ambient_water"));
/**
* {@code minecraft:block.dried_ghast.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_BREAK = create(key("block.dried_ghast.break"));
/**
* {@code minecraft:block.dried_ghast.fall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_FALL = create(key("block.dried_ghast.fall"));
/**
* {@code minecraft:block.dried_ghast.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE = create(key("block.dried_ghast.place"));
/**
* {@code minecraft:block.dried_ghast.place_in_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE_IN_WATER = create(key("block.dried_ghast.place_in_water"));
/**
* {@code minecraft:block.dried_ghast.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_STEP = create(key("block.dried_ghast.step"));
/**
* {@code minecraft:block.dried_ghast.transition}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_TRANSITION = create(key("block.dried_ghast.transition"));
/**
* {@code minecraft:block.dripstone_block.break}
*
@ -1964,6 +2020,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DRIPSTONE_BLOCK_STEP = create(key("block.dripstone_block.step"));
/**
* {@code minecraft:block.dry_grass.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRY_GRASS_AMBIENT = create(key("block.dry_grass.ambient"));
/**
* {@code minecraft:block.enchantment_table.use}
*
@ -4113,13 +4176,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_SAND_STEP = create(key("block.sand.step"));
/**
* {@code minecraft:block.sand.wind}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_SAND_WIND = create(key("block.sand.wind"));
/**
* {@code minecraft:block.scaffolding.break}
*
@ -7207,6 +7263,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GHAST_WARN = create(key("entity.ghast.warn"));
/**
* {@code minecraft:entity.ghastling.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_AMBIENT = create(key("entity.ghastling.ambient"));
/**
* {@code minecraft:entity.ghastling.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_DEATH = create(key("entity.ghastling.death"));
/**
* {@code minecraft:entity.ghastling.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_HURT = create(key("entity.ghastling.hurt"));
/**
* {@code minecraft:entity.ghastling.spawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_SPAWN = create(key("entity.ghastling.spawn"));
/**
* {@code minecraft:entity.glow_item_frame.add_item}
*
@ -7452,6 +7536,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GUARDIAN_HURT_LAND = create(key("entity.guardian.hurt_land"));
/**
* {@code minecraft:entity.happy_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_AMBIENT = create(key("entity.happy_ghast.ambient"));
/**
* {@code minecraft:entity.happy_ghast.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_DEATH = create(key("entity.happy_ghast.death"));
/**
* {@code minecraft:entity.happy_ghast.equip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_EQUIP = create(key("entity.happy_ghast.equip"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_down}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_DOWN = create(key("entity.happy_ghast.harness_goggles_down"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_UP = create(key("entity.happy_ghast.harness_goggles_up"));
/**
* {@code minecraft:entity.happy_ghast.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HURT = create(key("entity.happy_ghast.hurt"));
/**
* {@code minecraft:entity.happy_ghast.riding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_RIDING = create(key("entity.happy_ghast.riding"));
/**
* {@code minecraft:entity.happy_ghast.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_UNEQUIP = create(key("entity.happy_ghast.unequip"));
/**
* {@code minecraft:entity.hoglin.ambient}
*
@ -7816,20 +7956,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ITEM_FRAME_ROTATE_ITEM = create(key("entity.item_frame.rotate_item"));
/**
* {@code minecraft:entity.leash_knot.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_BREAK = create(key("entity.leash_knot.break"));
/**
* {@code minecraft:entity.leash_knot.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_PLACE = create(key("entity.leash_knot.place"));
/**
* {@code minecraft:entity.lightning_bolt.impact}
*
@ -8880,13 +9006,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_POLAR_BEAR_WARNING = create(key("entity.polar_bear.warning"));
/**
* {@code minecraft:entity.puffer_fish.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PUFFER_FISH_AMBIENT = create(key("entity.puffer_fish.ambient"));
/**
* {@code minecraft:entity.puffer_fish.blow_out}
*
@ -11323,6 +11442,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_HONEYCOMB_WAX_ON = create(key("item.honeycomb.wax_on"));
/**
* {@code minecraft:item.horse_armor.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_HORSE_ARMOR_UNEQUIP = create(key("item.horse_armor.unequip"));
/**
* {@code minecraft:item.ink_sac.use}
*
@ -11330,6 +11456,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_INK_SAC_USE = create(key("item.ink_sac.use"));
/**
* {@code minecraft:item.lead.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_BREAK = create(key("item.lead.break"));
/**
* {@code minecraft:item.lead.tied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_TIED = create(key("item.lead.tied"));
/**
* {@code minecraft:item.lead.untied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_UNTIED = create(key("item.lead.untied"));
/**
* {@code minecraft:item.llama_carpet.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LLAMA_CARPET_UNEQUIP = create(key("item.llama_carpet.unequip"));
/**
* {@code minecraft:item.lodestone_compass.lock}
*
@ -11372,6 +11526,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_OMINOUS_BOTTLE_DISPOSE = create(key("item.ominous_bottle.dispose"));
/**
* {@code minecraft:item.saddle.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SADDLE_UNEQUIP = create(key("item.saddle.unequip"));
/**
* {@code minecraft:item.shears.snip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SHEARS_SNIP = create(key("item.shears.snip"));
/**
* {@code minecraft:item.shield.block}
*
@ -11834,6 +12002,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> MUSIC_DISC_STRAD = create(key("music_disc.strad"));
/**
* {@code minecraft:music_disc.tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> MUSIC_DISC_TEARS = create(key("music_disc.tears"));
/**
* {@code minecraft:music_disc.wait}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class WolfSoundVariantKeys {
/**
* {@code minecraft:angry}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class BlockTypeTagKeys {
/**
@ -580,6 +580,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> GUARDED_BY_PIGLINS = create(key("guarded_by_piglins"));
/**
* {@code #minecraft:happy_ghast_avoids}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> HAPPY_GHAST_AVOIDS = create(key("happy_ghast_avoids"));
/**
* {@code #minecraft:hoglin_repellents}
*
@ -909,13 +916,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> PLANKS = create(key("planks"));
/**
* {@code #minecraft:plays_ambient_desert_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> PLAYS_AMBIENT_DESERT_BLOCK_SOUNDS = create(key("plays_ambient_desert_block_sounds"));
/**
* {@code #minecraft:polar_bears_spawnable_on_alternate}
*
@ -1203,6 +1203,27 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> TRAPDOORS = create(key("trapdoors"));
/**
* {@code #minecraft:triggers_ambient_desert_dry_vegetation_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS = create(key("triggers_ambient_desert_dry_vegetation_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_desert_sand_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_SAND_BLOCK_SOUNDS = create(key("triggers_ambient_desert_sand_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_dried_ghast_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DRIED_GHAST_BLOCK_SOUNDS = create(key("triggers_ambient_dried_ghast_block_sounds"));
/**
* {@code #minecraft:underwater_bonemeals}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**

View File

@ -25,7 +25,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class EntityTypeTagKeys {
/**
@ -83,6 +83,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CAN_BREATHE_UNDER_WATER = create(key("can_breathe_under_water"));
/**
* {@code #minecraft:can_equip_harness}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CAN_EQUIP_HARNESS = create(key("can_equip_harness"));
/**
* {@code #minecraft:can_equip_saddle}
*
@ -125,6 +132,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> FALL_DAMAGE_IMMUNE = create(key("fall_damage_immune"));
/**
* {@code #minecraft:followable_friendly_mobs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> FOLLOWABLE_FRIENDLY_MOBS = create(key("followable_friendly_mobs"));
/**
* {@code #minecraft:freeze_hurts_extra_types}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class FluidTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
@ -601,6 +601,27 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> HANGING_SIGNS = create(key("hanging_signs"));
/**
* {@code #minecraft:happy_ghast_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_FOOD = create(key("happy_ghast_food"));
/**
* {@code #minecraft:happy_ghast_tempt_items}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_TEMPT_ITEMS = create(key("happy_ghast_tempt_items"));
/**
* {@code #minecraft:harnesses}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HARNESSES = create(key("harnesses"));
/**
* {@code #minecraft:head_armor}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6-rc1")
@ApiStatus.Experimental
public final class StructureTagKeys {
/**

View File

@ -317,7 +317,7 @@ public class MaterialTags {
*/
public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
.endsWith("_SPAWN_EGG")
.ensureSize("SPAWN_EGGS", 81).lock();
.ensureSize("SPAWN_EGGS", 82).lock();
/**
* Covers all colors of stained glass.

View File

@ -15,45 +15,46 @@ import org.jspecify.annotations.Nullable;
@NullMarked
public final class GoalKey<T extends Mob> {
private final Class<T> entityClass;
private final NamespacedKey namespacedKey;
private final Class<T> type;
private final NamespacedKey key;
private GoalKey(Class<T> entityClass, NamespacedKey namespacedKey) {
this.entityClass = entityClass;
this.namespacedKey = namespacedKey;
private GoalKey(Class<T> type, NamespacedKey key) {
this.type = type;
this.key = key;
}
public Class<T> getEntityClass() {
return this.entityClass;
return this.type;
}
public NamespacedKey getNamespacedKey() {
return this.namespacedKey;
return this.key;
}
@Override
public boolean equals(@Nullable Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
GoalKey<?> goalKey = (GoalKey<?>) o;
return Objects.equals(this.entityClass, goalKey.entityClass) &&
Objects.equals(this.namespacedKey, goalKey.namespacedKey);
return Objects.equals(this.type, goalKey.type) &&
Objects.equals(this.key, goalKey.key);
}
@Override
public int hashCode() {
return Objects.hash(this.entityClass, this.namespacedKey);
return Objects.hash(this.type, this.key);
}
@Override
public String toString() {
return new StringJoiner(", ", GoalKey.class.getSimpleName() + "[", "]")
.add("entityClass=" + this.entityClass)
.add("namespacedKey=" + this.namespacedKey)
.add("type=" + this.type)
.add("key=" + this.key)
.toString();
}
public static <A extends Mob> GoalKey<A> of(Class<A> entityClass, NamespacedKey namespacedKey) {
return new GoalKey<>(entityClass, namespacedKey);
public static <A extends Mob> GoalKey<A> of(Class<A> type, NamespacedKey key) {
return new GoalKey<>(type, key);
}
}

View File

@ -17,7 +17,8 @@ public enum CommandRegistrationFlag {
@Deprecated(since = "1.21.4")
FLATTEN_ALIASES,
/**
* Prevents this command from being sent to the client.
* @deprecated Removed as it causes a warning to appear on the client now.
*/
@Deprecated(since = "1.21.6", forRemoval = true)
SERVER_ONLY
}

View File

@ -3,7 +3,6 @@ package io.papermc.paper.datacomponent;
import org.bukkit.Utility;
import org.bukkit.persistence.PersistentDataContainer;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NullMarked;
/**
@ -23,8 +22,8 @@ public interface DataComponentHolder extends DataComponentView {
* @param <T> value type
*/
@Utility
@org.jetbrains.annotations.ApiStatus.Experimental
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull io.papermc.paper.datacomponent.DataComponentBuilder<T> valueBuilder);
@ApiStatus.Experimental
<T> void setData(final DataComponentType.Valued<T> type, final DataComponentBuilder<T> valueBuilder);
/**
* Sets the value of the data component type for this holder.
@ -33,16 +32,16 @@ public interface DataComponentHolder extends DataComponentView {
* @param value value to set
* @param <T> value type
*/
@org.jetbrains.annotations.ApiStatus.Experimental
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull T value);
@ApiStatus.Experimental
<T> void setData(final DataComponentType.Valued<T> type, final T value);
/**
* Marks this non-valued data component type as present in this itemstack.
*
* @param type the data component type
*/
@org.jetbrains.annotations.ApiStatus.Experimental
public void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull NonValued type);
@ApiStatus.Experimental
void setData(final DataComponentType.NonValued type);
// TODO: Do we even want to have the concept of overriding here? Not sure what is going on with entity components
}

View File

@ -364,8 +364,8 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<Rabbit.Type> RABBIT_VARIANT = valued("rabbit/variant");
public static final DataComponentType.Valued<Pig.Variant> PIG_VARIANT = valued("pig/variant");
public static final DataComponentType.Valued<Cow.Variant> COW_VARIANT = valued("cow/variant");
// TODO: This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
public static final DataComponentType.Valued<Chicken.Variant> CHICKEN_VARIANT = valued("chicken/variant");
// This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
public static final DataComponentType.Valued<Frog.Variant> FROG_VARIANT = valued("frog/variant");
public static final DataComponentType.Valued<Horse.Color> HORSE_VARIANT = valued("horse/variant");
public static final DataComponentType.Valued<Art> PAINTING_VARIANT = valued("painting/variant");
@ -376,7 +376,6 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<DyeColor> SHEEP_COLOR = valued("sheep/color");
public static final DataComponentType.Valued<DyeColor> SHULKER_COLOR = valued("shulker/color");
private static DataComponentType.NonValued unvalued(final String name) {
final DataComponentType dataComponentType = requireNonNull(Registry.DATA_COMPONENT_TYPE.get(NamespacedKey.minecraft(name)), name + " unvalued data component type couldn't be found, this is a bug.");
if (dataComponentType instanceof DataComponentType.NonValued) {

View File

@ -3,9 +3,8 @@ package io.papermc.paper.datacomponent;
import org.bukkit.Utility;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* This represents a view of a data component holder. No
@ -23,11 +22,11 @@ public interface DataComponentView {
* @param type the data component type
* @param <T> the value type
* @return the value for the data component type, or {@code null} if not set or marked as removed
* @see #hasData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued
* @see #hasData(DataComponentType) for DataComponentType.NonValued
*/
@Contract(pure = true)
@ApiStatus.Experimental
public <T> @Nullable T getData(final DataComponentType.@NotNull Valued<T> type);
<T> @Nullable T getData(final DataComponentType.Valued<T> type);
/**
* Gets the value for the data component type on this holder with
@ -41,7 +40,7 @@ public interface DataComponentView {
@Utility
@Contract(value = "_, !null -> !null", pure = true)
@ApiStatus.Experimental
public <T> @Nullable T getDataOrDefault(final DataComponentType.@NotNull Valued<? extends T> type, final @Nullable T fallback);
<T> @Nullable T getDataOrDefault(final DataComponentType.Valued<? extends T> type, final @Nullable T fallback);
/**
* Checks if the data component type is set on this holder.
@ -51,7 +50,7 @@ public interface DataComponentView {
*/
@Contract(pure = true)
@ApiStatus.Experimental
boolean hasData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type);
boolean hasData(final DataComponentType type);
// Not applicable to entities
// /**
@ -61,5 +60,5 @@ public interface DataComponentView {
// */
// @Contract("-> new")
// @ApiStatus.Experimental
// java.util.@Unmodifiable Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> getDataTypes();
// @Unmodifiable Set<DataComponentType> getDataTypes();
}

View File

@ -4,13 +4,13 @@ import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.blocksattacks.DamageReduction;
import io.papermc.paper.datacomponent.item.blocksattacks.ItemDamageFunction;
import io.papermc.paper.registry.tag.TagKey;
import java.util.List;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.List;
/**
* Holds block attacks to the holding player like Shield.
@ -62,24 +62,21 @@ public interface BlocksAttacks {
*
* @return a damage type tag key, or null if there is no such tag key
*/
@Nullable
TagKey<DamageType> bypassedBy();
@Nullable TagKey<DamageType> bypassedBy();
/**
* Gets the key sound to play when an attack is successfully blocked.
*
* @return a key of the sound
*/
@Nullable
Key blockSound();
@Nullable Key blockSound();
/**
* Gets the key sound to play when the item goes on its disabled cooldown due to an attack.
*
* @return a key of the sound
*/
@Nullable
Key disableSound();
@Nullable Key disableSound();
/**
* Builder for {@link BlocksAttacks}.

View File

@ -1,7 +1,7 @@
package io.papermc.paper.datacomponent.item;
import java.util.List;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.Color;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;

View File

@ -104,6 +104,22 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
@Contract(pure = true)
boolean equipOnInteract();
/**
* Checks if the item can be sheared off an entity.
*
* @return true if can be sheared off an entity, false otherwise
*/
@Contract(pure = true)
boolean canBeSheared();
/**
* Returns the sound that is played when shearing this equipment off an entity.
*
* @return shear sound
*/
@Contract(pure = true)
Key shearSound();
/**
* Builder for {@link Equippable}.
*/
@ -182,5 +198,23 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
*/
@Contract(value = "_ -> this", mutates = "this")
Builder equipOnInteract(boolean equipOnInteract);
/**
* Sets whether the item can be sheared off an entity.
*
* @param canBeSheared true if can be sheared off an entity
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder canBeSheared(boolean canBeSheared);
/**
* Sets the sound that is played when shearing this equipment off an entity.
*
* @param shearSound the shear sound key
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder shearSound(Key shearSound);
}
}

View File

@ -1,7 +1,6 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.block.BlockPredicate;
import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;

View File

@ -1,6 +1,7 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.attribute.AttributeModifierDisplay;
import java.util.List;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
@ -55,13 +56,21 @@ public interface ItemAttributeModifiers {
AttributeModifier modifier();
/**
* Gets the slot group for this attribute.
* Gets the slot group for the paired attribute.
*
* @return the slot group
*/
default EquipmentSlotGroup getGroup() {
return this.modifier().getSlotGroup();
}
/**
* The display behavior for the attribute modifier.
*
* @return the display behavior
*/
@Contract(pure = true)
AttributeModifierDisplay display();
}
/**
@ -74,24 +83,55 @@ public interface ItemAttributeModifiers {
/**
* Adds a modifier to this builder.
*
* @param attribute attribute
* @param modifier modifier
* @param attribute the attribute
* @param modifier the modifier
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier);
default Builder addModifier(Attribute attribute, AttributeModifier modifier) {
return this.addModifier(attribute, modifier, modifier.getSlotGroup());
}
/**
* Adds a modifier to this builder.
*
* @param attribute attribute
* @param modifier modifier
* @param attribute the attribute
* @param modifier the modifier
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup);
default Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup) {
return this.addModifier(attribute, modifier, equipmentSlotGroup, AttributeModifierDisplay.reset());
}
/**
* Adds a modifier to this builder.
*
* @param attribute the attribute
* @param modifier the modifier
* @param display the modifier display behavior
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _ -> this", mutates = "this")
default Builder addModifier(Attribute attribute, AttributeModifier modifier, AttributeModifierDisplay display) {
return this.addModifier(attribute, modifier, modifier.getSlotGroup(), display);
}
/**
* Adds a modifier to this builder.
*
* @param attribute the attribute
* @param modifier the modifier
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
* @param display the modifier display behavior
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup, AttributeModifierDisplay display);
}
}

View File

@ -90,7 +90,7 @@ interface ItemComponentTypesBridge {
MapId mapId(int id);
UseRemainder useRemainder(ItemStack itemStack);
UseRemainder useRemainder(ItemStack stack);
Consumable.Builder consumable();

View File

@ -0,0 +1,85 @@
package io.papermc.paper.datacomponent.item.attribute;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* The display behavior for a dedicated attribute entry.
*
* @see io.papermc.paper.datacomponent.DataComponentTypes#ATTRIBUTE_MODIFIERS
* @see io.papermc.paper.datacomponent.item.ItemAttributeModifiers#itemAttributes()
*/
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface AttributeModifierDisplay {
/**
* Reset any override of the text displayed by the attribute modifier
* to its default behavior displaying the statistics.
*
* @return the new display behavior instance
*/
@Contract(value = "-> new", pure = true)
static Default reset() {
return AttributeModifierDisplayBridge.bridge().reset();
}
/**
* Hides the statistics displayed by the attribute modifier.
*
* @return the new display behavior instance
*/
@Contract(value = "-> new", pure = true)
static Hidden hidden() {
return AttributeModifierDisplayBridge.bridge().hidden();
}
/**
* Override the statistics displayed by the attribute modifier
* to an arbitrary text.
*
* @param text the overridden text
* @return the new display behavior instance
*/
@Contract(value = "_ -> new", pure = true)
static OverrideText override(final ComponentLike text) {
return AttributeModifierDisplayBridge.bridge().override(text);
}
/**
* Hidden statistics display for the attribute modifier.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Hidden extends AttributeModifierDisplay {
}
/**
* Default display for the attribute modifier, showing
* the statistic of its effect.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Default extends AttributeModifierDisplay {
}
/**
* Specifies an overridden text to show instead of
* the default behavior for the attribute modifier.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface OverrideText extends AttributeModifierDisplay {
/**
* Overridden text
*
* @return the overridden text
*/
Component text();
}
}

View File

@ -0,0 +1,24 @@
package io.papermc.paper.datacomponent.item.attribute;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.ComponentLike;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Internal
interface AttributeModifierDisplayBridge {
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class).findFirst();
static AttributeModifierDisplayBridge bridge() {
return BRIDGE.orElseThrow();
}
AttributeModifierDisplay.Default reset();
AttributeModifierDisplay.Hidden hidden();
AttributeModifierDisplay.OverrideText override(ComponentLike text);
}

View File

@ -1,9 +1,9 @@
package io.papermc.paper.datacomponent.item.blocksattacks;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Internal

View File

@ -30,16 +30,14 @@ public interface DamageReduction {
*
* @return the set of damage type
*/
@Nullable
RegistryKeySet<DamageType> type();
@Nullable RegistryKeySet<DamageType> type();
/**
* Get the maximum angle between the users facing direction and the direction of the incoming attack to be blocked.
*
* @return the angle
*/
@Positive
float horizontalBlockingAngle();
@Positive float horizontalBlockingAngle();
/**
* Get the constant amount of damage to be blocked.

View File

@ -1,11 +1,14 @@
package io.papermc.paper.datacomponent.item.consumable;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents the hand animation that is used when a player is consuming this item.
*/
@ApiStatus.Experimental
public enum ItemUseAnimation {
// Start generate - ItemUseAnimation
// @GeneratedFrom 1.21.5
// @GeneratedFrom 1.21.6-rc1
NONE,
EAT,
DRINK,

View File

@ -1,8 +1,7 @@
/**
* The paper configuration package contains the new java representation of a plugins configuration file.
* While most values are described in detail on {@link io.papermc.paper.plugin.configuration.PluginMeta}, a full
* entry on the paper contains a full and extensive example of possible configurations of the paper-plugin.yml.
* @see <a href="https://docs.papermc.io/paper">Extensive documentation and examples of the paper-plugin.yml</a>
* <!--TODO update the documentation link once documentation for this exists and is deployed-->
* entry on the paper website contains a full and extensive example of possible configurations of the paper-plugin.yml.
* @see <a href="https://docs.papermc.io/paper/dev/getting-started/paper-plugins">Extensive documentation and examples of the paper-plugin.yml</a>
*/
package io.papermc.paper.plugin.configuration;

View File

@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
* server initialization.
* @see LifecycleEvents
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface LifecycleEvent {
}

View File

@ -4,7 +4,6 @@ import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.LifecycleEventHandlerConfiguration;
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEventType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Manages a plugin's lifecycle events. Can be obtained
@ -12,8 +11,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <O> the owning type, {@link org.bukkit.plugin.Plugin} or {@link io.papermc.paper.plugin.bootstrap.BootstrapContext}
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventManager<O extends LifecycleEventOwner> {

View File

@ -2,7 +2,6 @@ package io.papermc.paper.plugin.lifecycle.event;
import io.papermc.paper.plugin.configuration.PluginMeta;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Implemented by types that are considered owners
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
* a {@link LifecycleEventManager} where you can register
* event handlers.
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventOwner {

View File

@ -1,8 +1,6 @@
package io.papermc.paper.plugin.lifecycle.event.handler;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A handler for a specific event. Can be implemented
@ -10,8 +8,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <E> the event
*/
@ApiStatus.Experimental
@NullMarked
@FunctionalInterface
public interface LifecycleEventHandler<E extends LifecycleEvent> {

View File

@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Base type for constructing configured event handlers for
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
* @param <O>
*/
@SuppressWarnings("unused")
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> {
}

View File

@ -3,15 +3,12 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Handler configuration for event types that allow "monitor" handlers.
*
* @param <O> the required owner type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface MonitorLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {

View File

@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Handler configuration that allows both "monitor" and prioritized handlers.
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <O> the required owner type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface PrioritizedLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {

View File

@ -0,0 +1,6 @@
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -0,0 +1,6 @@
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.plugin.lifecycle.event.handler;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -0,0 +1,6 @@
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.plugin.lifecycle.event;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -6,7 +6,6 @@ import org.jetbrains.annotations.ApiStatus;
* To be implemented by types that provide ways to register types
* either on server start or during a reload
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface Registrar {
}

View File

@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.registrar;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* A lifecycle event that exposes a {@link Registrar} of some kind
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
* @param <R> registrar type
* @see ReloadableRegistrarEvent
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface RegistrarEvent<R extends Registrar> extends LifecycleEvent {

View File

@ -2,7 +2,6 @@ package io.papermc.paper.plugin.lifecycle.event.registrar;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* A lifecycle event that exposes a {@link Registrar} that is
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
* @param <R> the registrar type
* @see RegistrarEvent
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface ReloadableRegistrarEvent<R extends Registrar> extends RegistrarEvent<R> {
@ -24,7 +21,6 @@ public interface ReloadableRegistrarEvent<R extends Registrar> extends Registrar
@Contract(pure = true)
Cause cause();
@ApiStatus.Experimental
enum Cause {
/**
* The initial load of the server.

View File

@ -0,0 +1,6 @@
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.plugin.lifecycle.event.registrar;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -9,7 +9,6 @@ import io.papermc.paper.plugin.lifecycle.event.handler.configuration.MonitorLife
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.PrioritizedLifecycleEventHandlerConfiguration;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Base type for all types of lifecycle events. Differs from
@ -22,8 +21,6 @@ import org.jspecify.annotations.NullMarked;
* @param <E> the event object type
* @param <C> the configuration type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventType<O extends LifecycleEventOwner, E extends LifecycleEvent, C extends LifecycleEventHandlerConfiguration<O>> {
@ -55,7 +52,6 @@ public interface LifecycleEventType<O extends LifecycleEventOwner, E extends Lif
* @param <O> the required owner type
* @param <E> the event object type
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Monitorable<O extends LifecycleEventOwner, E extends LifecycleEvent> extends LifecycleEventType<O, E, MonitorLifecycleEventHandlerConfiguration<O>> {
}
@ -67,7 +63,6 @@ public interface LifecycleEventType<O extends LifecycleEventOwner, E extends Lif
* @param <O> the required owner type
* @param <E> the event object type
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Prioritizable<O extends LifecycleEventOwner, E extends LifecycleEvent> extends LifecycleEventType<O, E, PrioritizedLifecycleEventHandlerConfiguration<O>> {
}

View File

@ -5,10 +5,8 @@ import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
@NullMarked
interface LifecycleEventTypeProvider {
Optional<LifecycleEventTypeProvider> INSTANCE = ServiceLoader.load(LifecycleEventTypeProvider.class)

View File

@ -10,15 +10,12 @@ import io.papermc.paper.plugin.lifecycle.event.registrar.RegistrarEvent;
import io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Holds various types of lifecycle events for
* use when creating event handler configurations
* in {@link LifecycleEventManager}.
*/
@ApiStatus.Experimental
@NullMarked
public final class LifecycleEvents {
/**

View File

@ -6,7 +6,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.tag.PostFlattenTagRegistrar;
import io.papermc.paper.tag.PreFlattenTagRegistrar;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Provides event types for tag registration.
@ -14,8 +13,6 @@ import org.jspecify.annotations.NullMarked;
* @see PreFlattenTagRegistrar
* @see PostFlattenTagRegistrar
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface TagEventTypeProvider {

View File

@ -0,0 +1,6 @@
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.plugin.lifecycle.event.types;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -1,16 +1,19 @@
package io.papermc.paper.registry;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.jspecify.annotations.NullMarked;
@NullMarked
record TypedKeyImpl<T>(Key key, RegistryKey<T> registryKey) implements TypedKey<T> {
// Wrap key methods to make this easier to use
@KeyPattern.Namespace
@Override
public String namespace() {
return this.key.namespace();
}
@KeyPattern.Value
@Override
public String value() {
return this.key.value();

View File

@ -3,6 +3,7 @@ package io.papermc.paper.registry.data;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import io.papermc.paper.registry.event.RegistryComposeEvent;
import io.papermc.paper.registry.set.RegistryKeySet;
import io.papermc.paper.registry.set.RegistrySet;
import io.papermc.paper.registry.tag.TagKey;
@ -153,7 +154,7 @@ public interface EnchantmentRegistryEntry {
/**
* Configures the set of supported items this enchantment can be applied on. This
* can be a {@link RegistryKeySet} created via {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or
* a tag obtained via {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
* a tag obtained via {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
@ -161,7 +162,7 @@ public interface EnchantmentRegistryEntry {
* @param supportedItems the registry key set representing the supported items.
* @return this builder instance.
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
*/
@Contract(value = "_ -> this", mutates = "this")
Builder supportedItems(RegistryKeySet<ItemType> supportedItems);
@ -170,7 +171,7 @@ public interface EnchantmentRegistryEntry {
* Configures a set of item types this enchantment can naturally be applied to, when enchanting in an
* enchantment table.This can be a {@link RegistryKeySet} created via
* {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or a tag obtained via
* {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
* {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
@ -182,7 +183,7 @@ public interface EnchantmentRegistryEntry {
* @param primaryItems the registry key set representing the primary items.
* @return this builder instance.
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
*/
@Contract(value = "_ -> this", mutates = "this")
Builder primaryItems(@Nullable RegistryKeySet<ItemType> primaryItems);
@ -285,7 +286,7 @@ public interface EnchantmentRegistryEntry {
* @param exclusiveWith a registry set of enchantments exclusive to this one.
* @return this builder instance.
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
*/
@Contract(value = "_ -> this", mutates = "this")
Builder exclusiveWith(RegistryKeySet<Enchantment> exclusiveWith);

View File

@ -18,5 +18,4 @@ public interface InlinedRegistryBuilderProvider {
return Holder.INSTANCE.orElseThrow();
}
Art createPaintingVariant(Consumer<RegistryBuilderFactory<Art, ? extends PaintingVariantRegistryEntry.Builder>> value);
}

View File

@ -0,0 +1,134 @@
package io.papermc.paper.registry.data;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.RegistryBuilderFactory;
import io.papermc.paper.registry.TypedKey;
import io.papermc.paper.registry.holder.RegistryHolder;
import java.util.function.Consumer;
import net.kyori.adventure.text.Component;
import org.bukkit.JukeboxSong;
import org.bukkit.Sound;
import org.checkerframework.checker.index.qual.Positive;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Range;
/**
* A data-centric version-specific registry entry for the {@link JukeboxSong} type.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface JukeboxSongRegistryEntry {
/**
* Gets the sound event for this song.
*
* @return the sound event
*/
@Contract(pure = true)
RegistryHolder<Sound, SoundEventRegistryEntry> soundEvent();
/**
* Gets the description for this song.
*
* @return the description
*/
@Contract(pure = true)
Component description();
/**
* Gets the length in seconds for this song.
*
* @return the length in seconds
*/
@Contract(pure = true)
@Positive float lengthInSeconds();
/**
* Gets the comparator output for this song.
*
* @return the comparator output
*/
@Contract(pure = true)
@Range(from = 0, to = 15) int comparatorOutput();
/**
* A mutable builder for the {@link JukeboxSongRegistryEntry} plugins may change in applicable registry events.
* <p>
* The following values are required for each builder:
* <ul>
* <li>
* {@link #soundEvent(TypedKey)}, {@link #soundEvent(Consumer)} or {@link #soundEvent(RegistryHolder)}
* </li>
* <li>{@link #description(Component)}</li>
* <li>{@link #lengthInSeconds(float)}</li>
* <li>{@link #comparatorOutput(int)}</li>
* </ul>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends JukeboxSongRegistryEntry, RegistryBuilder<JukeboxSong> {
/**
* Sets the sound event for this song to a sound event present
* in the {@link io.papermc.paper.registry.RegistryKey#SOUND_EVENT} registry.
* <p>This will override both {@link #soundEvent(Consumer)} and {@link #soundEvent(RegistryHolder)}</p>
*
* @param soundEvent the sound event
* @return this builder
* @see #soundEvent(Consumer)
*/
@Contract(value = "_ -> this", mutates = "this")
Builder soundEvent(TypedKey<Sound> soundEvent);
/**
* Sets the sound event for this song to a new sound event.
* <p>This will override both {@link #soundEvent(TypedKey)} and {@link #soundEvent(RegistryHolder)}</p>
*
* @param soundEvent the sound event
* @return this builder
* @see #soundEvent(TypedKey)
*/
@Contract(value = "_ -> this", mutates = "this")
Builder soundEvent(Consumer<RegistryBuilderFactory<Sound, ? extends SoundEventRegistryEntry.Builder>> soundEvent);
/**
* Sets the sound event for this song.
* <p>This will override both {@link #soundEvent(Consumer)} and {@link #soundEvent(TypedKey)}</p>
*
* @param soundEvent the sound event
* @return this builder
* @see #soundEvent(TypedKey)
* @see #soundEvent(Consumer)
*/
@Contract( value = "_ -> this", mutates = "this")
Builder soundEvent(RegistryHolder<Sound, SoundEventRegistryEntry> soundEvent);
/**
* Sets the description for this song.
*
* @param description the description
* @return this builder
*/
@Contract(value = "_ -> this", mutates = "this")
Builder description(Component description);
/**
* Sets the length in seconds for this song.
*
* @param lengthInSeconds the length in seconds (positive)
* @return this builder
*/
@Contract(value = "_ -> this", mutates = "this")
Builder lengthInSeconds(@Positive float lengthInSeconds);
/**
* Sets the comparator output for this song.
*
* @param comparatorOutput the comparator output [0-15]
* @return this builder
*/
@Contract(value = "_ -> this", mutates = "this")
Builder comparatorOutput(@Range(from = 0, to = 15) int comparatorOutput);
}
}

View File

@ -0,0 +1,63 @@
package io.papermc.paper.registry.data;
import io.papermc.paper.registry.RegistryBuilder;
import net.kyori.adventure.key.Key;
import org.bukkit.Sound;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.Nullable;
/**
* A data-centric version-specific registry entry for the {@link Sound} type.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface SoundEventRegistryEntry {
/**
* Gets the resource pack location for this sound event.
*
* @return the location
*/
@Contract(pure = true)
Key location();
/**
* Gets the fixed range for this sound event, if present.
*
* @return the fixed range, or {@code null} if not present
*/
@Contract(pure = true)
@Nullable Float fixedRange();
/**
* A mutable builder for the {@link SoundEventRegistryEntry} plugins may change in applicable registry events.
* <p>
* The following values are required for each builder:
* <ul>
* <li>{@link #location(Key)}</li>
* </ul>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends SoundEventRegistryEntry, RegistryBuilder<Sound> {
/**
* Sets the resource pack location for this sound event.
*
* @param location the location
* @return this builder
*/
@Contract(value = "_ -> this", mutates = "this")
Builder location(Key location);
/**
* Sets the fixed range for this sound event.
*
* @param fixedRange the fixed range
* @return this builder
*/
@Contract(value = "_ -> this", mutates = "this")
Builder fixedRange(@Nullable Float fixedRange);
}
}

View File

@ -0,0 +1,38 @@
package io.papermc.paper.registry.event;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.tag.Tag;
import io.papermc.paper.registry.tag.TagKey;
import org.bukkit.Keyed;
import org.jetbrains.annotations.ApiStatus;
/**
* Event object for {@link RegistryEventProvider#compose()}. This
* event is fired after a registry is loaded with its normal values.
* It provides a way for plugins to add new objects to the registry.
*
* @param <T> registry entry type
* @param <B> registry entry builder type
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface RegistryComposeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {
/**
* Get the writable registry.
*
* @return a writable registry
*/
WritableRegistry<T, B> registry();
/**
* Gets or creates a tag for the given tag key. This tag
* is then required to be filled either from the built-in or
* custom datapack.
*
* @param tagKey the tag key
* @return the tag
* @param <V> the tag value type
*/
<V extends Keyed> Tag<V> getOrCreateTag(TagKey<V> tagKey); // TODO remove Keyed
}

View File

@ -6,7 +6,6 @@ import io.papermc.paper.registry.tag.Tag;
import io.papermc.paper.registry.tag.TagKey;
import org.bukkit.Keyed;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Event object for {@link RegistryEventProvider#entryAdd()}. This
@ -16,8 +15,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> registry entry type
* @param <B> registry entry builder type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface RegistryEntryAddEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {

View File

@ -3,15 +3,12 @@ package io.papermc.paper.registry.event;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
import io.papermc.paper.registry.RegistryKey;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Base type for all registry events.
*
* @param <T> registry entry type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface RegistryEvent<T> extends LifecycleEvent {

View File

@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.event.type.RegistryEntryAddEventType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Provider for registry events for a specific registry.
@ -15,14 +14,12 @@ import org.jspecify.annotations.NullMarked;
* Supported events are:
* <ul>
* <li>{@link RegistryEntryAddEvent} (via {@link #entryAdd()})</li>
* <li>{@link RegistryFreezeEvent} (via {@link #freeze()})</li>
* <li>{@link RegistryComposeEvent} (via {@link #compose()})</li>
* </ul>
*
* @param <T> registry entry type
* @param <B> registry entry builder type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface RegistryEventProvider<T, B extends RegistryBuilder<T>> {
@ -45,8 +42,25 @@ public interface RegistryEventProvider<T, B extends RegistryBuilder<T>> {
* to register a handler for {@link RegistryFreezeEvent}.
*
* @return the registry freeze event type
* @deprecated use {@link #compose()} instead.
*/
LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze();
@SuppressWarnings({"unchecked", "rawtypes"})
@ApiStatus.ScheduledForRemoval(inVersion = "1.21.7 or 1.22, whichever comes first")
@Deprecated(since = "1.21.6", forRemoval = true)
default LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze() {
return (LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T,B>>) (LifecycleEventType.Prioritizable) this.compose();
}
/**
* Gets the event type for {@link RegistryComposeEvent} which is fired after
* a registry is loaded of expected elements. It allows for the registration of new objects.
* <p>
* Can be used in {@link io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager#registerEventHandler(LifecycleEventType, LifecycleEventHandler)}
* to register a handler for {@link RegistryComposeEvent}.
*
* @return the registry freeze event type
*/
LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> compose();
/**
* Gets the registry key associated with this event type provider.

View File

@ -6,10 +6,8 @@ import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.event.type.RegistryEntryAddEventType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
@NullMarked
record RegistryEventProviderImpl<T, B extends RegistryBuilder<T>>(RegistryKey<T> registryKey) implements RegistryEventProvider<T, B> {
static <T, B extends RegistryBuilder<T>> RegistryEventProvider<T, B> create(final RegistryKey<T> registryKey) {
@ -22,8 +20,7 @@ record RegistryEventProviderImpl<T, B extends RegistryBuilder<T>>(RegistryKey<T>
}
@Override
public LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze() {
return RegistryEventTypeProvider.provider().registryFreeze(this);
public LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> compose() {
return RegistryEventTypeProvider.provider().registryCompose(this);
}
}

View File

@ -20,5 +20,5 @@ interface RegistryEventTypeProvider {
<T, B extends RegistryBuilder<T>> RegistryEntryAddEventType<T, B> registryEntryAdd(RegistryEventProvider<T, B> type);
<T, B extends RegistryBuilder<T>> LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> registryFreeze(RegistryEventProvider<T, B> type);
<T, B extends RegistryBuilder<T>> LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> registryCompose(RegistryEventProvider<T, B> type);
}

View File

@ -9,11 +9,13 @@ import io.papermc.paper.registry.data.DamageTypeRegistryEntry;
import io.papermc.paper.registry.data.EnchantmentRegistryEntry;
import io.papermc.paper.registry.data.FrogVariantRegistryEntry;
import io.papermc.paper.registry.data.GameEventRegistryEntry;
import io.papermc.paper.registry.data.JukeboxSongRegistryEntry;
import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
import io.papermc.paper.registry.data.PigVariantRegistryEntry;
import io.papermc.paper.registry.data.WolfVariantRegistryEntry;
import org.bukkit.Art;
import org.bukkit.GameEvent;
import org.bukkit.JukeboxSong;
import org.bukkit.block.banner.PatternType;
import org.bukkit.damage.DamageType;
import org.bukkit.enchantments.Enchantment;
@ -23,25 +25,22 @@ import org.bukkit.entity.Cow;
import org.bukkit.entity.Frog;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Wolf;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
/**
* Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryFreezeEvent}
* Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryComposeEvent}
* handlers for each applicable registry.
*/
@ApiStatus.Experimental
@NullMarked
public final class RegistryEvents {
// Start generate - RegistryEvents
// @GeneratedFrom 1.21.5
// @GeneratedFrom 1.21.6-rc1
public static final RegistryEventProvider<GameEvent, GameEventRegistryEntry.Builder> GAME_EVENT = create(RegistryKey.GAME_EVENT);
public static final RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> DAMAGE_TYPE = create(RegistryKey.DAMAGE_TYPE);
public static final RegistryEventProvider<Wolf.Variant, WolfVariantRegistryEntry.Builder> WOLF_VARIANT = create(RegistryKey.WOLF_VARIANT);
public static final RegistryEventProvider<Enchantment, EnchantmentRegistryEntry.Builder> ENCHANTMENT = create(RegistryKey.ENCHANTMENT);
public static final RegistryEventProvider<JukeboxSong, JukeboxSongRegistryEntry.Builder> JUKEBOX_SONG = create(RegistryKey.JUKEBOX_SONG);
public static final RegistryEventProvider<PatternType, BannerPatternRegistryEntry.Builder> BANNER_PATTERN = create(RegistryKey.BANNER_PATTERN);
public static final RegistryEventProvider<Art, PaintingVariantRegistryEntry.Builder> PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT);
public static final RegistryEventProvider<Cat.Type, CatTypeRegistryEntry.Builder> CAT_VARIANT = create(RegistryKey.CAT_VARIANT);

View File

@ -1,11 +1,7 @@
package io.papermc.paper.registry.event;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.tag.Tag;
import io.papermc.paper.registry.tag.TagKey;
import org.bukkit.Keyed;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Event object for {@link RegistryEventProvider#freeze()}. This
@ -14,27 +10,10 @@ import org.jspecify.annotations.NullMarked;
*
* @param <T> registry entry type
* @param <B> registry entry builder type
* @deprecated renamed to {@link RegistryComposeEvent}
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.ScheduledForRemoval(inVersion = "1.21.7 or 1.22, whichever comes first")
@Deprecated(since = "1.21.6", forRemoval = true)
@ApiStatus.NonExtendable
public interface RegistryFreezeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {
/**
* Get the writable registry.
*
* @return a writable registry
*/
WritableRegistry<T, B> registry();
/**
* Gets or creates a tag for the given tag key. This tag
* is then required to be filled either from the built-in or
* custom datapack.
*
* @param tagKey the tag key
* @return the tag
* @param <V> the tag value type
*/
<V extends Keyed> Tag<V> getOrCreateTag(TagKey<V> tagKey);
public interface RegistryFreezeEvent<T, B extends RegistryBuilder<T>> extends RegistryComposeEvent<T, B> {
}

View File

@ -5,7 +5,6 @@ import io.papermc.paper.registry.RegistryBuilderFactory;
import io.papermc.paper.registry.TypedKey;
import java.util.function.Consumer;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A registry which supports registering new objects.
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> registry entry type
* @param <B> registry entry builder type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface WritableRegistry<T, B extends RegistryBuilder<T>> {

View File

@ -0,0 +1,9 @@
/**
* This package contains events related to the Paper registry system.
*/
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.registry.event;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -4,15 +4,15 @@ import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.PrioritizedLifecycleEventHandlerConfiguration;
import io.papermc.paper.registry.TypedKey;
import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Specific configuration for {@link io.papermc.paper.registry.event.RegistryEntryAddEvent}s.
*
* @param <T> registry entry type
*/
@NullMarked
@ApiStatus.NonExtendable
public interface RegistryEntryAddConfiguration<T> extends PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext> {
/**

View File

@ -5,7 +5,6 @@ import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEventType;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.event.RegistryEntryAddEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Lifecycle event type for {@link RegistryEntryAddEvent}s.
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
* @param <T> registry entry type
* @param <B> registry entry builder type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface RegistryEntryAddEventType<T, B extends RegistryBuilder<T>> extends LifecycleEventType<BootstrapContext, RegistryEntryAddEvent<T, B>, RegistryEntryAddConfiguration<T>> {
}

View File

@ -0,0 +1,9 @@
/**
* This package contains events related to the Paper registry system.
*/
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.registry.event.type;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

View File

@ -0,0 +1,50 @@
package io.papermc.paper.registry.holder;
import io.papermc.paper.registry.TypedKey;
import org.jetbrains.annotations.ApiStatus;
/**
* During the registry loading phase, some values can be references to values to-be-loaded
* in the future, or inlined, anonymous values that already exist. This type (and subtypes) represent
* that structure.
* @param <API> the registry's type
* @param <ENTRY> the type of the registry entry (for inlined values)
*/
@ApiStatus.Experimental
public sealed interface RegistryHolder<API, ENTRY> permits RegistryHolder.Reference, RegistryHolder.Inlined {
/**
* A holder that references a registry value by key, but does not have the entry itself.
* This is used for entries that are only referenced by key and may not yet have any value associated with them.
*
* @param <API> the registry's type
* @param <ENTRY> the type of the registry entry
*/
@ApiStatus.NonExtendable
non-sealed interface Reference<API, ENTRY> extends RegistryHolder<API, ENTRY> {
/**
* The key of the referenced value.
*
* @return the key of the value
*/
TypedKey<API> key();
}
/**
* A holder that contains an inlined registry entry, an anonymous value (does not have a key).
*
* @param <API> the registry's type
* @param <ENTRY> the type of the registry entry
*/
@ApiStatus.NonExtendable
non-sealed interface Inlined<API, ENTRY> extends RegistryHolder<API, ENTRY> {
/**
* The inlined entry.
*
* @return the inlined entry
*/
ENTRY entry();
}
}

View File

@ -0,0 +1,9 @@
/**
* Registry holders.
*/
@ApiStatus.Experimental
@NullMarked
package io.papermc.paper.registry.holder;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;

Some files were not shown because too many files have changed in this diff Show More