Uses of Interface
net.neoforged.neoforge.transfer.ResourceHandler
Packages that use ResourceHandler
Package
Description
-
Uses of ResourceHandler in net.neoforged.neoforge.capabilities
Fields in net.neoforged.neoforge.capabilities with type parameters of type ResourceHandlerModifier and TypeFieldDescriptionstatic final BlockCapability<ResourceHandler<FluidResource>, @Nullable Direction> Capabilities.Fluid.BLOCKstatic final BlockCapability<ResourceHandler<ItemResource>, @Nullable Direction> Capabilities.Item.BLOCKprivate static final DoubleBlockCombiner.Combiner<ChestBlockEntity, ResourceHandler<ItemResource>> CapabilityHooks.CHEST_COMBINER_HANDLERstatic final EntityCapability<ResourceHandler<FluidResource>, @Nullable Direction> Capabilities.Fluid.ENTITYstatic final EntityCapability<ResourceHandler<ItemResource>, @Nullable Void> Capabilities.Item.ENTITYCapability for the inventory of an entity.static final EntityCapability<ResourceHandler<ItemResource>, @Nullable Direction> Capabilities.Item.ENTITY_AUTOMATIONCapability for an inventory of entity that should be accessible to automation, in the sense that droppers, hoppers, and similar modded devices will try to use it.static final ItemCapability<ResourceHandler<FluidResource>, ItemAccess> Capabilities.Fluid.ITEMstatic final ItemCapability<ResourceHandler<ItemResource>, ItemAccess> Capabilities.Item.ITEM -
Uses of ResourceHandler in net.neoforged.neoforge.fluids.capability
Fields in net.neoforged.neoforge.fluids.capability declared as ResourceHandlerModifier and TypeFieldDescriptionprivate final ResourceHandler<FluidResource> FluidResourceHandlerAdapter.handlerDeprecated, for removal: This API element is subject to removal in a future version.Methods in net.neoforged.neoforge.fluids.capability with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic IFluidHandlerIFluidHandler.of(ResourceHandler<FluidResource> handler) Deprecated, for removal: This API element is subject to removal in a future version.Creates a wrapper around aResourceHandler, to present it as a legacyIFluidHandler.Constructors in net.neoforged.neoforge.fluids.capability with parameters of type ResourceHandlerModifierConstructorDescription(package private)Deprecated, for removal: This API element is subject to removal in a future version.FluidResourceHandlerItemAdapter(ResourceHandler<FluidResource> handler, ItemAccess itemAccess) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of ResourceHandler in net.neoforged.neoforge.items
Fields in net.neoforged.neoforge.items declared as ResourceHandlerModifier and TypeFieldDescriptionprivate final ResourceHandler<ItemResource> ItemResourceHandlerAdapter.handlerDeprecated, for removal: This API element is subject to removal in a future version.Methods in net.neoforged.neoforge.items with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic IItemHandlerIItemHandler.of(ResourceHandler<ItemResource> handler) Deprecated, for removal: This API element is subject to removal in a future version.Creates a wrapper around an itemResourceHandler, to present it as a legacyIItemHandler.Constructors in net.neoforged.neoforge.items with parameters of type ResourceHandlerModifierConstructorDescription(package private)Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of ResourceHandler in net.neoforged.neoforge.transfer
Classes in net.neoforged.neoforge.transfer that implement ResourceHandlerModifier and TypeClassDescriptionclassCombinedResourceHandler<T extends Resource>A resource handler that wraps multiple resource handlers, concatenating all their indices into one large handler.classDelegatingResourceHandler<T extends Resource>A resource handler that delegates all calls to another handler.final classEmptyResourceHandler<T extends Resource>An empty resource handler.classInfiniteResourceHandler<T extends Resource>AResourceHandlerthat allows insertion and extraction of an unlimited amount of a specified resource.classItemAccessResourceHandler<T extends Resource>Base implementation of aResourceHandlerbacked by anItemAccess.classRangedResourceHandler<T extends Resource>A resource handler that wraps a range of indices of another handler.classResourceStacksResourceHandler<R extends Resource>Base implementation of aResourceHandlerbacked by a list ofResourceStacks.classStacksResourceHandler<S,T extends Resource> Base implementation of aResourceHandlerbacked by a list of stacks.classVoidingResourceHandler<T extends Resource>A resource handler that destroys any resources inserted into it.Fields in net.neoforged.neoforge.transfer declared as ResourceHandlerModifier and TypeFieldDescriptionprivate final ResourceHandler<T>[]CombinedResourceHandler.handlersThe wrapped handlers.Fields in net.neoforged.neoforge.transfer with type parameters of type ResourceHandlerModifier and TypeFieldDescriptionprotected final Supplier<ResourceHandler<T>> DelegatingResourceHandler.delegateMethods in net.neoforged.neoforge.transfer that return ResourceHandlerModifier and TypeMethodDescriptionDelegatingResourceHandler.getDelegate()protected ResourceHandler<T> CombinedResourceHandler.getHandlerFromIndex(int handlerIndex) Methods in net.neoforged.neoforge.transfer that return types with arguments of type ResourceHandlerModifier and TypeMethodDescriptionstatic <T extends Resource>
Class<ResourceHandler<T>> ResourceHandler.asClass()Creates a class with the right generic type, such that it can be used to register a capability.Methods in net.neoforged.neoforge.transfer with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic <T extends Resource>
booleanResourceHandlerUtil.contains(ResourceHandler<T> handler, T resource) Returnstrueif the resource handler contains the given resource,falseotherwise.static <T extends Resource>
@Nullable ResourceStack<T> ResourceHandlerUtil.extractFirst(@Nullable ResourceHandler<T> handler, Predicate<T> filter, int amount, @Nullable TransactionContext transaction) Extracts the first resource from aResourceHandlerthat is not empty and matches the given filter.static <T extends Resource>
@Nullable TResourceHandlerUtil.findExtractableResource(ResourceHandler<T> handler, Predicate<T> filter, @Nullable TransactionContext transaction) Checks if the given resource handler has at least one resource that matches the given filter and can be extracted.static <T extends Resource>
intResourceHandlerUtil.getRedstoneSignalFromResourceHandler(ResourceHandler<T> handler) Calculates the redstone signal strength based on the given resource handler's content.static <T extends Resource>
intResourceHandlerUtil.indexOf(ResourceHandler<T> handler, T resource) Returns the first index that contains the given resource, or -1 if no index contains it.static <T extends Resource>
intResourceHandlerUtil.insertStacking(@Nullable ResourceHandler<T> handler, T resource, int amount, @Nullable TransactionContext transaction) Tries to insert up to some amount of a resource into the handler, using stacking logic: resources will be inserted into filled indices first, then empty indices.static booleanResourceHandlerUtil.isEmpty(ResourceHandler<? extends Resource> handler) Checks if aResourceHandleris empty.static <T extends Resource>
booleanResourceHandlerUtil.isFull(ResourceHandler<T> handler) Checks if aResourceHandleris full.static <T extends Resource>
booleanResourceHandlerUtil.isValid(ResourceHandler<T> handler, T resource) Returns whether the given resourceis validfor any index of the given resource handler.static <T extends Resource>
intResourceHandlerUtil.move(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, @Nullable TransactionContext transaction) Move resources matching a given filter between two resource handlers, and return the amount that was successfully moved.static <T extends Resource>
@Nullable ResourceStack<T> ResourceHandlerUtil.moveFirst(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, @Nullable TransactionContext transaction) Similar toResourceHandlerUtil.move(net.neoforged.neoforge.transfer.ResourceHandler<T>, net.neoforged.neoforge.transfer.ResourceHandler<T>, java.util.function.Predicate<T>, int, net.neoforged.neoforge.transfer.transaction.TransactionContext), but transfers only the first resource that matches the filter and can be successfully transferred.private static <T extends Resource>
@Nullable ResourceStack<T> ResourceHandlerUtil.moveFirstInternal(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, boolean stacking, @Nullable TransactionContext transaction) static <T extends Resource>
@Nullable ResourceStack<T> ResourceHandlerUtil.moveFirstStacking(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, @Nullable TransactionContext transaction) Same asResourceHandlerUtil.moveFirst(net.neoforged.neoforge.transfer.ResourceHandler<T>, net.neoforged.neoforge.transfer.ResourceHandler<T>, java.util.function.Predicate<T>, int, net.neoforged.neoforge.transfer.transaction.TransactionContext), but usesResourceHandlerUtil.insertStacking(net.neoforged.neoforge.transfer.ResourceHandler<T>, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)for inserting resources.private static <T extends Resource>
intResourceHandlerUtil.moveInternal(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, boolean stacking, @Nullable TransactionContext transaction) static <T extends Resource>
intResourceHandlerUtil.moveStacking(@Nullable ResourceHandler<T> from, @Nullable ResourceHandler<T> to, Predicate<T> filter, int amount, @Nullable TransactionContext transaction) Same asResourceHandlerUtil.move(net.neoforged.neoforge.transfer.ResourceHandler<T>, net.neoforged.neoforge.transfer.ResourceHandler<T>, java.util.function.Predicate<T>, int, net.neoforged.neoforge.transfer.transaction.TransactionContext), but usesResourceHandlerUtil.insertStacking(net.neoforged.neoforge.transfer.ResourceHandler<T>, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)for inserting resources.static <T extends Resource>
RangedResourceHandler<T> RangedResourceHandler.of(ResourceHandler<T> delegate, int start, int end) Creates a wrapper for a range of indices.static <T extends Resource>
RangedResourceHandler<T> RangedResourceHandler.ofSingleIndex(ResourceHandler<T> delegate, int index) Creates a wrapper for a single index.Method parameters in net.neoforged.neoforge.transfer with type arguments of type ResourceHandlerModifier and TypeMethodDescriptionstatic <T extends Resource>
RangedResourceHandler<T> RangedResourceHandler.of(Supplier<ResourceHandler<T>> delegate, int start, int end) Creates a wrapper for a range of indices, with the passed supplier being queried every time the handler is accessed.static <T extends Resource>
RangedResourceHandler<T> RangedResourceHandler.ofSingleIndex(Supplier<ResourceHandler<T>> delegate, int index) Creates a wrapper for a single index, with the passed supplier being queried every time the handler is accessed.Constructors in net.neoforged.neoforge.transfer with parameters of type ResourceHandlerModifierConstructorDescriptionCombinedResourceHandler(ResourceHandler<T>... handlers) DelegatingResourceHandler(ResourceHandler<T> delegate) protectedRangedResourceHandler(ResourceHandler<T> delegate, int start, int end) Constructor parameters in net.neoforged.neoforge.transfer with type arguments of type ResourceHandlerModifierConstructorDescriptionCombinedResourceHandler(SequencedCollection<? extends ResourceHandler<T>> handlers) DelegatingResourceHandler(Supplier<ResourceHandler<T>> delegate) protectedRangedResourceHandler(Supplier<ResourceHandler<T>> delegate, int start, int end) -
Uses of ResourceHandler in net.neoforged.neoforge.transfer.access
Fields in net.neoforged.neoforge.transfer.access declared as ResourceHandlerModifier and TypeFieldDescriptionprotected final ResourceHandler<ItemResource> HandlerItemAccess.handlerprivate final ResourceHandler<ItemResource> InfiniteMaterialsItemAccess.mainSlotsprivate final ResourceHandler<ItemResource> PlayerItemAccess.slotprivate final ResourceHandler<ItemResource> StackItemAccess.wrapperMethods in net.neoforged.neoforge.transfer.access with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic ItemAccessItemAccess.forHandlerIndex(ResourceHandler<ItemResource> handler, int index) Creates an item access instance for a specific slot of an item resource handler, with any overflow being sent to the rest of the handler.static ItemAccessItemAccess.forHandlerIndexStrict(ResourceHandler<ItemResource> handler, int index) Creates an item access instance for a specific slot of an item resource handler.Constructors in net.neoforged.neoforge.transfer.access with parameters of type ResourceHandlerModifierConstructorDescriptionHandlerItemAccess(ResourceHandler<ItemResource> handler, int index) PlayerItemAccess(PlayerInventoryWrapper inventoryWrapper, ResourceHandler<ItemResource> slot) -
Uses of ResourceHandler in net.neoforged.neoforge.transfer.fluid
Classes in net.neoforged.neoforge.transfer.fluid that implement ResourceHandlerModifier and TypeClassDescriptionfinal classA handler for empty and filled buckets.final classA handler for cauldrons.classBase implementation of aResourceHandler<FluidResource>backed by a list ofFluidStacks.classBase implementation of a simple fluidResourceHandlerbacked by anItemAccess.Methods in net.neoforged.neoforge.transfer.fluid with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic FluidStackFluidUtil.getStack(ResourceHandler<FluidResource> handler, int index) Returns a new fluid stack with the contents of the handler at the given index.static booleanFluidUtil.interactWithFluidHandler(Player player, InteractionHand hand, @Nullable BlockPos pos, ResourceHandler<FluidResource> handler) Used to handle the common case of a player holding a fluid item and right-clicking on a fluid handler.private static @Nullable ResourceStack<FluidResource> FluidUtil.moveWithSound(ResourceHandler<FluidResource> from, ResourceHandler<FluidResource> to, Level level, @Nullable BlockPos pos, @Nullable Player player, boolean pickup) static FluidStackFluidUtil.tryPickupFluid(@Nullable ResourceHandler<FluidResource> destination, @Nullable Player player, Level level, BlockPos pos, @Nullable Direction side) Attempts to pick up a fluid in the level and put it into a fluid handler, first from aBucketPickupblock (such as fluid sources and waterlogged blocks), or second from aCapabilities.Fluid.BLOCKcapability instance.static FluidStackFluidUtil.tryPlaceFluid(@Nullable ResourceHandler<FluidResource> source, @Nullable Player player, Level level, InteractionHand hand, BlockPos pos) Tries to extract one bucket of a fluid resource from a resource handler and place it into the level as a block. -
Uses of ResourceHandler in net.neoforged.neoforge.transfer.item
Classes in net.neoforged.neoforge.transfer.item that implement ResourceHandlerModifier and TypeClassDescriptionclassItemResourceHandlerbacked by anItemAccessfor use with bundle-like items.final classResourceHandler<ItemResource>implementation for the carried slot of anAbstractContainerMenu.private classprivate classclassBase implementation of an itemResourceHandlerbacked by anItemAccess.classA single-index item resource handler, backed by anItemStack.classBase implementation of aResourceHandler<ItemResource>backed by a list ofItemStacks.private classprivate classThe wrapper for a singleEquipmentSlot, used as a building block.final classprivate classSpecialized slot wrapper for one of the armor slots.classAn implementation ofResourceHandler<ItemResource>for vanilla'sContainer.(package private) classclassAn implementation ofResourceHandler<ItemResource>for vanilla'sWorldlyContainer.Fields in net.neoforged.neoforge.transfer.item declared as ResourceHandlerModifier and TypeFieldDescriptionprivate final ResourceHandler<ItemResource> ComposterWrapper.bottomHandlerprivate final ResourceHandler<ItemResource> ResourceHandlerSlot.handlerprivate final @Nullable ResourceHandler<ItemResource> ContainerOrHandler.itemHandlerThe field for theitemHandlerrecord component.private final ResourceHandler<ItemResource> ComposterWrapper.topHandlerMethods in net.neoforged.neoforge.transfer.item that return ResourceHandlerModifier and TypeMethodDescriptionstatic @Nullable ResourceHandler<ItemResource> PlayerInventoryWrapper.getArmorSlot(EquipmentSlot slot) Retrieves a wrapper around a single armor slot.PlayerInventoryWrapper.getArmorSlots()Retrieves a wrapper around all 4 armor slots.PlayerInventoryWrapper.getHandSlot(InteractionHand hand) Retrieves a wrapper for the slot corresponding to the given hand.PlayerInventoryWrapper.getHandSlots()Retrieves a wrapper around both hand slots.PlayerInventoryWrapper.getMainHandSlot()Retrieves a wrapper for the slot corresponding to the current main hand.PlayerInventoryWrapper.getMainSlots()Retrieves a wrapper around the main slots only.ResourceHandlerSlot.getResourceHandler()PlayerInventoryWrapper.getSlot(int slot) Retrieves a wrapper for a specific slot.@Nullable ResourceHandler<ItemResource> ContainerOrHandler.itemHandler()Returns the value of theitemHandlerrecord component.static ResourceHandler<ItemResource> CarriedSlotWrapper.of(AbstractContainerMenu menu) Return a wrapper around the carried slot of a menu, i.e. the stack that can be manipulated withAbstractContainerMenu.getCarried()andAbstractContainerMenu.setCarried(net.minecraft.world.item.ItemStack).static ResourceHandler<ItemResource> LivingEntityEquipmentWrapper.of(LivingEntity entity, EquipmentSlot equipmentSlot) Gets a wrapper for a single equipment slot.static ResourceHandler<ItemResource> LivingEntityEquipmentWrapper.of(LivingEntity entity, EquipmentSlot.Type equipmentType) Gets a wrapper for all equipment slots of a given type.static ResourceHandler<ItemResource> Wraps a vanilla container into aResourceHandlerofItemResources.Methods in net.neoforged.neoforge.transfer.item with parameters of type ResourceHandlerModifier and TypeMethodDescriptionstatic booleanVanillaInventoryCodeHooks.extractHook(Hopper dest, ResourceHandler<ItemResource> handler) Tries to extract items from an item handler and insert them in the hopper.static ItemStackItemUtil.getStack(ResourceHandler<ItemResource> handler, int index) Returns a new item stack with the contents of the handler at the given index.static booleanVanillaInventoryCodeHooks.insertHook(HopperBlockEntity hopper, ResourceHandler<ItemResource> itemHandler) Tries to insert a hopper's items into an item handler.static ItemStackItemUtil.insertItemReturnRemaining(ResourceHandler<ItemResource> handler, int index, ItemStack stack, boolean simulate, @Nullable TransactionContext transaction) Attempts to insert an item stack into the index of a handler, returning any leftover.static ItemStackItemUtil.insertItemReturnRemaining(ResourceHandler<ItemResource> handler, ItemStack stack, boolean simulate, @Nullable TransactionContext transaction) Attempts to insert an item stack into a handler, leaving distribution to the handler, and returning any leftover.Constructors in net.neoforged.neoforge.transfer.item with parameters of type ResourceHandlerModifierConstructorDescriptionContainerOrHandler(@Nullable Container container, @Nullable ResourceHandler<ItemResource> itemHandler) Creates an instance of aContainerOrHandlerrecord class.ResourceHandlerSlot(ResourceHandler<ItemResource> handler, IndexModifier<ItemResource> slotModifier, int index, int xPosition, int yPosition)