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
fuelTypesFields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAGenerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionintThis method returns the max amount of electricity this machine can hold.intThis method returns the amount of energy that is consumed per operation.intgetGeneratedOutput(Location l, Config data) This method returns how much energy thisEnergyNetProviderprovides to theEnergyNet.int[]This method returns ourMachineProcessorinstance.int[]protected BlockBreakHandlervoidregister(SlimefunAddon addon) This method registers thisSlimefunItem.final AGeneratorsetCapacity(int capacity) This sets the energy capacity for this machine.final AGeneratorsetEnergyProduction(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, registerFuelMethods 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, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent
addCharge, getCharge, getCharge, isChargeable, removeCharge, setChargeMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetProvider
willExplodeMethods inherited from interface me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock
createPreset, createPresetMethods 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
getRecipeSectionLabel
-
Constructor Details
-
AGenerator
@ParametersAreNonnullByDefault protected AGenerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
-
Method Details
-
getMachineProcessor
Description copied from interface:MachineProcessHolderThis method returns ourMachineProcessorinstance.- Specified by:
getMachineProcessorin interfaceMachineProcessHolder<FuelOperation>- Returns:
- Our
MachineProcessor
-
onBlockBreak
-
getInputSlots
public int[] getInputSlots()Description copied from interface:InventoryBlock- Specified by:
getInputSlotsin interfaceInventoryBlock- Returns:
- The input slots for the
Inventoryof this block
-
getOutputSlots
public int[] getOutputSlots()Description copied from interface:InventoryBlock- Specified by:
getOutputSlotsin interfaceInventoryBlock- Returns:
- The output slots for the
Inventoryof this block
-
getGeneratedOutput
Description copied from interface:EnergyNetProviderThis method returns how much energy thisEnergyNetProviderprovides 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:
getGeneratedOutputin interfaceEnergyNetProvider- Parameters:
l- TheLocationof thisEnergyNetProviderdata- 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:
getCapacityin 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:
getEnergyProductionin 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: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.
-