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
ConstructorDescriptionSolarGenerator
(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 TypeMethodDescriptionint
This method returns the max amount of electricity this Block can hold.int
This method returns the amount of energy that thisSolarGenerator
produces during the day.int
getGeneratedOutput
(Location l, Config data) This method returns how much energy thisEnergyNetProvider
provides to theEnergyNet
.int
This method returns the amount of energy that thisSolarGenerator
produces during the night.void
This 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, 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
getEnergyComponentType, willExplode
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getId
Methods 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 thisSolarGenerator
produces during the day.- Returns:
- The amount of energy generated at daylight
-
getNightEnergy
public int getNightEnergy()This method returns the amount of energy that thisSolarGenerator
produces during the night.- Returns:
- The amount of energy generated at night time
-
getCapacity
public int getCapacity()Description copied from interface:EnergyNetComponent
This 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:
getCapacity
in interfaceEnergyNetComponent
- Returns:
- The max amount of electricity this Block can store.
-
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
.
-
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
-