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

public class SolarGenerator extends SlimefunItem implements EnergyNetProvider
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:
  • Constructor Details

  • Method Details

    • getDayEnergy

      public int getDayEnergy()
      This method returns the amount of energy that this SolarGenerator produces during the day.
      Returns:
      The amount of energy generated at daylight
    • getNightEnergy

      public int getNightEnergy()
      This method returns the amount of energy that this SolarGenerator 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 interface EnergyNetComponent
      Returns:
      The max amount of electricity this Block can store.
    • getGeneratedOutput

      public int getGeneratedOutput(Location l, Config data)
      Description copied from interface: EnergyNetProvider
      This method returns how much energy this EnergyNetProvider provides to the EnergyNet. 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 interface EnergyNetProvider
      Parameters:
      l - The Location of this EnergyNetProvider
      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 before SlimefunItem.register(SlimefunAddon). Override this method to add any additional setup, adding an ItemHandler for example.
      Overrides:
      preRegister in class SlimefunItem