Package hiiragi283.lib.transfer.item
Class HTBasicItemSlot
-
- All Implemented Interfaces:
-
hiiragi283.lib.transfer.HTResourceSlot,hiiragi283.lib.transfer.HTResourceView,net.neoforged.neoforge.common.util.ValueIOSerializable
public class HTBasicItemSlot extends HTBasicResourceSlot<ItemResource>
-
-
Field Summary
Fields Modifier and Type Field Description public final static Codec<HTResourceStack<ItemResource>>CODECprivate final ItemResourceresourceprivate final LongamountAsLongprivate final IntegeramountAsInt
-
Constructor Summary
Constructors Constructor Description HTBasicItemSlot(Long capacity, BiPredicate<ItemResource, HTHandlerAccess> canInsert, BiPredicate<ItemResource, HTHandlerAccess> canExtract, Predicate<ItemResource> filter, Runnable listener)
-
Method Summary
Modifier and Type Method Description final ItemResourcegetResource()final LonggetAmountAsLong()IntegergetAmountAsInt()final ItemStackgetStack()final UnitsetStack(ItemStack stack, TransactionContext transaction)LonggetCapacityAsLong(ItemResource resource)final Unitserialize(ValueOutput output)final Unitdeserialize(ValueInput input)final static HTBasicItemSlotcreate(Runnable listener, Long capacity, BiPredicate<ItemResource, HTHandlerAccess> canInsert, BiPredicate<ItemResource, HTHandlerAccess> canExtract, Predicate<ItemResource> filter)final static HTBasicItemSlotinput(Runnable listener, Long capacity, Predicate<ItemResource> canInsert, Predicate<ItemResource> filter)final static HTBasicItemSlotoutput(Runnable listener)-
Methods inherited from class hiiragi283.lib.transfer.HTBasicResourceSlot
canResourceExtract, extract, insert, isValid, isValidForInsertion, setContents, setContents -
Methods inherited from class net.neoforged.neoforge.transfer.transaction.SnapshotJournal
updateSnapshots -
Methods inherited from class hiiragi283.lib.transfer.HTResourceView
getCapacityAsInt, getCurrentCapacityAsInt, getCurrentCapacityAsLong, getFilledLevel, getNeededAsInt, getNeededAsLong, isEmpty -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HTBasicItemSlot
HTBasicItemSlot(Long capacity, BiPredicate<ItemResource, HTHandlerAccess> canInsert, BiPredicate<ItemResource, HTHandlerAccess> canExtract, Predicate<ItemResource> filter, Runnable listener)
-
-
Method Detail
-
getResource
final ItemResource getResource()
-
getAmountAsLong
final Long getAmountAsLong()
-
getAmountAsInt
Integer getAmountAsInt()
-
getStack
final ItemStack getStack()
-
getCapacityAsLong
Long getCapacityAsLong(ItemResource resource)
-
deserialize
final Unit deserialize(ValueInput input)
-
create
final static HTBasicItemSlot create(Runnable listener, Long capacity, BiPredicate<ItemResource, HTHandlerAccess> canInsert, BiPredicate<ItemResource, HTHandlerAccess> canExtract, Predicate<ItemResource> filter)
-
input
final static HTBasicItemSlot input(Runnable listener, Long capacity, Predicate<ItemResource> canInsert, Predicate<ItemResource> filter)
-
output
final static HTBasicItemSlot output(Runnable listener)
-
-
-
-