Class HTResourceSlot.Mutable
-
- 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 abstract class HTResourceSlot.Mutable<RESOURCE extends HTResourceType<?>> extends HTResourceView.Mutable<RESOURCE> implements HTResourceSlot<RESOURCE>
-
-
Constructor Summary
Constructors Constructor Description HTResourceSlot.Mutable()
-
Method Summary
Modifier and Type Method Description Integerinsert(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)このスロットにリソースを搬入します。 Integerextract(Integer amount, HTStorageAction action, HTStorageAccess access)このスロットからリソースを搬出します。 BooleanisStackValidForInsert(RESOURCE resource, HTStorageAccess access)指定したリソースをこのスロットに搬入できるか判定します。 BooleancanStackExtract(RESOURCE resource, HTStorageAccess access)指定したリソースをこのスロットから搬出できるか判定します。 -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceSlot
extract, isValid -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceView.Mutable
setResource -
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView.Mutable
setAmount -
Methods inherited from class hiiragi283.core.api.storage.amount.HTAmountView
getAmount, getCapacity, getLevelAsFloat, getLevelAsFraction, getNeeded, isEmpty -
Methods inherited from class hiiragi283.core.api.storage.resource.HTResourceView
getCapacity, getLevelAsFloat, getLevelAsFraction, getNeeded, getResource -
Methods inherited from class hiiragi283.core.api.serialization.value.HTValueSerializable
deserialize, serialize -
Methods inherited from class hiiragi283.core.api.HTContentListener
onContentsChanged -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
insert
Integer insert(RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)
このスロットにリソースを搬入します。
- Returns:
搬入されない数量
-
extract
Integer extract(Integer amount, HTStorageAction action, HTStorageAccess access)
このスロットからリソースを搬出します。
- Returns:
搬出される数量
-
isStackValidForInsert
Boolean isStackValidForInsert(RESOURCE resource, HTStorageAccess access)
指定したリソースをこのスロットに搬入できるか判定します。
- Parameters:
resource- 搬入されるリソースaccess- このスロットへのアクセスの種類- Returns:
搬入できる場合は
true
-
canStackExtract
Boolean canStackExtract(RESOURCE resource, HTStorageAccess access)
指定したリソースをこのスロットから搬出できるか判定します。
- Parameters:
resource- 搬出されるリソースaccess- このスロットへのアクセスの種類- Returns:
搬出できる場合は
true
-
-
-
-