Class HTBasicItemSlot
-
- All Implemented Interfaces:
-
hiiragi283.core.api.HTDataSerializable,hiiragi283.core.api.HTDataSerializable.CodecBased,hiiragi283.core.api.storage.amount.HTAmountView,hiiragi283.core.api.storage.item.HTItemSlot,hiiragi283.core.api.storage.resource.HTResourceSlot,hiiragi283.core.api.storage.resource.HTResourceView,net.neoforged.neoforge.common.util.INBTSerializable
public class HTBasicItemSlot extends HTItemSlot.Basic implements HTDataSerializable.CodecBased
-
-
Method Summary
-
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView
getCapacity, getLevelAsFloat, getLevelAsFraction, getNeeded -
Methods inherited from class hiiragi283.core.api.storage.item.HTItemSlot.Basic
setStack, toString -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceSlot.Basic
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(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(RegistryOps<Tag> ops, BiConsumer<String, Tag> consumer)
-
deserialize
Unit deserialize(RegistryOps<Tag> ops, Function<String, Tag> function)
-
create
final static HTBasicItemSlot create(Integer limit, BiPredicate<HTItemResourceType, HTStorageAccess> canExtract, BiPredicate<HTItemResourceType, HTStorageAccess> canInsert, Predicate<HTItemResourceType> filter)
-
input
final static HTBasicItemSlot input(Integer limit, Predicate<HTItemResourceType> canInsert, Predicate<HTItemResourceType> filter)
-
output
final static HTBasicItemSlot output()
-
-
-
-