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>
  • Constructor Details

  • Method Details

    • getMachineProcessor

      public MachineProcessor<FuelOperation> getMachineProcessor()
      Description copied from interface: MachineProcessHolder
      This method returns our MachineProcessor instance.
      Specified by:
      getMachineProcessor in interface MachineProcessHolder<FuelOperation>
      Returns:
      Our MachineProcessor
    • onBlockBreak

      @Nonnull protected BlockBreakHandler onBlockBreak()
    • getInputSlots

      public int[] getInputSlots()
      Description copied from interface: InventoryBlock
      This method returns an Array of slots that serve as the input for the Inventory of this block.
      Specified by:
      getInputSlots in interface InventoryBlock
      Returns:
      The input slots for the Inventory of this block
    • getOutputSlots

      public int[] getOutputSlots()
      Description copied from interface: InventoryBlock
      This method returns an Array of slots that serve as the output for the Inventory of this block.
      Specified by:
      getOutputSlots in interface InventoryBlock
      Returns:
      The output slots for the Inventory of this block
    • getGeneratedOutput

      public int getGeneratedOutput(org.bukkit.Location l, SlimefunBlockData 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.
    • getCapacity

      public int getCapacity()
      This method returns the max amount of electricity this machine can hold.
      Specified by:
      getCapacity in interface EnergyNetComponent
      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:
      getEnergyProduction in class AbstractEnergyProvider
      Returns:
      The rate of energy consumption
    • setCapacity

      public final AGenerator setCapacity(int capacity)
      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

      public final AGenerator setEnergyProduction(int energyProduced)
      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

      public void register(@Nonnull SlimefunAddon addon)
      Description copied from class: SlimefunItem
      This method registers this SlimefunItem. Always call this method after your SlimefunItem has been initialized. Never call it more than once!
      Overrides:
      register in class SlimefunItem
      Parameters:
      addon - The SlimefunAddon that this SlimefunItem belongs to.