Class RefillableUseItem
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem<io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler>
io.github.thebusybiscuit.slimefun4.implementation.items.LimitedUseItem
dev.sefiraat.sefilib.slimefun.items.RefillableUseItem
- All Implemented Interfaces:
io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
public abstract class RefillableUseItem
extends io.github.thebusybiscuit.slimefun4.implementation.items.LimitedUseItem
A
LimitedUseItem with a method that allows you to refill uses-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRefillableUseItem(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup group, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newRefillableUseItem. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidrefillItem(ItemStack itemStack) Adds a single use back to the itemprotected voidrefillItem(ItemStack itemStack, int refillAmount) Adds the requested number of uses back to the itemprotected voidupdateLore(ItemStack itemStack, ItemMeta itemMeta, int usesLeft) Stolen from the Super class as it's private Refreshes the item lore when adding a use backMethods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.LimitedUseItem
damageItem, getMaxUseCount, getStorageKey, register, setMaxUseCountMethods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem
getItemHandler, preRegisterMethods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, callItemHandler, canUse, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, postRegister, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
RefillableUseItem
protected RefillableUseItem(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup group, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newRefillableUseItem.- Parameters:
group- TheItemGroupthis item belongs to.item- TheSlimefunItemStackthat is used to create this item.recipeType- TheRecipeTypeof this item.recipe- The recipe of this item.
-
-
Method Details
-
refillItem
Adds a single use back to the item- Parameters:
itemStack- TheItemStackto refill
-
refillItem
Adds the requested number of uses back to the item- Parameters:
itemStack- TheItemStackto refillrefillAmount- The number of uses to add
-
updateLore
@ParametersAreNonnullByDefault protected void updateLore(ItemStack itemStack, ItemMeta itemMeta, int usesLeft) Stolen from the Super class as it's private Refreshes the item lore when adding a use back
-