Package hiiragi283.core.util
Object HTStackSlotHelper
-
- All Implemented Interfaces:
public class HTStackSlotHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classHTStackSlotHelper.HTFluidHandlerItemWrapper
-
Field Summary
Fields Modifier and Type Field Description public final static LoggerLOGGERpublic 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(HTItemSlot slot, Function1<HTItemResourceType, ItemStack> remainderGetter, Function1<ItemStack, Unit> stackSetter, Integer amount, HTStorageAction action)
-
insertStacks
final static Integer insertStacks(Iterable<HTItemSlot> slot, ItemStack stack, HTStorageAction action, HTStorageAccess access)
-
interact
final static Boolean interact(Player player, InteractionHand hand, ItemStack stack, HTFluidTank tank)
-
moveFluid
final static Boolean moveFluid(HTItemSlot from, Consumer<ItemStack> containerSetter, HTFluidTank to)
-
moveFluid
final static Boolean moveFluid(HTItemSlot slot, Consumer<ItemStack> containerSetter, HTStackSlotHelper.HTFluidHandlerItemWrapper from, HTFluidTank to)
-
-
-
-