Class HTBasicEnergyBattery
-
- All Implemented Interfaces:
-
hiiragi283.core.api.HTContentListener,hiiragi283.core.api.serialization.value.HTValueSerializable,hiiragi283.core.api.storage.amount.HTAmountSlot,hiiragi283.core.api.storage.amount.HTAmountView,hiiragi283.core.api.storage.energy.HTEnergyBattery,java.lang.Runnable,net.neoforged.neoforge.common.util.INBTSerializable
public class HTBasicEnergyBattery extends HTEnergyBattery.Basic
-
-
Constructor Summary
Constructors Constructor Description HTBasicEnergyBattery(Integer capacity, Predicate<HTStorageAccess> canExtract, Predicate<HTStorageAccess> canInsert, HTContentListener listener)
-
Method Summary
Modifier and Type Method Description UnitsetAmount(Integer amount)保持しているリソースの量を変更します。 final UnitsetAmountUnchecked(Integer amount, Boolean validate)IntegergetAmount()保持している量を返します。 IntegergetCapacity()容量を返します。 Unitserialize(HTValueOutput output)outputに値を書き込みます。 Unitdeserialize(HTValueInput input)inputから値を読み取ります。 final UnitonContentsChanged()変更をマークします。 final static HTBasicEnergyBatteryinput(HTContentListener listener, Integer capacity)final static HTBasicEnergyBatteryoutput(HTContentListener listener, Integer capacity)final static HTBasicEnergyBatterycreate(HTContentListener listener, Integer capacity, Predicate<HTStorageAccess> canExtract, Predicate<HTStorageAccess> canInsert)-
Methods inherited from class hiiragi283.core.api.storage.energy.HTEnergyBattery.Basic
toString -
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountSlot.Basic
extract, insert -
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView
getLevelAsFloat, getLevelAsFraction, getNeeded, isEmpty -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HTBasicEnergyBattery
HTBasicEnergyBattery(Integer capacity, Predicate<HTStorageAccess> canExtract, Predicate<HTStorageAccess> canInsert, HTContentListener listener)
-
-
Method Detail
-
setAmountUnchecked
final Unit setAmountUnchecked(Integer amount, Boolean validate)
-
getCapacity
Integer getCapacity()
容量を返します。
-
serialize
Unit serialize(HTValueOutput output)
outputに値を書き込みます。
-
deserialize
Unit deserialize(HTValueInput input)
inputから値を読み取ります。
-
onContentsChanged
final Unit onContentsChanged()
変更をマークします。
-
input
final static HTBasicEnergyBattery input(HTContentListener listener, Integer capacity)
-
output
final static HTBasicEnergyBattery output(HTContentListener listener, Integer capacity)
-
create
final static HTBasicEnergyBattery create(HTContentListener listener, Integer capacity, Predicate<HTStorageAccess> canExtract, Predicate<HTStorageAccess> canInsert)
-
-
-
-