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
FieldsFields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultiBlockMachine(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, BlockFace trigger) protectedMultiBlockMachine(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, ItemStack[] machineRecipes, BlockFace trigger) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected InventoryfindOutputInventory(ItemStack adding, Block dispBlock, Inventory dispInv) Overloaded method for finding a potential output chest.protected InventoryfindOutputInventory(ItemStack product, Block dispBlock, Inventory dispInv, Inventory placeCheckerInv) This is the list of items to display alongside thisSlimefunItem.protected MultiBlockInteractionHandlerprotected voidhandleCraftedItem(ItemStack outputItem, Block block, Inventory blockInv) This method handles an outputItemStackfrom theMultiBlockMachinewhich has a crafting delayvoidload()This method is used for internal purposes only.abstract voidonInteract(Player p, Block b) voidThis method is called afterSlimefunItem.register(SlimefunAddon).voidregister(SlimefunAddon addon) This method registers thisSlimefunItem.protected voidregisterDefaultRecipes(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, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getIdMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreakingMethods 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:RecipeDisplayItemThis 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 inputItemStackand then your outputItemStack.- Specified by:
getDisplayRecipesin interfaceRecipeDisplayItem- Returns:
- The recipes to display in the
SlimefunGuide
-
getMultiBlock
-
addRecipe
-
register
Description copied from class:SlimefunItemThis method registers thisSlimefunItem. Always call this method after yourSlimefunItemhas been initialized. Never call it more than once!- Overrides:
registerin classSlimefunItem- Parameters:
addon- TheSlimefunAddonthat thisSlimefunItembelongs to.
-
postRegister
public void postRegister()Description copied from class:SlimefunItemThis 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:
postRegisterin classSlimefunItem
-
load
public void load()Description copied from class:SlimefunItemThis method is used for internal purposes only.- Overrides:
loadin 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 aMultiBlockMachinethat 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 outputItemStackfrom theMultiBlockMachinewhich has a crafting delay- Parameters:
outputItem- A craftedItemStackfromMultiBlockMachineblock- MainBlockof ourContainerfromMultiBlockMachineblockInv- TheInventoryof ourContainer
-