Class SlimefunBackpack
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem<ItemUseHandler>
io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack
- All Implemented Interfaces:
DistinctiveItem
,ItemAttribute
,Placeable
- Direct Known Subclasses:
Cooler
,RestoredBackpack
,SoulboundBackpack
This class represents a
SlimefunItem
that is considered a Backpack.
Right-Clicking will open the Inventory
of the currently held Backpack.- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Constructor Summary
ConstructorDescriptionSlimefunBackpack
(int size, ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method is called bySlimefunUtils.isItemSimilar(org.bukkit.inventory.ItemStack, org.bukkit.inventory.ItemStack, boolean)
when twoSlimefunItemStack
IDs match on a DistinctiveItem and should return if the two items can stack with one another.This returns theItemHandler
that will be added to thisSlimefunItem
.int
getSize()
This returns the size of thisSlimefunBackpack
.boolean
isItemAllowed
(ItemStack item, SlimefunItem itemAsSlimefunItem) This method returns whether a givenItemStack
is allowed to be stored in thisSlimefunBackpack
.Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem
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, getOptionalById, getOptionalByItem, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, postRegister, register, 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.ItemAttribute
getId
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
SlimefunBackpack
@ParametersAreNonnullByDefault public SlimefunBackpack(int size, ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
-
Method Details
-
getSize
public int getSize()This returns the size of thisSlimefunBackpack
.- Returns:
- The size of this backpack
-
isItemAllowed
This method returns whether a givenItemStack
is allowed to be stored in thisSlimefunBackpack
.- Parameters:
item
- TheItemStack
to check foritemAsSlimefunItem
- The sameItemStack
as aSlimefunItem
, might be null- Returns:
- Whether the given
ItemStack
is allowed to be put into thisSlimefunBackpack
-
getItemHandler
Description copied from class:SimpleSlimefunItem
This returns theItemHandler
that will be added to thisSlimefunItem
.- Specified by:
getItemHandler
in classSimpleSlimefunItem<ItemUseHandler>
- Returns:
- The
ItemHandler
that should be added to thisSlimefunItem
-
canStack
Description copied from interface:DistinctiveItem
This method is called bySlimefunUtils.isItemSimilar(org.bukkit.inventory.ItemStack, org.bukkit.inventory.ItemStack, boolean)
when twoSlimefunItemStack
IDs match on a DistinctiveItem and should return if the two items can stack with one another.- Specified by:
canStack
in interfaceDistinctiveItem
- Parameters:
itemMetaOne
- TheItemMeta
of the first stack being compared.itemMetaTwo
- TheItemMeta
of the second stack being compared.- Returns:
- Whether the two
ItemMeta
s are stackable
-