Class MultiBlockMachine
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine
- All Implemented Interfaces:
ItemAttribute
,NotPlaceable
,Placeable
,RecipeDisplayItem
- Direct Known Subclasses:
ArmorForge
,AutomatedPanningMachine
,Compressor
,EnhancedCraftingTable
,GrindStone
,IndustrialMiner
,Juicer
,MagicWorkbench
,MakeshiftSmeltery
,OreCrusher
,OreWasher
,PressureChamber
,Smeltery
,TableSaw
public abstract class MultiBlockMachine
extends SlimefunItem
implements NotPlaceable, RecipeDisplayItem
A
MultiBlockMachine
is a SlimefunItem
that is built in the World
.
It holds recipes and a MultiBlock
object which represents its structure.- 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
ModifierConstructorDescriptionprotected
MultiBlockMachine
(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, BlockFace trigger) protected
MultiBlockMachine
(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Inventory
findOutputInventory
(ItemStack adding, Block dispBlock, Inventory dispInv) Overloaded method for finding a potential output chest.protected Inventory
findOutputInventory
(ItemStack product, Block dispBlock, Inventory dispInv, Inventory placeCheckerInv) This is the list of items to display alongside thisSlimefunItem
.protected MultiBlockInteractionHandler
protected void
handleCraftedItem
(ItemStack outputItem, Block block, Inventory blockInv) This method handles an outputItemStack
from theMultiBlockMachine
which has a crafting delayvoid
load()
This method is used for internal purposes only.abstract void
onInteract
(Player p, Block b) void
This method is called afterSlimefunItem.register(SlimefunAddon)
.void
register
(SlimefunAddon addon) This method registers thisSlimefunItem
.protected void
registerDefaultRecipes
(List<ItemStack> recipes) 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, preRegister, 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
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem
getLabelLocalPath, getRecipeSectionLabel
-
Field Details
-
recipes
-
displayRecipes
-
multiblock
-
-
Constructor Details
-
MultiBlockMachine
@ParametersAreNonnullByDefault protected MultiBlockMachine(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) -
MultiBlockMachine
@ParametersAreNonnullByDefault protected MultiBlockMachine(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, BlockFace trigger)
-
-
Method Details
-
registerDefaultRecipes
-
getRecipes
-
getDisplayRecipes
Description copied from interface:RecipeDisplayItem
This is the list of items to display alongside thisSlimefunItem
. Note that these items will be filled in from top to bottom first. So if you want it to express a recipe, add your inputItemStack
and then your outputItemStack
.- Specified by:
getDisplayRecipes
in interfaceRecipeDisplayItem
- Returns:
- The recipes to display in the
SlimefunGuide
-
getMultiBlock
-
addRecipe
-
register
Description copied from class:SlimefunItem
This method registers thisSlimefunItem
. Always call this method after yourSlimefunItem
has been initialized. Never call it more than once!- Overrides:
register
in classSlimefunItem
- Parameters:
addon
- TheSlimefunAddon
that thisSlimefunItem
belongs to.
-
postRegister
public void postRegister()Description copied from class:SlimefunItem
This method is called afterSlimefunItem.register(SlimefunAddon)
. Override this method to add any additional setup that needs to happen after the original registration of thisSlimefunItem
.- Overrides:
postRegister
in classSlimefunItem
-
load
public void load()Description copied from class:SlimefunItem
This method is used for internal purposes only.- Overrides:
load
in classSlimefunItem
-
getInteractionHandler
-
onInteract
-
findOutputInventory
@ParametersAreNonnullByDefault @Nullable protected Inventory findOutputInventory(ItemStack adding, Block dispBlock, Inventory dispInv) Overloaded method for finding a potential output chest. Fallbacks to the old system of putting the adding back into the dispenser. Optional last argument Inventory placeCheckerInv is for aMultiBlockMachine
that create a dummy inventory to check if there's a space for the adding, i.e. Enhanced crafting table -
findOutputInventory
-
handleCraftedItem
@ParametersAreNonnullByDefault protected void handleCraftedItem(ItemStack outputItem, Block block, Inventory blockInv) This method handles an outputItemStack
from theMultiBlockMachine
which has a crafting delay- Parameters:
outputItem
- A craftedItemStack
fromMultiBlockMachine
block
- MainBlock
of ourContainer
fromMultiBlockMachine
blockInv
- TheInventory
of ourContainer
-