Class AContainer
- java.lang.Object
-
- me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem
-
- me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer
-
- All Implemented Interfaces:
Placeable
,EnergyNetComponent
,ItemAttribute
,InventoryBlock
- Direct Known Subclasses:
AutoAnvil
,AutoDisenchanter
,AutoDrier
,AutoEnchanter
,CarbonPress
,ChargingBench
,ElectricDustWasher
,ElectricFurnace
,ElectricGoldPan
,ElectricIngotFactory
,ElectricIngotPulverizer
,ElectricOreGrinder
,ElectricPress
,ElectricSmeltery
,ElectrifiedCrucible
,FoodComposter
,FoodFabricator
,Freezer
,GEOMiner
,HeatedPressureChamber
,OilPump
,Refinery
public abstract class AContainer extends SlimefunItem implements InventoryBlock, EnergyNetComponent
-
-
Field Summary
Fields Modifier and Type Field Description static Map<Block,MachineRecipe>
processing
static Map<Block,Integer>
progress
protected List<MachineRecipe>
recipes
-
Fields inherited from class me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem
addon, category, disenchantable, enchantable, hidden, id, item, recipe, recipeOutput, recipeType, research, useableInWorkbench
-
-
Constructor Summary
Constructors Constructor Description AContainer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
AContainer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
constructMenu(BlockMenuPreset preset)
List<ItemStack>
getDisplayRecipes()
EnergyNetComponentType
getEnergyComponentType()
This method returns the Type ofEnergyNetComponentType
thisSlimefunItem
represents.abstract int
getEnergyConsumption()
This method returns the amount of energy that is consumed per operation.int[]
getInputSlots()
abstract String
getInventoryTitle()
This method returns the title that is used for theInventory
of anAContainer
that has been opened by a Player.abstract String
getMachineIdentifier()
This method returns an internal identifier that is used to identify thisAContainer
and its recipes.int[]
getOutputSlots()
MachineRecipe
getProcessing(Block b)
abstract ItemStack
getProgressBar()
This method returns theItemStack
that thisAContainer
will use as a progress bar.abstract int
getSpeed()
This method returns the speed at which this machine will operate.boolean
isProcessing(Block b)
void
preRegister()
This method is called beforeSlimefunItem.register(SlimefunAddon)
.protected void
registerDefaultRecipes()
This method registers all default recipes for this machine.void
registerRecipe(int seconds, ItemStack[] input, ItemStack[] output)
void
registerRecipe(MachineRecipe recipe)
protected void
tick(Block b)
-
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent
getCapacity, registerComponent
-
Methods inherited from interface me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock
createPreset, createPreset, fits, inject, pushItems
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.thebusybiscuit.slimefun4.api.items.Placeable
onBreak, onExplode, onPlace
-
Methods inherited from class me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem
addItemHandler, addOficialWikipage, bindToResearch, callItemHandler, error, getAddon, getBlockTicker, getByID, getByItem, getCategory, getDrops, getDrops, getEnergyTicker, getHandlers, getID, getItem, getItem, getItemName, getPublicItemHandlers, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, info, isAddonItem, isDisabled, isDisenchantable, isEnchantable, isHidden, isItem, isTicking, isUseableInWorkbench, load, postRegister, register, registerBlockHandler, setCategory, setRecipe, setRecipeOutput, setRecipeType, setUseableInWorkbench, toString, warn
-
-
-
-
Field Detail
-
processing
public static Map<Block,MachineRecipe> processing
-
recipes
protected final List<MachineRecipe> recipes
-
-
Constructor Detail
-
AContainer
public AContainer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
AContainer
public AContainer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput)
-
-
Method Detail
-
constructMenu
protected void constructMenu(BlockMenuPreset preset)
-
getInventoryTitle
public abstract String getInventoryTitle()
This method returns the title that is used for theInventory
of anAContainer
that has been opened by a Player. Override this method to set the title.- Returns:
- The title of the
Inventory
of thisAContainer
-
getProgressBar
public abstract ItemStack getProgressBar()
This method returns theItemStack
that thisAContainer
will use as a progress bar. Override this method to set the progress bar.- Returns:
- The
ItemStack
to use as the progress bar
-
getEnergyConsumption
public abstract int getEnergyConsumption()
This method returns the amount of energy that is consumed per operation.- Returns:
- The rate of energy consumption
-
getSpeed
public abstract int getSpeed()
This method returns the speed at which this machine will operate. This can be implemented on an instantiation-level to create different tiers of machines.- Returns:
- The speed of this machine
-
getMachineIdentifier
public abstract String getMachineIdentifier()
This method returns an internal identifier that is used to identify thisAContainer
and its recipes. When adding recipes to anAContainer
we will use this identifier to identify all instances of the sameAContainer
. This way we can add the recipes to all instances of the same machine.- Returns:
- The identifier of this machine
-
registerDefaultRecipes
protected void registerDefaultRecipes()
This method registers all default recipes for this machine.
-
getInputSlots
public int[] getInputSlots()
Description copied from interface:InventoryBlock
- Specified by:
getInputSlots
in interfaceInventoryBlock
- Returns:
- The input slots for the
Inventory
of this block
-
getOutputSlots
public int[] getOutputSlots()
Description copied from interface:InventoryBlock
- Specified by:
getOutputSlots
in interfaceInventoryBlock
- Returns:
- The output slots for the
Inventory
of this block
-
getEnergyComponentType
public EnergyNetComponentType getEnergyComponentType()
Description copied from interface:EnergyNetComponent
This method returns the Type ofEnergyNetComponentType
thisSlimefunItem
represents. It describes how this Block will interact with anEnergyNet
.- Specified by:
getEnergyComponentType
in interfaceEnergyNetComponent
- Returns:
- The
EnergyNetComponentType
thisSlimefunItem
represents.
-
getProcessing
public MachineRecipe getProcessing(Block b)
-
isProcessing
public boolean isProcessing(Block b)
-
registerRecipe
public void registerRecipe(MachineRecipe recipe)
-
preRegister
public void preRegister()
Description copied from class:SlimefunItem
This method is called beforeSlimefunItem.register(SlimefunAddon)
. Override this method to add any additional setup, adding anItemHandler
for example.- Overrides:
preRegister
in classSlimefunItem
-
tick
protected void tick(Block b)
-
-