Class AbstractMonsterSpawner
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.blocks.AbstractMonsterSpawner
- All Implemented Interfaces:
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 TypeMethodDescriptiongetEntityType(ItemStack item) This method tries to obtain anEntityTypefrom a givenItemStack.This method returns a finishedItemStackof thisSlimefunItem, modified to hold and represent the givenEntityType.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, preRegister, register, 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
-
Method Details
-
getEntityType
This method tries to obtain anEntityTypefrom a givenItemStack. The providedItemStackmust be aRepairedSpawneritem.- Parameters:
item- TheItemStackto extract theEntityTypefrom- Returns:
- An
Optionaldescribing the result
-
getItemForEntityType
This method returns a finishedItemStackof thisSlimefunItem, modified to hold and represent the givenEntityType. It updates the lore andBlockStateMetato reflect the specifiedEntityType.- Parameters:
type- TheEntityTypeto apply- Returns:
- An
ItemStackfor thisSlimefunItemholding thatEntityType
-