Class SimpleBattery<T extends Number & Comparable<T>>
java.lang.Object
design.aeonic.nifty.api.transfer.base.SimpleBattery<T>
- All Implemented Interfaces:
Battery<T>
- Direct Known Subclasses:
SimpleBattery.BigBattery,SimpleBattery.IntBattery,SimpleBattery.LongBattery
public abstract class SimpleBattery<T extends Number & Comparable<T>>
extends Object
implements Battery<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TExtracts from the battery.Gets the maximum capacity of the battery.Gets the current amount of energy stored in the battery.Inserts into the battery.protected TvoidonChange()Called when the battery's stored value changes, override to mark your provider as dirty.abstract voidreadNBT(net.minecraft.nbt.CompoundTag tag) voidvoidprotected abstract Tabstract voidwriteNBT(net.minecraft.nbt.CompoundTag tag) protected abstract Tzero()
-
Constructor Details
-
SimpleBattery
-
SimpleBattery
-
-
Method Details
-
resize
-
setStored
-
writeNBT
public abstract void writeNBT(net.minecraft.nbt.CompoundTag tag) -
readNBT
public abstract void readNBT(net.minecraft.nbt.CompoundTag tag) -
zero
-
add
-
subtract
-
min
-
getCapacity
Description copied from interface:BatteryGets the maximum capacity of the battery.- Specified by:
getCapacityin interfaceBattery<T extends Number & Comparable<T>>
-
getStored
Description copied from interface:BatteryGets the current amount of energy stored in the battery. -
insert
Description copied from interface:BatteryInserts into the battery. If simulate is true, the actual battery's stored value will not be changed. Returns the amount inserted. -
extract
Description copied from interface:BatteryExtracts from the battery. If simulate is true, the actual battery's stored value will not be changed. -
onChange
public void onChange()Called when the battery's stored value changes, override to mark your provider as dirty.
-