java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider
All Implemented Interfaces:
EnergyNetComponent, EnergyNetProvider, ItemAttribute, Placeable, RecipeDisplayItem, InventoryBlock
Direct Known Subclasses:
AGenerator, Reactor

public abstract class AbstractEnergyProvider extends SlimefunItem implements InventoryBlock, RecipeDisplayItem, EnergyNetProvider
This is an abstract super class for machines that produce energy.
Author:
TheBusyBiscuit
See Also:
  • Field Details

    • fuelTypes

      protected final Set<MachineFuel> fuelTypes
      The set of fuel types for this energy provider.
  • Constructor Details

    • AbstractEnergyProvider

      @ParametersAreNonnullByDefault protected AbstractEnergyProvider(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe)
      Constructs a new AbstractEnergyProvider.
      Parameters:
      itemGroup - The item group this item belongs to
      item - The item stack for this energy provider
      recipeType - The recipe type used to craft this item
      recipe - The recipe to craft this item
  • Method Details

    • getInventoryTitle

      @Nonnull public String getInventoryTitle()
      This method returns the title that is used for the Inventory of an AbstractEnergyProvider that has been opened by a Player. Override this method to set the title.
      Returns:
      The title of the Inventory of this AbstractEnergyProvider
    • getProgressBar

      @Nonnull public abstract org.bukkit.inventory.ItemStack getProgressBar()
      This method returns the ItemStack that this AGenerator will use as a progress bar. Override this method to set the progress bar.
      Returns:
      The ItemStack to use as the progress bar
    • getEnergyProduction

      public abstract int getEnergyProduction()
      This method returns the amount of energy that is produced per tick.
      Returns:
      The rate of energy generation
    • registerDefaultFuelTypes

      protected abstract void registerDefaultFuelTypes()
      This method is used to register the default fuel types.
    • getEnergyComponentType

      @Nonnull public final EnergyNetComponentType getEnergyComponentType()
      Description copied from interface: EnergyNetComponent
      This method returns the Type of EnergyNetComponentType this SlimefunItem represents. It describes how this Block will interact with an EnergyNet.
      Specified by:
      getEnergyComponentType in interface EnergyNetComponent
      Specified by:
      getEnergyComponentType in interface EnergyNetProvider
      Returns:
      The EnergyNetComponentType this SlimefunItem represents.
    • registerFuel

      public void registerFuel(@Nonnull MachineFuel fuel)
      Registers a fuel type for this energy provider.
      Parameters:
      fuel - The MachineFuel to register
    • getFuelTypes

      @Nonnull public Set<MachineFuel> getFuelTypes()
      Gets the set of fuel types for this energy provider.
      Returns:
      The set of MachineFuel types
    • getLabelLocalPath

      public String getLabelLocalPath()
      Description copied from interface: RecipeDisplayItem
      Gets the local path for the label in the guide.
      Specified by:
      getLabelLocalPath in interface RecipeDisplayItem
      Returns:
      The local path for the label
    • getDisplayRecipes

      public List<org.bukkit.inventory.ItemStack> getDisplayRecipes()
      Description copied from interface: RecipeDisplayItem
      This is the list of items to display alongside this SlimefunItem. Note that these items will be filled in from top to bottom first. So if you want it to express a recipe, add your input ItemStack and then your output ItemStack.
      Specified by:
      getDisplayRecipes in interface RecipeDisplayItem
      Returns:
      The recipes to display in the SlimefunGuide