Interface EnergyNetComponent

All Superinterfaces:
ItemAttribute
All Known Subinterfaces:
EnergyNetProvider
All Known Implementing Classes:
AbstractAutoCrafter, AbstractEnergyProvider, AbstractEntityAssembler, AbstractGrowthAccelerator, AContainer, AGenerator, AnimalGrowthAccelerator, ArmorAutoCrafter, AutoAnvil, AutoBreeder, AutoBrewer, AutoDisenchanter, AutoDrier, AutoEnchanter, BioGenerator, BookBinder, Capacitor, CarbonPress, ChargingBench, CoalGenerator, CombustionGenerator, CropGrowthAccelerator, ElectricDustWasher, ElectricFurnace, ElectricGoldPan, ElectricIngotFactory, ElectricIngotPulverizer, ElectricOreGrinder, ElectricPress, ElectricSmeltery, ElectrifiedCrucible, EnergyConnector, EnhancedAutoCrafter, ExpCollector, FluidPump, FoodComposter, FoodFabricator, Freezer, GEOMiner, GPSTransmitter, HeatedPressureChamber, IronGolemAssembler, LavaGenerator, MagnesiumGenerator, NetherStarReactor, NuclearReactor, OilPump, ProduceCollector, Reactor, Refinery, SlimefunAutoCrafter, SolarGenerator, TreeGrowthAccelerator, VanillaAutoCrafter, WitherAssembler

public interface EnergyNetComponent extends ItemAttribute
This Interface, when attached to a class that inherits from SlimefunItem, marks the Item as an electric Block. This will make this Block interact with an EnergyNet. You can specify the Type of Block via getEnergyComponentType(). You can also specify a capacity for this Block via getCapacity().
Author:
TheBusyBiscuit
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addCharge(org.bukkit.Location l, int charge)
     
    int
    This method returns the max amount of electricity this Block can hold.
    default int
    getCharge(org.bukkit.Location l)
    This returns the currently stored charge at a given Location.
    default int
    getCharge(org.bukkit.Location l, SlimefunBlockData data)
    This returns the currently stored charge at a given Location.
    default int
    getCharge(org.bukkit.Location l, Config config)
    Deprecated.
    This method returns the Type of EnergyNetComponentType this SlimefunItem represents.
    default boolean
    This returns whether this EnergyNetComponent can hold energy charges.
    default void
    removeCharge(org.bukkit.Location l, int charge)
     
    default void
    setCharge(org.bukkit.Location l, int charge)
    This method sets the charge which is stored at a given Location If this EnergyNetComponent is of type EnergyNetComponentType.CAPACITOR, then this method will automatically update the texture of this Capacitor as well.

    Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute

    getId
  • Method Details

    • getEnergyComponentType

      @Nonnull EnergyNetComponentType getEnergyComponentType()
      This method returns the Type of EnergyNetComponentType this SlimefunItem represents. It describes how this Block will interact with an EnergyNet.
      Returns:
      The EnergyNetComponentType this SlimefunItem represents.
    • getCapacity

      int getCapacity()
      This method returns the max amount of electricity this Block can hold. If the capacity is zero, then this Block cannot hold any electricity.
      Returns:
      The max amount of electricity this Block can store.
    • isChargeable

      default boolean isChargeable()
      This returns whether this EnergyNetComponent can hold energy charges. It returns true if getCapacity() returns a number greater than zero.
      Returns:
      Whether this EnergyNetComponent can store energy.
    • getCharge

      default int getCharge(@Nonnull org.bukkit.Location l)
      This returns the currently stored charge at a given Location.
      Parameters:
      l - The target Location
      Returns:
      The charge stored at that Location
    • getCharge

      @Deprecated default int getCharge(@Nonnull org.bukkit.Location l, @Nonnull Config config)
      Deprecated.
    • getCharge

      default int getCharge(@Nonnull org.bukkit.Location l, @Nonnull SlimefunBlockData data)
      This returns the currently stored charge at a given Location. object for this Location.
      Parameters:
      l - The target Location
      data - The data at this Location
      Returns:
      The charge stored at that Location
    • setCharge

      default void setCharge(@Nonnull org.bukkit.Location l, int charge)
      This method sets the charge which is stored at a given Location If this EnergyNetComponent is of type EnergyNetComponentType.CAPACITOR, then this method will automatically update the texture of this Capacitor as well.
      Parameters:
      l - The target Location
      charge - The new charge
    • addCharge

      default void addCharge(@Nonnull org.bukkit.Location l, int charge)
    • removeCharge

      default void removeCharge(@Nonnull org.bukkit.Location l, int charge)