Uses of Interface
net.neoforged.neoforge.transfer.resource.Resource
Packages that use Resource
Package
Description
-
Uses of Resource in net.neoforged.neoforge.transfer
Classes in net.neoforged.neoforge.transfer with type parameters of type ResourceModifier 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.interfaceIndexModifier<T extends Resource>Represents a function to directly mutate the resource and amount at a specific index of aResourceHandler.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.interfaceResourceHandler<T extends Resource>A generic handler for the transfer and storage ofresourceswhether it be inserting, extracting, querying some value, etc.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 ResourceModifier and TypeFieldDescriptionprotected final TVoidingResourceHandler.emptyResourceprotected final TInfiniteResourceHandler.infiniteResourceMethods in net.neoforged.neoforge.transfer with type parameters of type ResourceModifier 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.static <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 <T extends Resource>
EmptyResourceHandler<T> EmptyResourceHandler.instance()Returns an empty resource handler for the desired resource type.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(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.of(ResourceHandler<T> delegate, int start, int end) Creates a wrapper for a range of indices.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.static <T extends Resource>
RangedResourceHandler<T> RangedResourceHandler.ofSingleIndex(ResourceHandler<T> delegate, int index) Creates a wrapper for a single index.Methods in net.neoforged.neoforge.transfer with parameters of type ResourceModifier and TypeMethodDescriptionstatic voidTransferPreconditions.checkNonEmpty(Resource resource) Ensures the resource is non-empty, throws otherwise.static voidTransferPreconditions.checkNonEmptyNonNegative(Resource resource, int value) Ensures the resource is non-empty and the value is non-negative, throws otherwise.static booleanDetermines if either the given resource or amount is classified as empty: if eitherisEmpty()istrue, or the amount is zero (or negative) then the resource is considered empty.Method parameters in net.neoforged.neoforge.transfer with type arguments of type ResourceModifier and TypeMethodDescriptionstatic booleanResourceHandlerUtil.isEmpty(ResourceHandler<? extends Resource> handler) Checks if aResourceHandleris empty. -
Uses of Resource in net.neoforged.neoforge.transfer.fluid
Classes in net.neoforged.neoforge.transfer.fluid that implement ResourceModifier and TypeClassDescriptionfinal classImmutable combination of aFluidand data components. -
Uses of Resource in net.neoforged.neoforge.transfer.item
Classes in net.neoforged.neoforge.transfer.item that implement ResourceModifier and TypeClassDescriptionfinal classImmutable combination of anItemand data components. -
Uses of Resource in net.neoforged.neoforge.transfer.resource
Classes in net.neoforged.neoforge.transfer.resource with type parameters of type ResourceModifier and TypeClassDescriptionfinal recordResourceStack<T extends Resource>Creates a resource stack from a givenresourceandamount.Subinterfaces of Resource in net.neoforged.neoforge.transfer.resourceModifier and TypeInterfaceDescriptioninterfaceHelper interface for resources backed by a registry entry and which also hold data component values.interfaceHelper interface for resources backed by a registry entry.Fields in net.neoforged.neoforge.transfer.resource declared as Resource