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 class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
Extracts 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 T
void
onChange()
Called when the battery's stored value changes, override to mark your provider as dirty.abstract void
readNBT
(net.minecraft.nbt.CompoundTag tag) void
void
protected abstract T
abstract void
writeNBT
(net.minecraft.nbt.CompoundTag tag) protected abstract T
zero()
-
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:Battery
Gets the maximum capacity of the battery.- Specified by:
getCapacity
in interfaceBattery<T extends Number & Comparable<T>>
-
getStored
Description copied from interface:Battery
Gets the current amount of energy stored in the battery. -
insert
Description copied from interface:Battery
Inserts 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:Battery
Extracts 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.
-