Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 68de2de253
commit cd27f1b0c7
62 changed files with 1914 additions and 156 deletions

View File

@@ -4,6 +4,7 @@ import com.google.common.collect.Multimap;
import java.util.function.Consumer;
import org.bukkit.Keyed;
import org.bukkit.Material;
import org.bukkit.MinecraftExperimental;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.Translatable;
@@ -135,6 +136,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_PLANKS = getItemType("acacia_planks");
ItemType.Typed<ItemMeta> CHERRY_PLANKS = getItemType("cherry_planks");
ItemType.Typed<ItemMeta> DARK_OAK_PLANKS = getItemType("dark_oak_planks");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_PLANKS = getItemType("pale_oak_planks");
ItemType.Typed<ItemMeta> MANGROVE_PLANKS = getItemType("mangrove_planks");
ItemType.Typed<ItemMeta> BAMBOO_PLANKS = getItemType("bamboo_planks");
ItemType.Typed<ItemMeta> CRIMSON_PLANKS = getItemType("crimson_planks");
@@ -147,6 +151,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_SAPLING = getItemType("acacia_sapling");
ItemType.Typed<ItemMeta> CHERRY_SAPLING = getItemType("cherry_sapling");
ItemType.Typed<ItemMeta> DARK_OAK_SAPLING = getItemType("dark_oak_sapling");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_SAPLING = getItemType("pale_oak_sapling");
ItemType.Typed<ItemMeta> MANGROVE_PROPAGULE = getItemType("mangrove_propagule");
ItemType.Typed<ItemMeta> BEDROCK = getItemType("bedrock");
ItemType.Typed<ItemMeta> SAND = getItemType("sand");
@@ -237,6 +244,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_LOG = getItemType("acacia_log");
ItemType.Typed<ItemMeta> CHERRY_LOG = getItemType("cherry_log");
ItemType.Typed<ItemMeta> DARK_OAK_LOG = getItemType("dark_oak_log");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_LOG = getItemType("pale_oak_log");
ItemType.Typed<ItemMeta> MANGROVE_LOG = getItemType("mangrove_log");
ItemType.Typed<ItemMeta> MANGROVE_ROOTS = getItemType("mangrove_roots");
ItemType.Typed<ItemMeta> MUDDY_MANGROVE_ROOTS = getItemType("muddy_mangrove_roots");
@@ -250,6 +260,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> STRIPPED_ACACIA_LOG = getItemType("stripped_acacia_log");
ItemType.Typed<ItemMeta> STRIPPED_CHERRY_LOG = getItemType("stripped_cherry_log");
ItemType.Typed<ItemMeta> STRIPPED_DARK_OAK_LOG = getItemType("stripped_dark_oak_log");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> STRIPPED_PALE_OAK_LOG = getItemType("stripped_pale_oak_log");
ItemType.Typed<ItemMeta> STRIPPED_MANGROVE_LOG = getItemType("stripped_mangrove_log");
ItemType.Typed<ItemMeta> STRIPPED_CRIMSON_STEM = getItemType("stripped_crimson_stem");
ItemType.Typed<ItemMeta> STRIPPED_WARPED_STEM = getItemType("stripped_warped_stem");
@@ -260,6 +273,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> STRIPPED_ACACIA_WOOD = getItemType("stripped_acacia_wood");
ItemType.Typed<ItemMeta> STRIPPED_CHERRY_WOOD = getItemType("stripped_cherry_wood");
ItemType.Typed<ItemMeta> STRIPPED_DARK_OAK_WOOD = getItemType("stripped_dark_oak_wood");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> STRIPPED_PALE_OAK_WOOD = getItemType("stripped_pale_oak_wood");
ItemType.Typed<ItemMeta> STRIPPED_MANGROVE_WOOD = getItemType("stripped_mangrove_wood");
ItemType.Typed<ItemMeta> STRIPPED_CRIMSON_HYPHAE = getItemType("stripped_crimson_hyphae");
ItemType.Typed<ItemMeta> STRIPPED_WARPED_HYPHAE = getItemType("stripped_warped_hyphae");
@@ -271,6 +287,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_WOOD = getItemType("acacia_wood");
ItemType.Typed<ItemMeta> CHERRY_WOOD = getItemType("cherry_wood");
ItemType.Typed<ItemMeta> DARK_OAK_WOOD = getItemType("dark_oak_wood");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_WOOD = getItemType("pale_oak_wood");
ItemType.Typed<ItemMeta> MANGROVE_WOOD = getItemType("mangrove_wood");
ItemType.Typed<ItemMeta> CRIMSON_HYPHAE = getItemType("crimson_hyphae");
ItemType.Typed<ItemMeta> WARPED_HYPHAE = getItemType("warped_hyphae");
@@ -281,6 +300,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_LEAVES = getItemType("acacia_leaves");
ItemType.Typed<ItemMeta> CHERRY_LEAVES = getItemType("cherry_leaves");
ItemType.Typed<ItemMeta> DARK_OAK_LEAVES = getItemType("dark_oak_leaves");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_LEAVES = getItemType("pale_oak_leaves");
ItemType.Typed<ItemMeta> MANGROVE_LEAVES = getItemType("mangrove_leaves");
ItemType.Typed<ItemMeta> AZALEA_LEAVES = getItemType("azalea_leaves");
ItemType.Typed<ItemMeta> FLOWERING_AZALEA_LEAVES = getItemType("flowering_azalea_leaves");
@@ -343,9 +365,18 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> TWISTING_VINES = getItemType("twisting_vines");
ItemType.Typed<ItemMeta> SUGAR_CANE = getItemType("sugar_cane");
ItemType.Typed<ItemMeta> KELP = getItemType("kelp");
ItemType.Typed<ItemMeta> MOSS_CARPET = getItemType("moss_carpet");
ItemType.Typed<ItemMeta> PINK_PETALS = getItemType("pink_petals");
ItemType.Typed<ItemMeta> MOSS_CARPET = getItemType("moss_carpet");
ItemType.Typed<ItemMeta> MOSS_BLOCK = getItemType("moss_block");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_MOSS_CARPET = getItemType("pale_moss_carpet");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_HANGING_MOSS = getItemType("pale_hanging_moss");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_MOSS_BLOCK = getItemType("pale_moss_block");
ItemType.Typed<ItemMeta> HANGING_ROOTS = getItemType("hanging_roots");
ItemType.Typed<ItemMeta> BIG_DRIPLEAF = getItemType("big_dripleaf");
ItemType.Typed<ItemMeta> SMALL_DRIPLEAF = getItemType("small_dripleaf");
@@ -357,6 +388,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_SLAB = getItemType("acacia_slab");
ItemType.Typed<ItemMeta> CHERRY_SLAB = getItemType("cherry_slab");
ItemType.Typed<ItemMeta> DARK_OAK_SLAB = getItemType("dark_oak_slab");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_SLAB = getItemType("pale_oak_slab");
ItemType.Typed<ItemMeta> MANGROVE_SLAB = getItemType("mangrove_slab");
ItemType.Typed<ItemMeta> BAMBOO_SLAB = getItemType("bamboo_slab");
ItemType.Typed<ItemMeta> BAMBOO_MOSAIC_SLAB = getItemType("bamboo_mosaic_slab");
@@ -406,6 +440,12 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link BlockStateMeta}
*/
ItemType.Typed<BlockStateMeta> SPAWNER = getItemType("spawner");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<BlockStateMeta> CREAKING_HEART = getItemType("creaking_heart");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@@ -434,6 +474,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_FENCE = getItemType("acacia_fence");
ItemType.Typed<ItemMeta> CHERRY_FENCE = getItemType("cherry_fence");
ItemType.Typed<ItemMeta> DARK_OAK_FENCE = getItemType("dark_oak_fence");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_FENCE = getItemType("pale_oak_fence");
ItemType.Typed<ItemMeta> MANGROVE_FENCE = getItemType("mangrove_fence");
ItemType.Typed<ItemMeta> BAMBOO_FENCE = getItemType("bamboo_fence");
ItemType.Typed<ItemMeta> CRIMSON_FENCE = getItemType("crimson_fence");
@@ -518,6 +561,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_STAIRS = getItemType("acacia_stairs");
ItemType.Typed<ItemMeta> CHERRY_STAIRS = getItemType("cherry_stairs");
ItemType.Typed<ItemMeta> DARK_OAK_STAIRS = getItemType("dark_oak_stairs");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_STAIRS = getItemType("pale_oak_stairs");
ItemType.Typed<ItemMeta> MANGROVE_STAIRS = getItemType("mangrove_stairs");
ItemType.Typed<ItemMeta> BAMBOO_STAIRS = getItemType("bamboo_stairs");
ItemType.Typed<ItemMeta> BAMBOO_MOSAIC_STAIRS = getItemType("bamboo_mosaic_stairs");
@@ -909,6 +955,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_BUTTON = getItemType("acacia_button");
ItemType.Typed<ItemMeta> CHERRY_BUTTON = getItemType("cherry_button");
ItemType.Typed<ItemMeta> DARK_OAK_BUTTON = getItemType("dark_oak_button");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_BUTTON = getItemType("pale_oak_button");
ItemType.Typed<ItemMeta> MANGROVE_BUTTON = getItemType("mangrove_button");
ItemType.Typed<ItemMeta> BAMBOO_BUTTON = getItemType("bamboo_button");
ItemType.Typed<ItemMeta> CRIMSON_BUTTON = getItemType("crimson_button");
@@ -924,6 +973,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_PRESSURE_PLATE = getItemType("acacia_pressure_plate");
ItemType.Typed<ItemMeta> CHERRY_PRESSURE_PLATE = getItemType("cherry_pressure_plate");
ItemType.Typed<ItemMeta> DARK_OAK_PRESSURE_PLATE = getItemType("dark_oak_pressure_plate");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_PRESSURE_PLATE = getItemType("pale_oak_pressure_plate");
ItemType.Typed<ItemMeta> MANGROVE_PRESSURE_PLATE = getItemType("mangrove_pressure_plate");
ItemType.Typed<ItemMeta> BAMBOO_PRESSURE_PLATE = getItemType("bamboo_pressure_plate");
ItemType.Typed<ItemMeta> CRIMSON_PRESSURE_PLATE = getItemType("crimson_pressure_plate");
@@ -936,6 +988,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_DOOR = getItemType("acacia_door");
ItemType.Typed<ItemMeta> CHERRY_DOOR = getItemType("cherry_door");
ItemType.Typed<ItemMeta> DARK_OAK_DOOR = getItemType("dark_oak_door");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_DOOR = getItemType("pale_oak_door");
ItemType.Typed<ItemMeta> MANGROVE_DOOR = getItemType("mangrove_door");
ItemType.Typed<ItemMeta> BAMBOO_DOOR = getItemType("bamboo_door");
ItemType.Typed<ItemMeta> CRIMSON_DOOR = getItemType("crimson_door");
@@ -956,6 +1011,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_TRAPDOOR = getItemType("acacia_trapdoor");
ItemType.Typed<ItemMeta> CHERRY_TRAPDOOR = getItemType("cherry_trapdoor");
ItemType.Typed<ItemMeta> DARK_OAK_TRAPDOOR = getItemType("dark_oak_trapdoor");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_TRAPDOOR = getItemType("pale_oak_trapdoor");
ItemType.Typed<ItemMeta> MANGROVE_TRAPDOOR = getItemType("mangrove_trapdoor");
ItemType.Typed<ItemMeta> BAMBOO_TRAPDOOR = getItemType("bamboo_trapdoor");
ItemType.Typed<ItemMeta> CRIMSON_TRAPDOOR = getItemType("crimson_trapdoor");
@@ -975,6 +1033,9 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> ACACIA_FENCE_GATE = getItemType("acacia_fence_gate");
ItemType.Typed<ItemMeta> CHERRY_FENCE_GATE = getItemType("cherry_fence_gate");
ItemType.Typed<ItemMeta> DARK_OAK_FENCE_GATE = getItemType("dark_oak_fence_gate");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_FENCE_GATE = getItemType("pale_oak_fence_gate");
ItemType.Typed<ItemMeta> MANGROVE_FENCE_GATE = getItemType("mangrove_fence_gate");
ItemType.Typed<ItemMeta> BAMBOO_FENCE_GATE = getItemType("bamboo_fence_gate");
ItemType.Typed<ItemMeta> CRIMSON_FENCE_GATE = getItemType("crimson_fence_gate");
@@ -991,6 +1052,7 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> HOPPER_MINECART = getItemType("hopper_minecart");
ItemType.Typed<ItemMeta> CARROT_ON_A_STICK = getItemType("carrot_on_a_stick");
ItemType.Typed<ItemMeta> WARPED_FUNGUS_ON_A_STICK = getItemType("warped_fungus_on_a_stick");
ItemType.Typed<ItemMeta> PHANTOM_MEMBRANE = getItemType("phantom_membrane");
ItemType.Typed<ItemMeta> ELYTRA = getItemType("elytra");
ItemType.Typed<ItemMeta> OAK_BOAT = getItemType("oak_boat");
ItemType.Typed<ItemMeta> OAK_CHEST_BOAT = getItemType("oak_chest_boat");
@@ -1006,6 +1068,12 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> CHERRY_CHEST_BOAT = getItemType("cherry_chest_boat");
ItemType.Typed<ItemMeta> DARK_OAK_BOAT = getItemType("dark_oak_boat");
ItemType.Typed<ItemMeta> DARK_OAK_CHEST_BOAT = getItemType("dark_oak_chest_boat");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_BOAT = getItemType("pale_oak_boat");
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<ItemMeta> PALE_OAK_CHEST_BOAT = getItemType("pale_oak_chest_boat");
ItemType.Typed<ItemMeta> MANGROVE_BOAT = getItemType("mangrove_boat");
ItemType.Typed<ItemMeta> MANGROVE_CHEST_BOAT = getItemType("mangrove_chest_boat");
ItemType.Typed<ItemMeta> BAMBOO_RAFT = getItemType("bamboo_raft");
@@ -1216,6 +1284,12 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link BlockStateMeta}
*/
ItemType.Typed<BlockStateMeta> DARK_OAK_SIGN = getItemType("dark_oak_sign");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<BlockStateMeta> PALE_OAK_SIGN = getItemType("pale_oak_sign");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@@ -1260,6 +1334,12 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link BlockStateMeta}
*/
ItemType.Typed<BlockStateMeta> DARK_OAK_HANGING_SIGN = getItemType("dark_oak_hanging_sign");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<BlockStateMeta> PALE_OAK_HANGING_SIGN = getItemType("pale_oak_hanging_sign");
/**
* ItemMeta: {@link BlockStateMeta}
*/
@@ -1311,6 +1391,70 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> BUNDLE = getItemType("bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> WHITE_BUNDLE = getItemType("white_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> ORANGE_BUNDLE = getItemType("orange_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> MAGENTA_BUNDLE = getItemType("magenta_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> LIGHT_BLUE_BUNDLE = getItemType("light_blue_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> YELLOW_BUNDLE = getItemType("yellow_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> LIME_BUNDLE = getItemType("lime_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> PINK_BUNDLE = getItemType("pink_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> GRAY_BUNDLE = getItemType("gray_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> LIGHT_GRAY_BUNDLE = getItemType("light_gray_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> CYAN_BUNDLE = getItemType("cyan_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> PURPLE_BUNDLE = getItemType("purple_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> BLUE_BUNDLE = getItemType("blue_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> BROWN_BUNDLE = getItemType("brown_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> GREEN_BUNDLE = getItemType("green_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> RED_BUNDLE = getItemType("red_bundle");
/**
* ItemMeta: {@link BundleMeta}
*/
ItemType.Typed<BundleMeta> BLACK_BUNDLE = getItemType("black_bundle");
ItemType.Typed<ItemMeta> FISHING_ROD = getItemType("fishing_rod");
ItemType.Typed<ItemMeta> CLOCK = getItemType("clock");
ItemType.Typed<ItemMeta> SPYGLASS = getItemType("spyglass");
@@ -1384,11 +1528,11 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> GHAST_TEAR = getItemType("ghast_tear");
ItemType.Typed<ItemMeta> GOLD_NUGGET = getItemType("gold_nugget");
ItemType.Typed<ItemMeta> NETHER_WART = getItemType("nether_wart");
ItemType.Typed<ItemMeta> GLASS_BOTTLE = getItemType("glass_bottle");
/**
* ItemMeta: {@link PotionMeta}
*/
ItemType.Typed<PotionMeta> POTION = getItemType("potion");
ItemType.Typed<ItemMeta> GLASS_BOTTLE = getItemType("glass_bottle");
ItemType.Typed<ItemMeta> SPIDER_EYE = getItemType("spider_eye");
ItemType.Typed<ItemMeta> FERMENTED_SPIDER_EYE = getItemType("fermented_spider_eye");
ItemType.Typed<ItemMeta> BLAZE_POWDER = getItemType("blaze_powder");
@@ -1456,6 +1600,12 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link SpawnEggMeta}
*/
ItemType.Typed<SpawnEggMeta> COW_SPAWN_EGG = getItemType("cow_spawn_egg");
/**
* ItemMeta: {@link SpawnEggMeta}
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP)
ItemType.Typed<SpawnEggMeta> CREAKING_SPAWN_EGG = getItemType("creaking_spawn_egg");
/**
* ItemMeta: {@link SpawnEggMeta}
*/
@@ -1731,6 +1881,7 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link BookMeta}
*/
ItemType.Typed<BookMeta> WRITTEN_BOOK = getItemType("written_book");
ItemType.Typed<ItemMeta> BREEZE_ROD = getItemType("breeze_rod");
ItemType.Typed<ItemMeta> MACE = getItemType("mace");
ItemType.Typed<ItemMeta> ITEM_FRAME = getItemType("item_frame");
ItemType.Typed<ItemMeta> GLOW_ITEM_FRAME = getItemType("glow_item_frame");
@@ -1923,7 +2074,6 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> MUSIC_DISC_PRECIPICE = getItemType("music_disc_precipice");
ItemType.Typed<ItemMeta> DISC_FRAGMENT_5 = getItemType("disc_fragment_5");
ItemType.Typed<ItemMeta> TRIDENT = getItemType("trident");
ItemType.Typed<ItemMeta> PHANTOM_MEMBRANE = getItemType("phantom_membrane");
ItemType.Typed<ItemMeta> NAUTILUS_SHELL = getItemType("nautilus_shell");
ItemType.Typed<ItemMeta> HEART_OF_THE_SEA = getItemType("heart_of_the_sea");
/**
@@ -1943,6 +2093,8 @@ public interface ItemType extends Keyed, Translatable {
ItemType.Typed<ItemMeta> PIGLIN_BANNER_PATTERN = getItemType("piglin_banner_pattern");
ItemType.Typed<ItemMeta> FLOW_BANNER_PATTERN = getItemType("flow_banner_pattern");
ItemType.Typed<ItemMeta> GUSTER_BANNER_PATTERN = getItemType("guster_banner_pattern");
ItemType.Typed<ItemMeta> FIELD_MASONED_BANNER_PATTERN = getItemType("field_masoned_banner_pattern");
ItemType.Typed<ItemMeta> BORDURE_INDENTED_BANNER_PATTERN = getItemType("bordure_indented_banner_pattern");
/**
* ItemMeta: {@link MusicInstrumentMeta}
*/
@@ -2108,7 +2260,6 @@ public interface ItemType extends Keyed, Translatable {
* ItemMeta: {@link OminousBottleMeta}
*/
ItemType.Typed<OminousBottleMeta> OMINOUS_BOTTLE = getItemType("ominous_bottle");
ItemType.Typed<ItemMeta> BREEZE_ROD = getItemType("breeze_rod");
//</editor-fold>
@NotNull

View File

@@ -0,0 +1,52 @@
package org.bukkit.inventory;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
/**
* Represents a recipe which will change the type of the input material when
* combined with an additional material, but preserve all custom data. Only the
* item type of the result stack will be used.
* <br>
* Used for dyeing shulker boxes in Vanilla.
*/
public class TransmuteRecipe extends CraftingRecipe implements ComplexRecipe {
private final RecipeChoice input;
private final RecipeChoice material;
/**
* Create a transmute recipe to produce a result of the specified type.
*
* @param key the unique recipe key
* @param result the transmuted result material
* @param input the input ingredient
* @param material the additional ingredient
*/
public TransmuteRecipe(@NotNull NamespacedKey key, @NotNull Material result, @NotNull RecipeChoice input, @NotNull RecipeChoice material) {
super(key, checkResult(new ItemStack(result)));
this.input = input;
this.material = material;
}
/**
* Gets the input material, which will be transmuted.
*
* @return the input from transmutation
*/
@NotNull
public RecipeChoice getInput() {
return input.clone();
}
/**
* Gets the additional material required to cause the transmutation.
*
* @return the ingredient material
*/
@NotNull
public RecipeChoice getMaterial() {
return material.clone();
}
}

View File

@@ -5,19 +5,26 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.NamespacedKey;
import org.bukkit.Tag;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.damage.DamageType;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemFactory;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemRarity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.components.EquippableComponent;
import org.bukkit.inventory.meta.components.FoodComponent;
import org.bukkit.inventory.meta.components.JukeboxPlayableComponent;
import org.bukkit.inventory.meta.components.ToolComponent;
import org.bukkit.inventory.meta.components.UseCooldownComponent;
import org.bukkit.inventory.meta.tags.CustomItemTagContainer;
import org.bukkit.persistence.PersistentDataHolder;
import org.bukkit.tag.DamageTypeTags;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -179,6 +186,27 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
void setCustomModelData(@Nullable Integer data);
/**
* Gets if the enchantable component is set.
*
* @return if an enchantable is set.
*/
boolean hasEnchantable();
/**
* Gets the enchantable component. Higher values allow higher enchantments.
*
* @return max_stack_size
*/
int getEnchantable();
/**
* Sets the enchantable. Higher values allow higher enchantments.
*
* @param enchantable enchantable value
*/
void setEnchantable(@Nullable Integer enchantable);
/**
* Checks for the existence of any enchantments.
*
@@ -292,6 +320,50 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
void setHideTooltip(boolean hideTooltip);
/**
* Gets if this item has a custom tooltip style.
*
* @return if a tooltip_style is set
*/
boolean hasTooltipStyle();
/**
* Gets the custom tooltip style.
*
* @return the tooltip style
*/
@Nullable
NamespacedKey getTooltipStyle();
/**
* Sets the custom tooltip style.
*
* @param tooltipStyle the new style
*/
void setTooltipStyle(@Nullable NamespacedKey tooltipStyle);
/**
* Gets if this item has a custom item model.
*
* @return if a item_model is set
*/
boolean hasItemModel();
/**
* Gets the custom item model.
*
* @return the item model
*/
@Nullable
NamespacedKey getItemModel();
/**
* Sets the custom item model.
*
* @param itemModel the new model
*/
void setItemModel(@Nullable NamespacedKey itemModel);
/**
* Return if the unbreakable tag is true. An unbreakable item will not lose
* durability.
@@ -336,12 +408,31 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
void setEnchantmentGlintOverride(@Nullable Boolean override);
/**
* Checks if this item is a glider. If true, this item will allow players to
* glide when it is equipped.
*
* @return glider
*/
boolean isGlider();
/**
* Sets if this item is a glider. If true, this item will allow players to
* glide when it is equipped.
*
* @param glider glider
*/
void setGlider(boolean glider);
/**
* Checks if this item is fire_resistant. If true, it will not burn in fire
* or lava.
*
* @return fire_resistant
* @deprecated use {@link #getDamageResistant()} and
* {@link DamageTypeTags#IS_FIRE}
*/
@Deprecated
boolean isFireResistant();
/**
@@ -349,9 +440,39 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* or lava.
*
* @param fireResistant fire_resistant
* @deprecated use {@link #setDamageResistant(org.bukkit.Tag)} and
* {@link DamageTypeTags#IS_FIRE}
*/
@Deprecated
void setFireResistant(boolean fireResistant);
/**
* Gets if this item is resistant to certain types of damage.
*
* @return true if a resistance is set
*/
boolean hasDamageResistant();
/**
* Gets the type of damage this item will be resistant to when in entity
* form.
*
* Plugins should check {@link #hasDamageResistant()} before calling this
* method.
*
* @return damage type
*/
@Nullable
Tag<DamageType> getDamageResistant();
/**
* Sets the type of damage this item will be resistant to when in entity
* form.
*
* @param tag the tag, or null to clear
*/
void setDamageResistant(@Nullable Tag<DamageType> tag);
/**
* Gets if the max_stack_size is set.
*
@@ -399,6 +520,61 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
void setRarity(@Nullable ItemRarity rarity);
/**
* Checks if the use remainder is set.
*
* @return if a use remainder item is set
*/
boolean hasUseRemainder();
/**
* Gets the item which this item will convert to when used.
* <p>
* The returned component is a snapshot of its current state and does not
* reflect a live view of what is on an item. After changing any value on
* this component, it must be set with {@link #setUseRemainder(ItemStack)}
* to apply the changes.
*
* @return remainder
*/
@Nullable
ItemStack getUseRemainder();
/**
* Sets the item which this item will convert to when used.
*
* @param remainder new item
*/
void setUseRemainder(@Nullable ItemStack remainder);
/**
* Checks if the use cooldown is set.
*
* @return if a use cooldown is set
*/
boolean hasUseCooldown();
/**
* Gets the use cooldown set on this item, or creates an empty cooldown
* instance.
* <p>
* The returned component is a snapshot of its current state and does not
* reflect a live view of what is on an item. After changing any value on
* this component, it must be set with
* {@link #setUseCooldown(UseCooldownComponent)} to apply the changes.
*
* @return cooldown
*/
@NotNull
UseCooldownComponent getUseCooldown();
/**
* Sets the item use cooldown.
*
* @param cooldown new cooldown
*/
void setUseCooldown(@Nullable UseCooldownComponent cooldown);
/**
* Checks if the food is set.
*
@@ -453,6 +629,34 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
void setTool(@Nullable ToolComponent tool);
/**
* Checks if the equippable is set.
*
* @return if a equippable is set
*/
boolean hasEquippable();
/**
* Gets the equippable set on this item, or creates an empty equippable
* instance.
* <p>
* The returned component is a snapshot of its current state and does not
* reflect a live view of what is on an item. After changing any value on
* this component, it must be set with
* {@link #setEquippable(EquippableComponent)} to apply the changes.
*
* @return equippable
*/
@NotNull
EquippableComponent getEquippable();
/**
* Sets the equippable tool.
*
* @param equippable new equippable
*/
void setEquippable(@Nullable EquippableComponent equippable);
/**
* Checks if the jukebox playable is set.
*

View File

@@ -146,6 +146,31 @@ public interface PotionMeta extends ItemMeta {
*/
void setColor(@Nullable Color color);
/**
* Checks for existence of a custom potion name translation suffix.
*
* @return true if this has a custom potion name
*/
boolean hasCustomName();
/**
* Gets the potion name translation suffix that is set.
* <p>
* Plugins should check that hasCustomName() returns <code>true</code>
* before calling this method.
*
* @return the potion name that is set
*/
@Nullable
String getCustomName();
/**
* Sets the potion name translation suffix.
*
* @param name the name to set
*/
void setCustomName(@Nullable String name);
@Override
PotionMeta clone();
}

View File

@@ -0,0 +1,153 @@
package org.bukkit.inventory.meta.components;
import java.util.Collection;
import org.bukkit.NamespacedKey;
import org.bukkit.Sound;
import org.bukkit.Tag;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.EquipmentSlot;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a component which can turn any item into equippable armor.
*/
@ApiStatus.Experimental
public interface EquippableComponent extends ConfigurationSerializable {
/**
* Gets the slot the item can be equipped to.
*
* @return slot
*/
@NotNull
EquipmentSlot getSlot();
/**
* Sets the slot the item can be equipped to.
*
* @param slot new slot
*/
void setSlot(@NotNull EquipmentSlot slot);
/**
* Gets the sound to play when the item is equipped.
*
* @return the sound
*/
@Nullable
Sound getEquipSound();
/**
* Sets the sound to play when the item is equipped.
*
* @param sound sound or null for current default
*/
void setEquipSound(@Nullable Sound sound);
/**
* Gets the key of the model to use when equipped.
*
* @return model key
*/
@Nullable
NamespacedKey getModel();
/**
* Sets the key of the model to use when equipped.
*
* @param key model key
*/
void setModel(@Nullable NamespacedKey key);
/**
* Gets the key of the camera overlay to use when equipped.
*
* @return camera overlay key
*/
@Nullable
NamespacedKey getCameraOverlay();
/**
* Sets the key of the camera overlay to use when equipped.
*
* @param key camera overlay key
*/
void setCameraOverlay(@Nullable NamespacedKey key);
/**
* Gets the entities which can equip this item.
*
* @return the entities
*/
@Nullable
Collection<EntityType> getAllowedEntities();
/**
* Sets the entities which can equip this item.
*
* @param entities the entity types
*/
void setAllowedEntities(@Nullable EntityType entities);
/**
* Sets the entities which can equip this item.
*
* @param entities the entity types
*/
void setAllowedEntities(@Nullable Collection<EntityType> entities);
/**
* Set the entity types (represented as an entity {@link Tag}) which can
* equip this item.
*
* @param tag the entity tag
* @throws IllegalArgumentException if the passed {@code tag} is not an entity
* tag
*/
void setAllowedEntities(@Nullable Tag<EntityType> tag);
/**
* Gets whether the item can be equipped by a dispenser.
*
* @return equippable status
*/
boolean isDispensable();
/**
* Sets whether the item can be equipped by a dispenser.
*
* @param dispensable new equippable status
*/
void setDispensable(boolean dispensable);
/**
* Gets if the item is swappable by right clicking.
*
* @return swappable status
*/
boolean isSwappable();
/**
* Sets if the item is swappable by right clicking.
*
* @param swappable new status
*/
void setSwappable(boolean swappable);
/**
* Gets if the item will be damaged when the wearing entity is damaged.
*
* @return whether the item will be damaged
*/
boolean isDamageOnHurt();
/**
* Sets if the item will be damaged when the wearing entity is damaged.
*
* @param damage whether the item will be damaged
*/
void setDamageOnHurt(boolean damage);
}

View File

@@ -1,12 +1,7 @@
package org.bukkit.inventory.meta.components;
import java.util.List;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a component which can turn any item into food.
@@ -55,93 +50,4 @@ public interface FoodComponent extends ConfigurationSerializable {
* @param canAlwaysEat whether always edible
*/
void setCanAlwaysEat(boolean canAlwaysEat);
/**
* Gets the time in seconds it will take for this item to be eaten.
*
* @return eat time
*/
float getEatSeconds();
/**
* Sets the time in seconds it will take for this item to be eaten.
*
* @param eatSeconds new eat time
*/
void setEatSeconds(float eatSeconds);
/**
* Gets the item this food will convert to once eaten.
*
* @return converted item
*/
@Nullable
ItemStack getUsingConvertsTo();
/**
* Sets the item this food will convert to once eaten.
*
* @param item converted item
*/
void setUsingConvertsTo(@Nullable ItemStack item);
/**
* Gets the effects which may be applied by this item when eaten.
*
* @return food effects
*/
@NotNull
List<FoodEffect> getEffects();
/**
* Sets the effects which may be applied by this item when eaten.
*
* @param effects new effects
*/
void setEffects(@NotNull List<FoodEffect> effects);
/**
* Adds an effect which may be applied by this item when eaten.
*
* @param effect the effect
* @param probability the probability of the effect being applied
* @return the added effect
*/
@NotNull
FoodEffect addEffect(@NotNull PotionEffect effect, float probability);
/**
* An effect which may be applied by this item when eaten.
*/
public interface FoodEffect extends ConfigurationSerializable {
/**
* Gets the effect which may be applied.
*
* @return the effect
*/
@NotNull
PotionEffect getEffect();
/**
* Sets the effect which may be applied.
*
* @param effect the new effect
*/
void setEffect(@NotNull PotionEffect effect);
/**
* Gets the probability of this effect being applied.
*
* @return probability
*/
float getProbability();
/**
* Sets the probability of this effect being applied.
*
* @param probability between 0 and 1 inclusive.
*/
void setProbability(float probability);
}
}

View File

@@ -0,0 +1,43 @@
package org.bukkit.inventory.meta.components;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
/**
* Represents a component which determines the cooldown applied to use of this
* item.
*/
@ApiStatus.Experimental
public interface UseCooldownComponent extends ConfigurationSerializable {
/**
* Gets the time in seconds it will take for this item to be eaten.
*
* @return eat time
*/
float getCooldownSeconds();
/**
* Sets the time in seconds it will take for this item to be eaten.
*
* @param eatSeconds new eat time, must be positive
*/
void setCooldownSeconds(float eatSeconds);
/**
* Gets the custom cooldown group to be used for similar items, if set.
*
* @return the cooldown group
*/
@Nullable
NamespacedKey getCooldownGroup();
/**
* Sets the custom cooldown group to be used for similar items.
*
* @param song the cooldown group
*/
void setCooldownGroup(@Nullable NamespacedKey song);
}