Some cleanup

This commit is contained in:
DerFrZocker 2024-06-03 20:04:07 +02:00
parent ce9e4e791e
commit 58534cdf9e
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
15 changed files with 37 additions and 21 deletions

View file

@ -41,6 +41,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemCraftResult; import org.bukkit.inventory.ItemCraftResult;
import org.bukkit.inventory.ItemFactory; import org.bukkit.inventory.ItemFactory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.bukkit.inventory.Merchant; import org.bukkit.inventory.Merchant;
import org.bukkit.inventory.Recipe; import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
@ -1052,7 +1053,7 @@ public final class Bukkit {
* @param world The world the crafting takes place in. * @param world The world the crafting takes place in.
* @param player The player to imitate the crafting event on. * @param player The player to imitate the crafting event on.
* @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found * @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found
* an ItemStack of {@link org.bukkit.inventory.ItemType#AIR} is returned. * an ItemStack of {@link ItemType#AIR} is returned.
*/ */
@NotNull @NotNull
public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) { public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) {
@ -1075,7 +1076,7 @@ public final class Bukkit {
* Must not contain more than 9 items. * Must not contain more than 9 items.
* @param world The world the crafting takes place in. * @param world The world the crafting takes place in.
* @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found * @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link ItemType#AIR} is returned.
*/ */
@NotNull @NotNull
public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world) { public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world) {

View file

@ -41,6 +41,7 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemCraftResult; import org.bukkit.inventory.ItemCraftResult;
import org.bukkit.inventory.ItemFactory; import org.bukkit.inventory.ItemFactory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.bukkit.inventory.Merchant; import org.bukkit.inventory.Merchant;
import org.bukkit.inventory.Recipe; import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
@ -858,7 +859,7 @@ public interface Server extends PluginMessageRecipient {
* @param world The world the crafting takes place in. * @param world The world the crafting takes place in.
* @param player The player to imitate the crafting event on. * @param player The player to imitate the crafting event on.
* @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found * @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found
* an ItemStack of {@link org.bukkit.inventory.ItemType#AIR} is returned. * an ItemStack of {@link ItemType#AIR} is returned.
*/ */
@NotNull @NotNull
public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player); public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player);
@ -879,7 +880,7 @@ public interface Server extends PluginMessageRecipient {
* Must not contain more than 9 items. * Must not contain more than 9 items.
* @param world The world the crafting takes place in. * @param world The world the crafting takes place in.
* @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found * @return the {@link ItemStack} resulting from the given crafting matrix, if no recipe is found
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link ItemType#AIR} is returned.
*/ */
@NotNull @NotNull
public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world); public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world);

View file

@ -1,8 +1,10 @@
package org.bukkit; package org.bukkit;
import org.bukkit.block.BlockType;
/** /**
* Represents the different types of skulls. * Represents the different types of skulls.
* @deprecated check {@link org.bukkit.block.BlockType} instead * @deprecated check {@link BlockType} instead
*/ */
@Deprecated @Deprecated
public enum SkullType { public enum SkullType {

View file

@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableMap;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import org.bukkit.inventory.ItemType;
import org.bukkit.map.MapCursor; import org.bukkit.map.MapCursor;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -58,7 +59,7 @@ public final class StructureType implements Keyed {
* Strongholds are underground structures that consist of many rooms, * Strongholds are underground structures that consist of many rooms,
* libraries, and an end portal room. * libraries, and an end portal room.
* <br> * <br>
* They can be found using an {@link org.bukkit.inventory.ItemType#ENDER_EYE}. * They can be found using an {@link ItemType#ENDER_EYE}.
*/ */
public static final StructureType STRONGHOLD = register(new StructureType("stronghold", MapCursor.Type.MANSION)); public static final StructureType STRONGHOLD = register(new StructureType("stronghold", MapCursor.Type.MANSION));

View file

@ -95,6 +95,8 @@ public interface UnsafeValues {
String getTranslationKey(EntityType entityType); String getTranslationKey(EntityType entityType);
String getTranslationKey(Attribute attribute);
String getTranslationKey(ItemStack itemStack); String getTranslationKey(ItemStack itemStack);
@Nullable @Nullable

View file

@ -879,7 +879,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* a certain location. This will not actually change the world in any way. * a certain location. This will not actually change the world in any way.
* This method will use a sign at the location's block or a faked sign * This method will use a sign at the location's block or a faked sign
* sent via * sent via
* {@link #sendBlockChange(Location, BlockData)}. * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData)}.
* <p> * <p>
* If the client does not have a sign at the given location it will * If the client does not have a sign at the given location it will
* display an error message to the user. * display an error message to the user.
@ -899,7 +899,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* a certain location. This will not actually change the world in any way. * a certain location. This will not actually change the world in any way.
* This method will use a sign at the location's block or a faked sign * This method will use a sign at the location's block or a faked sign
* sent via * sent via
* {@link #sendBlockChange(Location, BlockData)}. * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData)}.
* <p> * <p>
* If the client does not have a sign at the given location it will * If the client does not have a sign at the given location it will
* display an error message to the user. * display an error message to the user.
@ -921,7 +921,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* a certain location. This will not actually change the world in any way. * a certain location. This will not actually change the world in any way.
* This method will use a sign at the location's block or a faked sign * This method will use a sign at the location's block or a faked sign
* sent via * sent via
* {@link #sendBlockChange(Location, BlockData)}. * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData)}.
* <p> * <p>
* If the client does not have a sign at the given location it will * If the client does not have a sign at the given location it will
* display an error message to the user. * display an error message to the user.

View file

@ -2,6 +2,7 @@ package org.bukkit.entity;
import java.util.Collection; import java.util.Collection;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -33,8 +34,8 @@ public interface ThrownPotion extends ThrowableProjectile {
/** /**
* Set the ItemStack for this thrown potion. * Set the ItemStack for this thrown potion.
* <p> * <p>
* The ItemStack must be of type {@link org.bukkit.inventory.ItemType#SPLASH_POTION} * The ItemStack must be of type {@link ItemType#SPLASH_POTION}
* or {@link org.bukkit.inventory.ItemType#LINGERING_POTION}, otherwise an exception * or {@link ItemType#LINGERING_POTION}, otherwise an exception
* is thrown. * is thrown.
* *
* @param item New ItemStack * @param item New ItemStack

View file

@ -8,6 +8,7 @@ import java.util.EnumMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import org.bukkit.WorldBorder; import org.bukkit.WorldBorder;
import org.bukkit.block.BlockType;
import org.bukkit.damage.DamageSource; import org.bukkit.damage.DamageSource;
import org.bukkit.damage.DamageType; import org.bukkit.damage.DamageType;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -457,7 +458,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
*/ */
FLY_INTO_WALL, FLY_INTO_WALL,
/** /**
* Damage caused when an entity steps on {@link org.bukkit.block.BlockType#MAGMA_BLOCK}. * Damage caused when an entity steps on {@link BlockType#MAGMA_BLOCK}.
* <p> * <p>
* Damage: 1 * Damage: 1
*/ */

View file

@ -1,5 +1,7 @@
package org.bukkit.event.inventory; package org.bukkit.event.inventory;
import org.bukkit.inventory.ItemType;
/** /**
* An estimation of what the result will be. * An estimation of what the result will be.
*/ */
@ -84,7 +86,7 @@ public enum InventoryAction {
CLONE_STACK, CLONE_STACK,
/** /**
* The inventory is searched for the same item type, and they are put on * The inventory is searched for the same item type, and they are put on
* the cursor up to {@link org.bukkit.inventory.ItemType#getMaxStackSize()}. * the cursor up to {@link ItemType#getMaxStackSize()}.
*/ */
COLLECT_TO_CURSOR, COLLECT_TO_CURSOR,
/** /**

View file

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@ -41,7 +42,7 @@ public class PlayerBucketEntityEvent extends PlayerEvent implements Cancellable
/** /**
* Gets the bucket used to capture the {@link Entity}. * Gets the bucket used to capture the {@link Entity}.
* *
* This refers to the bucket clicked with, eg {@link org.bukkit.inventory.ItemType#WATER_BUCKET}. * This refers to the bucket clicked with, eg {@link ItemType#WATER_BUCKET}.
* *
* @return The used bucket * @return The used bucket
*/ */
@ -54,7 +55,7 @@ public class PlayerBucketEntityEvent extends PlayerEvent implements Cancellable
* Gets the bucket that the {@link Entity} will be put into. * Gets the bucket that the {@link Entity} will be put into.
* *
* This refers to the bucket with the entity, eg * This refers to the bucket with the entity, eg
* {@link org.bukkit.inventory.ItemType#PUFFERFISH_BUCKET}. * {@link ItemType#PUFFERFISH_BUCKET}.
* *
* @return The bucket that the {@link Entity} will be put into * @return The bucket that the {@link Entity} will be put into
*/ */

View file

@ -5,6 +5,7 @@ import org.bukkit.entity.Fish;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@ -34,7 +35,7 @@ public class PlayerBucketFishEvent extends PlayerBucketEntityEvent {
/** /**
* Gets the bucket used. * Gets the bucket used.
* *
* This refers to the bucket clicked with, ie {@link org.bukkit.inventory.ItemType#WATER_BUCKET}. * This refers to the bucket clicked with, ie {@link ItemType#WATER_BUCKET}.
* *
* @return The used bucket * @return The used bucket
* @deprecated Use {@link #getOriginalBucket()} * @deprecated Use {@link #getOriginalBucket()}
@ -49,7 +50,7 @@ public class PlayerBucketFishEvent extends PlayerBucketEntityEvent {
* Gets the bucket that the fish will be put into. * Gets the bucket that the fish will be put into.
* *
* This refers to the bucket with the fish, ie * This refers to the bucket with the fish, ie
* {@link org.bukkit.inventory.ItemType#PUFFERFISH_BUCKET}. * {@link ItemType#PUFFERFISH_BUCKET}.
* *
* @return The bucket that the fish will be put into * @return The bucket that the fish will be put into
* @deprecated Use {@link #getEntityBucket()} * @deprecated Use {@link #getEntityBucket()}

View file

@ -18,7 +18,7 @@ public interface BlockDataMeta extends ItemMeta {
* one if one doesn't exist. * one if one doesn't exist.
* *
* The state is a copy, it must be set back (or to another item) with * The state is a copy, it must be set back (or to another item) with
* {@link #setBlockData(BlockData)} * {@link #setBlockData(org.bukkit.block.data.BlockData)}
* *
* @param blockType the block type we wish to get this data in the context of * @param blockType the block type we wish to get this data in the context of
* @return the attached data or new data * @return the attached data or new data

View file

@ -2,11 +2,12 @@ package org.bukkit.inventory.meta;
import java.util.Map; import java.util.Map;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
* EnchantmentMeta is specific to items that can <i>store</i> enchantments, as * EnchantmentMeta is specific to items that can <i>store</i> enchantments, as
* opposed to being enchanted. {@link org.bukkit.inventory.ItemType#ENCHANTED_BOOK} is an example * opposed to being enchanted. {@link ItemType#ENCHANTED_BOOK} is an example
* of an item with enchantment storage. * of an item with enchantment storage.
*/ */
public interface EnchantmentStorageMeta extends ItemMeta { public interface EnchantmentStorageMeta extends ItemMeta {

View file

@ -1,12 +1,13 @@
package org.bukkit.inventory.meta; package org.bukkit.inventory.meta;
import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
/** /**
* Represents a meta that can store a single FireworkEffect. An example * Represents a meta that can store a single FireworkEffect. An example
* includes {@link org.bukkit.inventory.ItemType#FIREWORK_STAR}. * includes {@link ItemType#FIREWORK_STAR}.
*/ */
public interface FireworkEffectMeta extends ItemMeta { public interface FireworkEffectMeta extends ItemMeta {

View file

@ -2,10 +2,11 @@ package org.bukkit.inventory.meta;
import java.util.List; import java.util.List;
import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
* Represents a {@link org.bukkit.inventory.ItemType#FIREWORK_ROCKET} and its effects. * Represents a {@link ItemType#FIREWORK_ROCKET} and its effects.
*/ */
public interface FireworkMeta extends ItemMeta { public interface FireworkMeta extends ItemMeta {