SPIGOT-4802: Add CrossbowMeta

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2019-05-01 20:17:56 +10:00
parent d41f921727
commit 191b0147cd

View file

@ -0,0 +1,43 @@
package org.bukkit.inventory.meta;
import java.util.List;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface CrossbowMeta extends ItemMeta {
/**
* Returns whether the item has any charged projectiles.
*
* @return whether charged projectiles are present
*/
boolean hasChargedProjectiles();
/**
* Returns an immutable list of the projectiles charged on this item.
*
* @return charged projectiles
*/
@NotNull
List<ItemStack> getChargedProjectiles();
/**
* Sets the projectiles charged on this item.
*
* Removes all projectiles when given null.
*
* @param projectiles
* @throws IllegalArgumentException if one of the projectiles is not an
* arrow
*/
void setChargedProjectiles(@Nullable List<ItemStack> projectiles);
/**
* Adds a charged projectile to this item.
*
* @param item projectile
* @throws IllegalArgumentException if the projectile is not an arrow
*/
void addChargedProjectile(@NotNull ItemStack item);
}