Uses of Class
net.neoforged.neoforge.transfer.item.ItemResource
Packages that use ItemResource
Package
Description
-
Uses of ItemResource in net.minecraft.world.item
Fields in net.minecraft.world.item declared as ItemResourceMethods in net.minecraft.world.item that return ItemResourceModifier and TypeMethodDescriptionItem.computeDefaultResource(Function<Item, ItemResource> resourceConstructor) Deprecated.Method parameters in net.minecraft.world.item with type arguments of type ItemResourceModifier and TypeMethodDescriptionItem.computeDefaultResource(Function<Item, ItemResource> resourceConstructor) Deprecated.Neo: do not use, useItemResource.of(ItemStack)instead. -
Uses of ItemResource in net.neoforged.neoforge.capabilities
Fields in net.neoforged.neoforge.capabilities with type parameters of type ItemResourceModifier and TypeFieldDescriptionstatic final BlockCapability<ResourceHandler<ItemResource>, @Nullable Direction> Capabilities.Item.BLOCKprivate static final DoubleBlockCombiner.Combiner<ChestBlockEntity, ResourceHandler<ItemResource>> CapabilityHooks.CHEST_COMBINER_HANDLERstatic 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<ItemResource>, ItemAccess> Capabilities.Item.ITEM -
Uses of ItemResource in net.neoforged.neoforge.items
Fields in net.neoforged.neoforge.items with type parameters of type ItemResourceModifier and TypeFieldDescriptionprivate final ResourceHandler<ItemResource> ItemResourceHandlerAdapter.handlerDeprecated, for removal: This API element is subject to removal in a future version.Method parameters in net.neoforged.neoforge.items with type arguments of type ItemResourceModifier 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.Constructor parameters in net.neoforged.neoforge.items with type arguments of type ItemResourceModifierConstructorDescription(package private)Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of ItemResource in net.neoforged.neoforge.transfer
Methods in net.neoforged.neoforge.transfer that return ItemResourceModifier and TypeMethodDescriptionprotected abstract ItemResourceItemAccessResourceHandler.update(ItemResource accessResource, int index, T newResource, int newAmount) Returns a resource with updated resource and amount.Methods in net.neoforged.neoforge.transfer with parameters of type ItemResourceModifier and TypeMethodDescriptionprotected abstract intItemAccessResourceHandler.getAmountFrom(ItemResource accessResource, int index) Retrieves the amount stored in the current contents of the item access.protected abstract TItemAccessResourceHandler.getResourceFrom(ItemResource accessResource, int index) Retrieves the resource stored in the current contents of the item access.protected abstract ItemResourceItemAccessResourceHandler.update(ItemResource accessResource, int index, T newResource, int newAmount) Returns a resource with updated resource and amount. -
Uses of ItemResource in net.neoforged.neoforge.transfer.access
Fields in net.neoforged.neoforge.transfer.access declared as ItemResourceFields in net.neoforged.neoforge.transfer.access with type parameters of type ItemResourceModifier 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 that return ItemResourceModifier and TypeMethodDescriptionHandlerItemAccess.getResource()InfiniteMaterialsItemAccess.getResource()ItemAccess.getResource()Returns the currently stored item resource.OneByOneItemAccess.getResource()PlayerItemAccess.getResource()StackItemAccess.getResource()Methods in net.neoforged.neoforge.transfer.access with parameters of type ItemResourceModifier and TypeMethodDescriptiondefault intItemAccess.exchange(ItemResource newResource, int amount, TransactionContext transaction) Exchanges up to the given amount of the the current resource with another.intHandlerItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) intInfiniteMaterialsItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) intItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) Extracts up to the given amount of an item resource from the accessed location.intOneByOneItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) intPlayerItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) intStackItemAccess.extract(ItemResource resource, int amount, TransactionContext transaction) intHandlerItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) intInfiniteMaterialsItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) intItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) Inserts up to the given amount of an item resource into the accessed location.intOneByOneItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) intPlayerItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) intStackItemAccess.insert(ItemResource resource, int amount, TransactionContext transaction) Method parameters in net.neoforged.neoforge.transfer.access with type arguments of type ItemResourceModifier 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 ItemResourceModifierConstructorDescription(package private)InfiniteMaterialsItemAccess(Player player, ItemResource resource, int amount) Constructor parameters in net.neoforged.neoforge.transfer.access with type arguments of type ItemResourceModifierConstructorDescriptionHandlerItemAccess(ResourceHandler<ItemResource> handler, int index) PlayerItemAccess(PlayerInventoryWrapper inventoryWrapper, ResourceHandler<ItemResource> slot) -
Uses of ItemResource in net.neoforged.neoforge.transfer.energy
Methods in net.neoforged.neoforge.transfer.energy that return ItemResourceModifier and TypeMethodDescriptionprotected ItemResourceItemAccessEnergyHandler.update(ItemResource accessResource, int newAmount) Returns a resource with updated amount.Methods in net.neoforged.neoforge.transfer.energy with parameters of type ItemResourceModifier and TypeMethodDescriptionprotected intItemAccessEnergyHandler.getAmountFrom(ItemResource accessResource) Retrieves the amount stored in the current contents of the item access.protected ItemResourceItemAccessEnergyHandler.update(ItemResource accessResource, int newAmount) Returns a resource with updated amount. -
Uses of ItemResource in net.neoforged.neoforge.transfer.fluid
Methods in net.neoforged.neoforge.transfer.fluid that return ItemResourceModifier and TypeMethodDescriptionprotected ItemResourceBucketResourceHandler.update(ItemResource accessResource, int index, FluidResource newResource, int newAmount) protected ItemResourceItemAccessFluidHandler.update(ItemResource accessResource, int index, FluidResource newResource, int newAmount) Methods in net.neoforged.neoforge.transfer.fluid with parameters of type ItemResourceModifier and TypeMethodDescriptionprotected intBucketResourceHandler.getAmountFrom(ItemResource accessResource, int index) protected intItemAccessFluidHandler.getAmountFrom(ItemResource accessResource, int index) protected FluidResourceBucketResourceHandler.getResourceFrom(ItemResource accessResource, int index) protected FluidResourceItemAccessFluidHandler.getResourceFrom(ItemResource accessResource, int index) protected ItemResourceBucketResourceHandler.update(ItemResource accessResource, int index, FluidResource newResource, int newAmount) protected ItemResourceItemAccessFluidHandler.update(ItemResource accessResource, int index, FluidResource newResource, int newAmount) -
Uses of ItemResource in net.neoforged.neoforge.transfer.item
Subclasses with type arguments of type ItemResource in net.neoforged.neoforge.transfer.itemModifier and TypeClassDescriptionclassBase implementation of an itemResourceHandlerbacked by anItemAccess.classBase implementation of aResourceHandler<ItemResource>backed by a list ofItemStacks.private classClasses in net.neoforged.neoforge.transfer.item that implement interfaces with type arguments of type ItemResourceModifier and TypeClassDescriptionclassItemResourceHandlerbacked by anItemAccessfor use with bundle-like items.private classprivate classclassA single-index item resource handler, backed by anItemStack.classAn implementation ofResourceHandler<ItemResource>for vanilla'sContainer.classAn implementation ofResourceHandler<ItemResource>for vanilla'sWorldlyContainer.Fields in net.neoforged.neoforge.transfer.item declared as ItemResourceModifier and TypeFieldDescriptionprivate static final ItemResourceComposterWrapper.BONE_MEALstatic final ItemResourceItemResource.EMPTYThe empty resource instance of aItemResourceprivate final ItemResourcePlayerInventoryWrapper.DroppedItems.DropInfo.resourceThe field for theresourcerecord component.Fields in net.neoforged.neoforge.transfer.item with type parameters of type ItemResourceModifier and TypeFieldDescriptionprivate final ResourceHandler<ItemResource> ComposterWrapper.bottomHandlerstatic final com.mojang.serialization.Codec<ItemResource> ItemResource.CODECCodec for an item resource.private final ResourceHandler<ItemResource> ResourceHandlerSlot.handlerprivate final @Nullable ResourceHandler<ItemResource> ContainerOrHandler.itemHandlerThe field for theitemHandlerrecord component.static final com.mojang.serialization.Codec<ItemResource> ItemResource.OPTIONAL_CODECCodec for an item resource.private final IndexModifier<ItemResource> ResourceHandlerSlot.slotModifierstatic final StreamCodec<RegistryFriendlyByteBuf, ItemResource> ItemResource.STREAM_CODECStream codec for an item resource.private final ResourceHandler<ItemResource> ComposterWrapper.topHandlerMethods in net.neoforged.neoforge.transfer.item that return ItemResourceModifier and TypeMethodDescriptionBundleItemHandler.getResource(int index) ComposterWrapper.Bottom.getResource(int index) ComposterWrapper.Top.getResource(int index) ItemStackResourceHandler.getResource(int index) VanillaContainerWrapper.getResource(int index) WorldlyContainerWrapper.getResource(int index) protected ItemResourceItemAccessItemHandler.getResourceFrom(ItemResource accessResource, int index) ItemStacksResourceHandler.getResourceFrom(ItemStack stack) static ItemResourceNote: This cannot be called before your item is registeredstatic ItemResourceItemResource.of(Holder<Item> holder, DataComponentPatch patch) Note: This cannot be called before your item is registeredstatic ItemResourceItemResource.of(@Nullable ItemStackTemplate template) Creates an ItemResource using the default or copy of the passed in item stack.static ItemResourceCreates an ItemResource using the default or copy of the passed in item stack.static ItemResourceNote: This cannot be called before your item is registeredstatic ItemResourceItemResource.of(ItemLike item, DataComponentPatch patch) Note: This cannot be called before your item is registeredPlayerInventoryWrapper.DroppedItems.DropInfo.resource()Returns the value of theresourcerecord component.protected ItemResourceItemAccessItemHandler.update(ItemResource accessResource, int index, ItemResource newResource, int newAmount) <D> ItemResourceItemResource.with(Supplier<? extends DataComponentType<D>> type, D data) <D> ItemResourceItemResource.with(DataComponentType<D> type, D data) ItemResource.withMergedPatch(DataComponentPatch patch) ItemResource.without(Supplier<? extends DataComponentType<?>> type) ItemResource.without(DataComponentType<?> type) Methods in net.neoforged.neoforge.transfer.item that return types with arguments of type ItemResourceModifier 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(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 ItemResourceModifier and TypeMethodDescription(package private) voidPlayerInventoryWrapper.DroppedItems.addDrop(ItemResource resource, int amount, boolean dropAround, boolean includeThrowerName, TransactionContext transaction) voidPlayerInventoryWrapper.drop(ItemResource resource, int amount, boolean dropAround, boolean includeThrowerName, TransactionContext transaction) Transactionally drops an item in the world.intBundleItemHandler.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intComposterWrapper.Bottom.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intComposterWrapper.Top.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intItemStackResourceHandler.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intPlayerInventoryWrapper.ArmorSlotWrapper.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intVanillaContainerWrapper.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intVanillaContainerWrapper.SlotWrapper.extract(int index, ItemResource resource, int amount, TransactionContext transaction) intWorldlyContainerWrapper.extract(int index, ItemResource resource, int amount, TransactionContext transaction) protected intItemAccessItemHandler.getAmountFrom(ItemResource accessResource, int index) protected intItemAccessItemHandler.getCapacity(int index, ItemResource resource) protected intItemStackResourceHandler.getCapacity(ItemResource resource) Return the maximum capacity of this handler for the passed item resource.protected intItemStacksResourceHandler.getCapacity(int index, ItemResource resource) protected intLivingEntityEquipmentWrapper.SlotWrapper.getCapacity(ItemResource resource) protected intPlayerInventoryWrapper.ArmorSlotWrapper.getCapacity(ItemResource resource) protected intVanillaContainerWrapper.SlotWrapper.getCapacity(ItemResource resource) Special cases because vanilla checks the current stack in the following functions (which it shouldn't):AbstractFurnaceBlockEntity.canPlaceItem(int, ItemStack).BrewingStandBlockEntity.canPlaceItem(int, ItemStack).longBundleItemHandler.getCapacityAsLong(int index, ItemResource resource) longComposterWrapper.Bottom.getCapacityAsLong(int index, ItemResource resource) longComposterWrapper.Top.getCapacityAsLong(int index, ItemResource resource) longItemStackResourceHandler.getCapacityAsLong(int index, ItemResource resource) longVanillaContainerWrapper.getCapacityAsLong(int index, ItemResource resource) longWorldlyContainerWrapper.getCapacityAsLong(int index, ItemResource resource) private static floatComposterWrapper.getComposterValue(ItemResource resource) protected ItemContainerContentsItemAccessItemHandler.getContents(ItemResource accessResource) Retrieves theItemContainerContentsfrom the current resource of the item access.protected ItemResourceItemAccessItemHandler.getResourceFrom(ItemResource accessResource, int index) protected ItemStackItemStacksResourceHandler.getStackFrom(ItemResource resource, int amount) intBundleItemHandler.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intComposterWrapper.Bottom.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intComposterWrapper.Top.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intItemStackResourceHandler.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intPlayerInventoryWrapper.insert(ItemResource resource, int amount, TransactionContext transaction) Inserts items into this player inventory, trying to place items following the logic ofInventory.placeItemBackInInventory(ItemStack).intVanillaContainerWrapper.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intVanillaContainerWrapper.SlotWrapper.insert(int index, ItemResource resource, int amount, TransactionContext transaction) intWorldlyContainerWrapper.insert(int index, ItemResource resource, int amount, TransactionContext transaction) booleanBundleItemHandler.isValid(int index, ItemResource resource) booleanComposterWrapper.Bottom.isValid(int index, ItemResource resource) booleanComposterWrapper.Top.isValid(int index, ItemResource resource) booleanItemAccessItemHandler.isValid(int index, ItemResource resource) booleanItemStackResourceHandler.isValid(int index, ItemResource resource) protected booleanItemStackResourceHandler.isValid(ItemResource resource) Returntrueif the passed non-empty item resource can fit in this handler,falseotherwise.protected booleanLivingEntityEquipmentWrapper.SlotWrapper.isValid(ItemResource resource) protected booleanPlayerInventoryWrapper.ArmorSlotWrapper.isValid(ItemResource resource) booleanVanillaContainerWrapper.isValid(int index, ItemResource resource) protected booleanVanillaContainerWrapper.SlotWrapper.isValid(ItemResource resource) booleanWorldlyContainerWrapper.isValid(int index, ItemResource resource) booleanItemStacksResourceHandler.matches(ItemStack stack, ItemResource resource) voidPlayerInventoryWrapper.placeItemBackInInventory(ItemResource resource, int amount, TransactionContext transactionContext) Transactional version ofInventory.placeItemBackInInventory(ItemStack): tries to insert as much as possible into the player inventory, and drops the remainder.protected ItemResourceItemAccessItemHandler.update(ItemResource accessResource, int index, ItemResource newResource, int newAmount) Method parameters in net.neoforged.neoforge.transfer.item with type arguments of type ItemResourceModifier 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 ItemResourceModifierConstructorDescriptionprivateDropInfo(ItemResource resource, int amount, boolean dropAround, boolean includeThrowerName) Creates an instance of aDropInforecord class.Constructor parameters in net.neoforged.neoforge.transfer.item with type arguments of type ItemResourceModifierConstructorDescriptionContainerOrHandler(@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) ResourceHandlerSlot(ResourceHandler<ItemResource> handler, IndexModifier<ItemResource> slotModifier, int index, int xPosition, int yPosition)
ItemResource.of(ItemStack)instead.