Class AGenerator
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider
me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator
- All Implemented Interfaces:
EnergyNetComponent
,EnergyNetProvider
,ItemAttribute
,MachineProcessHolder<FuelOperation>
,Placeable
,RecipeDisplayItem
,InventoryBlock
- Direct Known Subclasses:
BioGenerator
,CoalGenerator
,CombustionGenerator
,LavaGenerator
,MagnesiumGenerator
public abstract class AGenerator
extends AbstractEnergyProvider
implements MachineProcessHolder<FuelOperation>
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider
fuelTypes
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Constructor Summary
ModifierConstructorDescriptionprotected
AGenerator
(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionint
This method returns the max amount of electricity this machine can hold.int
This method returns the amount of energy that is consumed per operation.int
getGeneratedOutput
(Location l, Config data) This method returns how much energy thisEnergyNetProvider
provides to theEnergyNet
.int[]
This method returns ourMachineProcessor
instance.int[]
protected BlockBreakHandler
void
register
(SlimefunAddon addon) This method registers thisSlimefunItem
.final AGenerator
setCapacity
(int capacity) This sets the energy capacity for this machine.final AGenerator
setEnergyProduction
(int energyProduced) This method sets the energy produced by this machine per tick.Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider
getDisplayRecipes, getEnergyComponentType, getFuelTypes, getInventoryTitle, getLabelLocalPath, getProgressBar, registerDefaultFuelTypes, registerFuel
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, 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.EnergyNetComponent
addCharge, getCharge, getCharge, isChargeable, removeCharge, setCharge
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetProvider
willExplode
Methods inherited from interface me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock
createPreset, createPreset
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
getRecipeSectionLabel
-
Constructor Details
-
AGenerator
@ParametersAreNonnullByDefault protected AGenerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
-
Method Details
-
getMachineProcessor
Description copied from interface:MachineProcessHolder
This method returns ourMachineProcessor
instance.- Specified by:
getMachineProcessor
in interfaceMachineProcessHolder<FuelOperation>
- Returns:
- Our
MachineProcessor
-
onBlockBreak
-
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
-
getGeneratedOutput
Description copied from interface:EnergyNetProvider
This method returns how much energy thisEnergyNetProvider
provides to theEnergyNet
. We call this method on every tick, so make sure to keep it light and fast. Stored energy does not have to be handled in here.- Specified by:
getGeneratedOutput
in interfaceEnergyNetProvider
- Parameters:
l
- TheLocation
of thisEnergyNetProvider
data
- The stored block data- Returns:
- The generated output energy of this
EnergyNetProvider
.
-
getCapacity
public int getCapacity()This method returns the max amount of electricity this machine can hold.- Specified by:
getCapacity
in interfaceEnergyNetComponent
- Returns:
- The max amount of electricity this Block can store.
-
getEnergyProduction
public int getEnergyProduction()This method returns the amount of energy that is consumed per operation.- Specified by:
getEnergyProduction
in classAbstractEnergyProvider
- Returns:
- The rate of energy consumption
-
setCapacity
This sets the energy capacity for this machine. This method must be called before registering the item and only before registering.- Parameters:
capacity
- The amount of energy this machine can store- Returns:
- This method will return the current instance of
AGenerator
, so that can be chained.
-
setEnergyProduction
This method sets the energy produced by this machine per tick.- Parameters:
energyProduced
- The energy produced per tick- Returns:
- This method will return the current instance of
AGenerator
, so that can be chained.
-
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.
-