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
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().
You can support your machine to store long value of energy via getCapacityLong(), and make getCapacity() returns Integer.MAX_VALUE- Author:
- TheBusyBiscuit
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddCharge(org.bukkit.Location l, int charge) Deprecated.default voidaddCharge(org.bukkit.Location l, long charge) intDeprecated.default longThis method returns the max amount of electricity this Block can hold.default intgetCharge(org.bukkit.Location l) Deprecated.default intgetCharge(org.bukkit.Location l, ASlimefunDataContainer data) default intgetCharge(org.bukkit.Location l, SlimefunBlockData data) Deprecated.default intDeprecated.default longgetChargeLong(org.bukkit.Location l) This returns the currently stored charge at a givenLocation.default longgetChargeLong(org.bukkit.Location l, ASlimefunDataContainer data) This returns the currently stored charge at a givenLocation.default longgetChargeLong(org.bukkit.Location l, SlimefunBlockData data) Deprecated, for removal: This API element is subject to removal in a future version.This method returns the Type ofEnergyNetComponentTypethisSlimefunItemrepresents.default booleanThis returns whether thisEnergyNetComponentcan hold energy charges.default voidremoveCharge(org.bukkit.Location l, int charge) Deprecated.default voidremoveCharge(org.bukkit.Location l, long charge) default voidsetCharge(org.bukkit.Location l, int charge) Deprecated.default voidsetCharge(org.bukkit.Location l, long charge) This method sets the charge which is stored at a givenLocationIf thisEnergyNetComponentis of typeEnergyNetComponentType.CAPACITOR, then this method will automatically update the texture of thisCapacitoras well.Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getId
-
Method Details
-
getEnergyComponentType
This method returns the Type ofEnergyNetComponentTypethisSlimefunItemrepresents. It describes how this Block will interact with anEnergyNet.- Returns:
- The
EnergyNetComponentTypethisSlimefunItemrepresents.
-
getCapacityLong
default long getCapacityLong()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.
-
getCapacity
Deprecated. -
isChargeable
default boolean isChargeable()This returns whether thisEnergyNetComponentcan hold energy charges. It returns true ifgetCapacity()returns a number greater than zero.- Returns:
- Whether this
EnergyNetComponentcan store energy.
-
getChargeLong
default long getChargeLong(@Nonnull org.bukkit.Location l) This returns the currently stored charge at a givenLocation.- Parameters:
l- The targetLocation- Returns:
- The charge stored at that
Location
-
getCharge
Deprecated. -
getCharge
Deprecated. -
getCharge
-
getCharge
Deprecated. -
getChargeLong
@Deprecated(forRemoval=true) default long getChargeLong(@Nonnull org.bukkit.Location l, @Nonnull SlimefunBlockData data) Deprecated, for removal: This API element is subject to removal in a future version. -
getChargeLong
This returns the currently stored charge at a givenLocation. object for thisLocation.- Parameters:
l- The targetLocationdata- The data at thisLocation- Returns:
- The charge stored at that
Location
-
setCharge
Deprecated. -
setCharge
default void setCharge(@Nonnull org.bukkit.Location l, long charge) This method sets the charge which is stored at a givenLocationIf thisEnergyNetComponentis of typeEnergyNetComponentType.CAPACITOR, then this method will automatically update the texture of thisCapacitoras well.- Parameters:
l- The targetLocationcharge- The new charge
-
addCharge
Deprecated. -
addCharge
default void addCharge(@Nonnull org.bukkit.Location l, long charge) -
removeCharge
Deprecated. -
removeCharge
default void removeCharge(@Nonnull org.bukkit.Location l, long charge)
-