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
ConstructorsConstructorDescriptionSlimefunItemStack(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 booleangetItem()Gets theSlimefunItemassociated for thisSlimefunItemStack.<T extends SlimefunItem>
TThis method returns the associatedSlimefunItemand casts it to the providedClass.final StringReturns the id that was given to thisSlimefunItemStack.io.github.bakedlibs.dough.items.ItemMetaSnapshotfinal inthashCode()voidlock()voidsetAmount(int amount) booleansetItemMeta(ItemMeta meta) voidtoString()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
SlimefunItemid for thisSlimefunItemStack
-
getItem
Gets theSlimefunItemassociated for thisSlimefunItemStack. Null if no item is found.- Returns:
- The
SlimefunItemfor thisSlimefunItemStack, null if not found.
-
getItem
This method returns the associatedSlimefunItemand casts it to the providedClass. If no item was found or the foundSlimefunItemis not of the requested type, the method will return null.- Type Parameters:
T- The type ofSlimefunItemto cast this to- Parameters:
type- TheClassof the targetSlimefunItem- Returns:
- The
SlimefunItemthisSlimefunItemrepresents, casted to the given type
-
getItemMetaSnapshot
@Nonnull public io.github.bakedlibs.dough.items.ItemMetaSnapshot getItemMetaSnapshot() -
setItemMeta
- Overrides:
setItemMetain classItemStack
-
setType
-
setAmount
public void setAmount(int amount) -
lock
public void lock() -
getSkullTexture
-
getDisplayName
-
clone
-
toString
-
equals
-
hashCode
public final int hashCode()
-