Class HTBasicEnergyBattery
-
- All Implemented Interfaces:
-
hiiragi283.core.api.HTDataSerializable,hiiragi283.core.api.storage.amount.HTAmountSlot,hiiragi283.core.api.storage.amount.HTAmountView,hiiragi283.core.api.storage.energy.HTEnergyBattery,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)
-
Method Summary
Modifier and Type Method Description UnitsetAmount(Integer amount)保持しているリソースの量を変更します。 final UnitsetAmountUnchecked(Integer amount, Boolean validate)IntegergetAmount()保持している量を返します。 IntegergetCapacity()容量を返します。 UnitserializeNBT(HolderLookup.Provider provider, CompoundTag nbt)nbtに値を書き込みます。 UnitdeserializeNBT(HolderLookup.Provider provider, CompoundTag nbt)final static HTBasicEnergyBatteryinput(Integer capacity)final static HTBasicEnergyBatteryoutput(Integer capacity)final static HTBasicEnergyBatterycreate(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 -
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountSlot
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)
-
-
Method Detail
-
setAmountUnchecked
final Unit setAmountUnchecked(Integer amount, Boolean validate)
-
getCapacity
Integer getCapacity()
容量を返します。
-
serializeNBT
Unit serializeNBT(HolderLookup.Provider provider, CompoundTag nbt)
nbtに値を書き込みます。
-
deserializeNBT
Unit deserializeNBT(HolderLookup.Provider provider, CompoundTag nbt)
-
input
final static HTBasicEnergyBattery input(Integer capacity)
-
output
final static HTBasicEnergyBattery output(Integer capacity)
-
create
final static HTBasicEnergyBattery create(Integer capacity, Predicate<HTStorageAccess> canExtract, Predicate<HTStorageAccess> canInsert)
-
-
-
-