Class HTBasicFluidTank
-
- All Implemented Interfaces:
-
hiiragi283.core.api.HTContentListener,hiiragi283.core.api.serialization.value.HTValueSerializable,hiiragi283.core.api.storage.amount.HTAmountView,hiiragi283.core.api.storage.resource.HTResourceSlot,hiiragi283.core.api.storage.resource.HTResourceView,java.lang.Runnable,net.neoforged.neoforge.common.util.INBTSerializable
public class HTBasicFluidTank extends HTResourceSlot.Mutable<HTFluidResourceType>
-
-
Method Summary
-
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView
getCapacity, getLevelAsFloat, getLevelAsFraction, getNeeded, isEmpty -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceSlot.Mutable
extract, insert -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceSlot
extract -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceView
getLevelAsFloat, getLevelAsFraction, getNeeded -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setResource
Unit setResource(HTFluidResourceType resource)
指定したresourceで中身を置換します。
-
setResourceUnchecked
final Unit setResourceUnchecked(HTFluidResourceType resource, Boolean validate)
-
isValid
final Boolean isValid(HTFluidResourceType resource)
指定したresourceが有効か判定します。
- Returns:
有効な場合は
true
-
isStackValidForInsert
final Boolean isStackValidForInsert(HTFluidResourceType resource, HTStorageAccess access)
指定したリソースをこのスロットに搬入できるか判定します。
- Returns:
搬入できる場合は
true
-
canStackExtract
final Boolean canStackExtract(HTFluidResourceType resource, HTStorageAccess access)
指定したリソースをこのスロットから搬出できるか判定します。
- Returns:
搬出できる場合は
true
-
getResource
HTFluidResourceType getResource()
保持しているリソースを取得します。
-
getCapacity
Integer getCapacity(HTFluidResourceType resource)
指定したresourceから容量を取得します。
-
serialize
Unit serialize(HTValueOutput output)
outputに値を書き込みます。
-
deserialize
Unit deserialize(HTValueInput input)
inputから値を読み取ります。
-
onContentsChanged
final Unit onContentsChanged()
変更をマークします。
-
create
final static HTBasicFluidTank create(HTContentListener listener, Integer capacity, BiPredicate<HTFluidResourceType, HTStorageAccess> canExtract, BiPredicate<HTFluidResourceType, HTStorageAccess> canInsert, Predicate<HTFluidResourceType> filter)
-
input
final static HTBasicFluidTank input(HTContentListener listener, Integer capacity, Predicate<HTFluidResourceType> canInsert, Predicate<HTFluidResourceType> filter)
-
output
final static HTBasicFluidTank output(HTContentListener listener, Integer capacity)
-
-
-
-