Class HTBasicItemSlot
-
- 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 HTBasicItemSlot extends HTResourceSlot.Mutable<HTItemResourceType>
-
-
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
final Unit setResource(HTItemResourceType resource)
指定したresourceで中身を置換します。
-
setResourceUnchecked
final Unit setResourceUnchecked(HTItemResourceType resource, Boolean validate)
-
isValid
final Boolean isValid(HTItemResourceType resource)
指定したresourceが有効か判定します。
- Returns:
有効な場合は
true
-
isStackValidForInsert
final Boolean isStackValidForInsert(HTItemResourceType resource, HTStorageAccess access)
指定したリソースをこのスロットに搬入できるか判定します。
- Returns:
搬入できる場合は
true
-
canStackExtract
final Boolean canStackExtract(HTItemResourceType resource, HTStorageAccess access)
指定したリソースをこのスロットから搬出できるか判定します。
- Returns:
搬出できる場合は
true
-
getResource
HTItemResourceType getResource()
保持しているリソースを取得します。
-
getCapacity
Integer getCapacity(HTItemResourceType resource)
指定したresourceから容量を取得します。
-
serialize
Unit serialize(HTValueOutput output)
outputに値を書き込みます。
-
deserialize
Unit deserialize(HTValueInput input)
inputから値を読み取ります。
-
onContentsChanged
final Unit onContentsChanged()
変更をマークします。
-
create
final static HTBasicItemSlot create(HTContentListener listener, Integer limit, BiPredicate<HTItemResourceType, HTStorageAccess> canExtract, BiPredicate<HTItemResourceType, HTStorageAccess> canInsert, Predicate<HTItemResourceType> filter)
-
input
final static HTBasicItemSlot input(HTContentListener listener, Integer limit, Predicate<HTItemResourceType> canInsert, Predicate<HTItemResourceType> filter)
-
output
final static HTBasicItemSlot output(HTContentListener listener)
-
-
-
-