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

    Constructors
    Modifier
    Constructor
    Description
    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 new RefillableUseItem.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    refillItem(ItemStack itemStack)
    Adds a single use back to the item
    protected void
    refillItem(ItemStack itemStack, int refillAmount)
    Adds the requested number of uses back to the item
    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

    Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.LimitedUseItem

    damageItem, getMaxUseCount, getStorageKey, register, setMaxUseCount

    Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem

    getItemHandler, preRegister

    Methods 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, warn

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods 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 new RefillableUseItem.
      Parameters:
      group - The ItemGroup this item belongs to.
      item - The SlimefunItemStack that is used to create this item.
      recipeType - The RecipeType of this item.
      recipe - The recipe of this item.
  • Method Details

    • refillItem

      protected void refillItem(ItemStack itemStack)
      Adds a single use back to the item
      Parameters:
      itemStack - The ItemStack to refill
    • refillItem

      @ParametersAreNonnullByDefault protected void refillItem(ItemStack itemStack, int refillAmount)
      Adds the requested number of uses back to the item
      Parameters:
      itemStack - The ItemStack to refill
      refillAmount - 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
      Parameters:
      itemStack - The ItemStack that has been refilled.
      itemMeta - The ItemMeta of the ItemStack.
      usesLeft - The remaining uses after updating.