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, org.bukkit.inventory.ItemStack[] recipe) SolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionintintThis method returns the amount of energy that thisSolarGeneratorproduces during the day.intgetGeneratedOutput(org.bukkit.Location l, ASlimefunDataContainer 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, addWikiPage, callItemHandler, canUse, disable, enable, 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, loadDataByDefault, 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, addCharge, getCapacityLong, getCharge, getCharge, getCharge, getCharge, getChargeLong, getChargeLong, getChargeLong, isChargeable, removeCharge, removeCharge, setCharge, setChargeMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetProvider
getEnergyComponentType, getGeneratedOutput, getGeneratedOutput, getGeneratedOutputLong, getGeneratedOutputLong, willExplode, willExplode, 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, org.bukkit.inventory.ItemStack[] recipe, int capacity) -
SolarGenerator
@ParametersAreNonnullByDefault public SolarGenerator(ItemGroup itemGroup, int dayEnergy, int nightEnergy, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.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()- Specified by:
getCapacityin interfaceEnergyNetComponent
-
getGeneratedOutput
Description copied from interface:EnergyNetProviderThis method returns how much energy thisEnergyNetProviderprovides to theEnergyNet. Stored energy does not have to be handled in here.
if your machine outputs energy values higher than Integer.MAX_VALUE, please return Integer.MAX_VALUE here and overrideEnergyNetProvider.getGeneratedOutputLong(Location, SlimefunBlockData)instead.- Specified by:
getGeneratedOutputin interfaceEnergyNetProvider- Parameters:
l- TheLocationof thisEnergyNetProviderdata- The storedSlimefunBlockData- 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
-