Package hiiragi283.core.util
Object HTStackSlotHelper
-
- All Implemented Interfaces:
public class HTStackSlotHelper
-
-
Field Summary
Fields Modifier and Type Field Description public final static HTStackSlotHelperINSTANCE
-
Method Summary
-
-
Method Detail
-
moveResource
final static <RESOURCE extends HTResourceType<?>, SLOT extends HTResourceSlot<RESOURCE>> HTResourceMoveResult<RESOURCE> moveResource(SLOT from, SLOT to, Integer amount, HTStorageAccess access)
-
shrinkStack
final static <RESOURCE extends HTResourceType<?>> Integer shrinkStack(HTResourceSlot<RESOURCE> slot, ToIntBiFunction<RESOURCE, Integer> ingredient, HTStorageAction action)
-
canShrinkStack
final static <RESOURCE extends HTResourceType<?>> Boolean canShrinkStack(HTResourceSlot<RESOURCE> slot, Integer amount, Boolean exactMatch)
-
canShrinkStack
final static <RESOURCE extends HTResourceType<?>> Boolean canShrinkStack(HTResourceSlot<RESOURCE> slot, ToIntBiFunction<RESOURCE, Integer> ingredient, Boolean exactMatch)
-
insert
final static <RESOURCE extends HTResourceType<?>> Integer insert(Iterable<HTResourceSlot<RESOURCE>> slots, RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)
指定したresourceをすべてのスロットへ搬入します。
- Returns:
搬入されない量
-
extract
final static <RESOURCE extends HTResourceType<?>> Integer extract(List<HTResourceSlot<RESOURCE>> slots, RESOURCE resource, Integer amount, HTStorageAction action, HTStorageAccess access)
指定したresourceをすべてのスロットから搬出します。
- Returns:
搬出される量
-
calculateRedstoneLevel
final static <RESOURCE extends HTResourceType<?>> Integer calculateRedstoneLevel(Iterable<HTResourceView<RESOURCE>> views)
-
calculateRedstoneLevel
final static Integer calculateRedstoneLevel(Integer amount, Integer capacity)
-
calculateRedstoneLevel
final static Integer calculateRedstoneLevel(HTAmountView view)
-
shrinkItemStack
final static Integer shrinkItemStack(HTResourceSlot<HTItemResourceType> slot, Function1<HTItemResourceType, ItemStack> remainderGetter, Function1<ItemStack, Unit> stackSetter, Integer amount, HTStorageAction action)
-
insertStacks
final static Integer insertStacks(Iterable<HTResourceSlot<HTItemResourceType>> slot, ItemStack stack, HTStorageAction action, HTStorageAccess access)
-
-
-
-