Class AbstractMonsterSpawner
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.blocks.AbstractMonsterSpawner
- All Implemented Interfaces:
DistinctiveItem
,ItemAttribute
,Placeable
- Direct Known Subclasses:
BrokenSpawner
,RepairedSpawner
This is a parent class for the
BrokenSpawner
and RepairedSpawner
to provide some utility methods.- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canStack
(org.bukkit.inventory.meta.ItemMeta itemMetaOne, org.bukkit.inventory.meta.ItemMeta itemMetaTwo) 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.Optional
<org.bukkit.entity.EntityType> getEntityType
(org.bukkit.inventory.ItemStack item) This method tries to obtain anEntityType
from a givenItemStack
.org.bukkit.inventory.ItemStack
getItemForEntityType
(org.bukkit.entity.EntityType type) This method returns a finishedItemStack
of thisSlimefunItem
, modified to hold and represent the givenEntityType
.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, addWikiPage, callItemHandler, canUse, disable, enable, 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, loadDataByDefault, postRegister, preRegister, 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
-
Method Details
-
getEntityType
@Nonnull public Optional<org.bukkit.entity.EntityType> getEntityType(@Nonnull org.bukkit.inventory.ItemStack item) This method tries to obtain anEntityType
from a givenItemStack
. The providedItemStack
must be aRepairedSpawner
item.- Parameters:
item
- TheItemStack
to extract theEntityType
from- Returns:
- An
Optional
describing the result
-
getItemForEntityType
@Nonnull public org.bukkit.inventory.ItemStack getItemForEntityType(@Nullable org.bukkit.entity.EntityType type) This method returns a finishedItemStack
of thisSlimefunItem
, modified to hold and represent the givenEntityType
. It updates the lore andBlockStateMeta
to reflect the specifiedEntityType
.- Parameters:
type
- TheEntityType
to apply- Returns:
- An
ItemStack
for thisSlimefunItem
holding thatEntityType
-
canStack
public boolean canStack(@Nonnull org.bukkit.inventory.meta.ItemMeta itemMetaOne, @Nonnull org.bukkit.inventory.meta.ItemMeta itemMetaTwo) 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
-