Class SlimefunItemStack
java.lang.Object
org.bukkit.inventory.ItemStack
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack
- All Implemented Interfaces:
Cloneable
,ConfigurationSerializable
,Translatable
The
SlimefunItemStack
functions as the base for any
SlimefunItem
.- Author:
- TheBusyBiscuit, Walshy
-
Constructor Summary
ConstructorDescriptionSlimefunItemStack
(SlimefunItemStack item, int amount) SlimefunItemStack
(String id, HeadTexture head, String name, String... lore) SlimefunItemStack
(String id, String texture, String name, String... lore) SlimefunItemStack
(String id, String texture, Consumer<ItemMeta> consumer) SlimefunItemStack
(String id, Color color, PotionEffect effect, String name, String... lore) SlimefunItemStack
(String id, ItemStack item) SlimefunItemStack
(String id, ItemStack item, String name, String... lore) SlimefunItemStack
(String id, ItemStack item, Consumer<ItemMeta> consumer) SlimefunItemStack
(String id, Material type, String name, String... lore) SlimefunItemStack
(String id, Material type, Consumer<ItemMeta> consumer) -
Method Summary
Modifier and TypeMethodDescriptionclone()
final boolean
getItem()
Gets theSlimefunItem
associated for thisSlimefunItemStack
.<T extends SlimefunItem>
TThis method returns the associatedSlimefunItem
and casts it to the providedClass
.final String
Returns the id that was given to thisSlimefunItemStack
.io.github.bakedlibs.dough.items.ItemMetaSnapshot
final int
hashCode()
void
lock()
void
setAmount
(int amount) boolean
setItemMeta
(ItemMeta meta) void
toString()
Methods inherited from class org.bukkit.inventory.ItemStack
addEnchantment, addEnchantments, addUnsafeEnchantment, addUnsafeEnchantments, containsEnchantment, deserialize, getAmount, getData, getDurability, getEnchantmentLevel, getEnchantments, getItemMeta, getMaxStackSize, getTranslationKey, getType, hasItemMeta, isSimilar, removeEnchantment, removeEnchantments, serialize, setData, setDurability
-
Constructor Details
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
public SlimefunItemStack(@Nonnull String id, @Nonnull Color color, @Nonnull PotionEffect effect, @Nullable String name, String... lore) -
SlimefunItemStack
-
SlimefunItemStack
-
SlimefunItemStack
public SlimefunItemStack(@Nonnull String id, @Nonnull HeadTexture head, @Nullable String name, String... lore) -
SlimefunItemStack
-
SlimefunItemStack
-
-
Method Details
-
getItemId
Returns the id that was given to thisSlimefunItemStack
.- Returns:
- The
SlimefunItem
id for thisSlimefunItemStack
-
getItem
Gets theSlimefunItem
associated for thisSlimefunItemStack
. Null if no item is found.- Returns:
- The
SlimefunItem
for thisSlimefunItemStack
, null if not found.
-
getItem
This method returns the associatedSlimefunItem
and casts it to the providedClass
. If no item was found or the foundSlimefunItem
is not of the requested type, the method will return null.- Type Parameters:
T
- The type ofSlimefunItem
to cast this to- Parameters:
type
- TheClass
of the targetSlimefunItem
- Returns:
- The
SlimefunItem
thisSlimefunItem
represents, casted to the given type
-
getItemMetaSnapshot
@Nonnull public io.github.bakedlibs.dough.items.ItemMetaSnapshot getItemMetaSnapshot() -
setItemMeta
- Overrides:
setItemMeta
in classItemStack
-
setType
-
setAmount
public void setAmount(int amount) -
lock
public void lock() -
getSkullTexture
-
getDisplayName
-
clone
-
toString
-
equals
-
hashCode
public final int hashCode()
-