Class SolarGenerator
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.electric.generators.SolarGenerator
- All Implemented Interfaces:
EnergyNetComponent,EnergyNetProvider,ItemAttribute,Placeable
The
SolarGenerator is a simple EnergyNetProvider which generates energy if
it has direct contact with sunlight.
Some versions of the SolarGenerator will even generate energy at night, this is determined by
getNightEnergy().- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsConstructorDescriptionSolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) SolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionintThis method returns the max amount of electricity this Block can hold.intThis method returns the amount of energy that thisSolarGeneratorproduces during the day.intgetGeneratedOutput(Location l, Config data) This method returns how much energy thisEnergyNetProviderprovides to theEnergyNet.intThis method returns the amount of energy that thisSolarGeneratorproduces during the night.voidThis method is called beforeSlimefunItem.register(SlimefunAddon).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, register, 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
getEnergyComponentType, willExplodeMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getIdMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
SolarGenerator
@ParametersAreNonnullByDefault public SolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, int capacity) -
SolarGenerator
@ParametersAreNonnullByDefault public SolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
-
Method Details
-
getDayEnergy
public int getDayEnergy()This method returns the amount of energy that thisSolarGeneratorproduces during the day.- Returns:
- The amount of energy generated at daylight
-
getNightEnergy
public int getNightEnergy()This method returns the amount of energy that thisSolarGeneratorproduces during the night.- Returns:
- The amount of energy generated at night time
-
getCapacity
public int getCapacity()Description copied from interface:EnergyNetComponentThis method returns the max amount of electricity this Block can hold. If the capacity is zero, then this Block cannot hold any electricity.- Specified by:
getCapacityin interfaceEnergyNetComponent- Returns:
- The max amount of electricity this Block can store.
-
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.
-
preRegister
public void preRegister()Description copied from class:SlimefunItemThis method is called beforeSlimefunItem.register(SlimefunAddon). Override this method to add any additional setup, adding anItemHandlerfor example.- Overrides:
preRegisterin classSlimefunItem
-