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
FieldsModifier and TypeFieldDescriptionprotected final List
<org.bukkit.inventory.ItemStack> protected final MultiBlock
protected final List
<org.bukkit.inventory.ItemStack[]> Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MultiBlockMachine
(ItemGroup itemGroup, SlimefunItemStack item, org.bukkit.inventory.ItemStack[] recipe, org.bukkit.block.BlockFace trigger) protected
MultiBlockMachine
(ItemGroup itemGroup, SlimefunItemStack item, org.bukkit.inventory.ItemStack[] recipe, org.bukkit.inventory.ItemStack[] machineRecipes, org.bukkit.block.BlockFace trigger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecipe
(org.bukkit.inventory.ItemStack[] input, org.bukkit.inventory.ItemStack output) void
protected org.bukkit.inventory.Inventory
findOutputInventory
(org.bukkit.inventory.ItemStack adding, org.bukkit.block.Block dispBlock, org.bukkit.inventory.Inventory dispInv) Overloaded method for finding a potential output chest.protected org.bukkit.inventory.Inventory
findOutputInventory
(org.bukkit.inventory.ItemStack product, org.bukkit.block.Block dispBlock, org.bukkit.inventory.Inventory dispInv, org.bukkit.inventory.Inventory placeCheckerInv) List
<org.bukkit.inventory.ItemStack> This is the list of items to display alongside thisSlimefunItem
.protected MultiBlockInteractionHandler
List
<org.bukkit.inventory.ItemStack[]> protected void
handleCraftedItem
(org.bukkit.inventory.ItemStack outputItem, org.bukkit.block.Block block, org.bukkit.inventory.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
(org.bukkit.entity.Player p, org.bukkit.block.Block b) void
This method is called afterSlimefunItem.register(SlimefunAddon)
.void
register
(SlimefunAddon addon) This method registers thisSlimefunItem
.protected void
registerDefaultRecipes
(List<org.bukkit.inventory.ItemStack> recipes) 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, loadDataByDefault, 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, org.bukkit.inventory.ItemStack[] recipe, org.bukkit.inventory.ItemStack[] machineRecipes, org.bukkit.block.BlockFace trigger) -
MultiBlockMachine
@ParametersAreNonnullByDefault protected MultiBlockMachine(ItemGroup itemGroup, SlimefunItemStack item, org.bukkit.inventory.ItemStack[] recipe, org.bukkit.block.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
public void addRecipe(org.bukkit.inventory.ItemStack[] input, org.bukkit.inventory.ItemStack output) -
clearRecipe
public void clearRecipe() -
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
public abstract void onInteract(org.bukkit.entity.Player p, org.bukkit.block.Block b) -
findOutputInventory
@ParametersAreNonnullByDefault @Nullable protected org.bukkit.inventory.Inventory findOutputInventory(org.bukkit.inventory.ItemStack adding, org.bukkit.block.Block dispBlock, org.bukkit.inventory.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- Parameters:
adding
- TheItemStack
that should be addeddispBlock
- TheBlock
of ourDispenser
dispInv
- TheInventory
of ourDispenser
- Returns:
- The target
Inventory
-
findOutputInventory
@ParametersAreNonnullByDefault @Nullable protected org.bukkit.inventory.Inventory findOutputInventory(org.bukkit.inventory.ItemStack product, org.bukkit.block.Block dispBlock, org.bukkit.inventory.Inventory dispInv, org.bukkit.inventory.Inventory placeCheckerInv) -
handleCraftedItem
@ParametersAreNonnullByDefault protected void handleCraftedItem(org.bukkit.inventory.ItemStack outputItem, org.bukkit.block.Block block, org.bukkit.inventory.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
-