Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionUse
FMLLoader.getCurrent().getLoadingModList()instead.UseItemAccessEnergyHandlerinstead.UseEmptyEnergyHandlerinstead.UseSimpleEnergyHandlerinstead.UseEnergyHandlerinstead. Code that is written againstIEnergyStoragebut receives anEnergyHandlercan temporarily useIEnergyStorage.of(net.neoforged.neoforge.transfer.energy.EnergyHandler)to ease migration.There is no direct equivalent for this method, since each energy handler is expected to perform this check on extraction already. Please open an issue on GitHub if you have a use for an equivalent of this method.There is no direct equivalent for this method, since each energy handler is expected to perform this check on insertion already. Please open an issue on GitHub if you have a use for an equivalent of this method.Use eitherEnergyHandler.getAmountAsLong()orEnergyHandler.getAmountAsInt()instead.Use eitherEnergyHandler.getCapacityAsLong()orEnergyHandler.getCapacityAsInt()instead.UseResourceHandlerwith aFluidResourceinstead. Code that is written againstIFluidHandlerbut receives aResourceHandler<FluidResource>can temporarily useIFluidHandler.of(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.fluid.FluidResource>)to ease migration.UseResourceHandler.getAmountAsInt(int)andResourceHandler.getResource(int)instead. Alternatively use theFluidUtil.getStack(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.fluid.FluidResource>, int)helper.UseResourceHandler.getCapacityAsInt(int, T)instead, passingFluidResource.EMPTYas the resource to retrieve a general tank limit.UseResourceHandler.size()instead.UseResourceHandler.isValid(int, T)instead, however note that it doesn't make the same strong guarantees regarding how long a resource is valid. In other words: the result ofisValidmight change.UseResourceHandlerwith aFluidResourceinstead. To apply changes to an underlying item container, capture anItemAccess, as provided for example by theCapabilities.Fluid.ITEMcapability. Code that is written againstIFluidHandlerItemcan temporarily useFluidUtil.getFluidHandler(ItemStack)to ease migration.There is no equivalent to this method, since in the new system the container is changed directly via anItemAccess.UseEmptyResourceHandlerinstead.UseItemAccessFluidHandlerinstead. Note thatFluidHandlerItemStackwould remove entirely the data component when emptied, whereasItemAccessFluidHandlerwill set the data component toSimpleFluidContent.EMPTY. Make sure to addSimpleFluidContent.EMPTYto the prototype of your item withItem.Properties.component(net.minecraft.core.component.DataComponentType<T>, T).Deprecated with no direct equivalent, howeverItemAccessFluidHandlercan serve as inspiration. Please open an issue on GitHub if you have a use for an equivalent of this class.UseItemAccessFluidHandlerinstead, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return a different item resource if the fluid amount is 0.UseItemAccessFluidHandler, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return an empty resource if the fluid amount is not exactly 0 or the capacity of the handler.Deprecated with no direct equivalent, howeverItemAccessFluidHandlercan serve as inspiration. Please open an issue on GitHub if you have a use for an equivalent of this class.UseItemAccessFluidHandlerinstead, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return a different item resource if the fluid amount is 0.UseFluidStacksResourceHandlerinstead.UseVoidingResourceHandlerinstead.UseBucketResourceHandlerinstead.The newItemAccess-backed handler implementations will directly mutate the underlying item access, thus there is no need to represent the resulting item stack anymore.UseResourceHandlerwith aFluidResourceinstead ofIFluidHandler. For available utils, seeResourceHandlerUtilas well as the newFluidUtil.Deprecated with no equivalent. Please open an issue on GitHub if you have a use for an equivalent of this method.Obtain anItemAccess, and find a handler by callingItemAccess.getCapability(net.neoforged.neoforge.capabilities.ItemCapability<T, net.neoforged.neoforge.transfer.access.ItemAccess>)withCapabilities.Fluid.ITEM. To ease migration, this method currently queries aCapabilities.Fluid.ITEMcapability, and wraps it in a legacyadapter.Use theCapabilities.Fluid.BLOCKcapability directly.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the source. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the source. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the destination. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the destination. Note that the item access will take care of "stowing" any extra items.net.neoforged.neoforge.fluids.FluidUtil.tryFluidTransfer(IFluidHandler, IFluidHandler, int, boolean) UseResourceHandlerUtil.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)orResourceHandlerUtil.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)instead.UseResourceHandlerUtil.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)orResourceHandlerUtil.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)instead.UseResourceHandlerwith aFluidResourceinstead.UseItemAccessItemHandlerinstead.UseResourceHandlerwith anItemResourceinstead. Code that is written againstIItemHandlerbut receives aResourceHandler<ItemResource>can temporarily useIItemHandler.of(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>)to ease migration.UseResourceHandler.getCapacityAsInt(int, T)instead, passingItemResource.EMPTYas the resource to retrieve a general slot limit.UseResourceHandler.size()instead.UseResourceHandler.getResource(int)andResourceHandler.getAmountAsInt(int)instead. Alternatively use theItemUtil.getStack(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, int)helper.UseResourceHandler.insert(int, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)instead. Note thatResourceHandler.insert(int, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)returns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted). Alternatively use theItemUtil.insertItemReturnRemaining(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, net.minecraft.world.item.ItemStack, boolean, net.neoforged.neoforge.transfer.transaction.TransactionContext)helper.UseResourceHandler.isValid(int, T)instead, however note that it doesn't make the same strong guarantees regarding how long a resource is valid. In other words: the result ofisValidmight change.Replaced by theIndexModifierinterface for usage inResourceHandlerSlot.UseResourceHandlerSlotinstead.UseResourceHandlerwith anItemResourceinstead ofIItemHandler. For available utils, seeResourceHandlerUtilas well asItemUtil.UseResourceHandler.insert(Resource, int, TransactionContext)instead. Note thatResourceHandler.insertreturns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted). Alternatively use theItemUtil.insertItemReturnRemaining(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, net.minecraft.world.item.ItemStack, boolean, net.neoforged.neoforge.transfer.transaction.TransactionContext)helper.UseResourceHandlerUtil.insertStacking(ResourceHandler, Resource, int, TransactionContext)instead. Note thatResourceHandlerUtil.insertStackingreturns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted).UseItemStacksResourceHandlerinstead.UseResourceHandlerSlotinstead.UseCombinedResourceHandlerinstead.UseEmptyResourceHandlerinstead.UseLivingEntityEquipmentWrapperinstead, with theEquipmentSlot.Type.HUMANOID_ARMORequipment type.UseLivingEntityEquipmentWrapperinstead.UseLivingEntityEquipmentWrapperinstead, with theEquipmentSlot.Type.HANDequipment type.UseDelegatingResourceHandlerinstead.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getArmorSlots()for the armor slots only.UsePlayerInventoryWrapperinstead.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getMainSlots()for the main slots only.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getHandSlot(net.minecraft.world.InteractionHand)for the offhand only.UseRangedResourceHandlerinstead.ImplementRecipeInputdirectly instead.UseWorldlyContainerWrapperinstead.
-
Deprecated InterfacesInterfaceDescriptionNeo: Use
IShearableinstead.UseEnergyHandlerinstead. Code that is written againstIEnergyStoragebut receives anEnergyHandlercan temporarily useIEnergyStorage.of(net.neoforged.neoforge.transfer.energy.EnergyHandler)to ease migration.UseResourceHandlerwith aFluidResourceinstead. Code that is written againstIFluidHandlerbut receives aResourceHandler<FluidResource>can temporarily useIFluidHandler.of(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.fluid.FluidResource>)to ease migration.UseResourceHandlerwith aFluidResourceinstead. To apply changes to an underlying item container, capture anItemAccess, as provided for example by theCapabilities.Fluid.ITEMcapability. Code that is written againstIFluidHandlerItemcan temporarily useFluidUtil.getFluidHandler(ItemStack)to ease migration.UseResourceHandlerwith aFluidResourceinstead.UseResourceHandlerwith anItemResourceinstead. Code that is written againstIItemHandlerbut receives aResourceHandler<ItemResource>can temporarily useIItemHandler.of(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>)to ease migration.Replaced by theIndexModifierinterface for usage inResourceHandlerSlot.
-
Deprecated ClassesClassDescriptionForge: Use
DatapackBuiltinEntriesProviderinsteadUseItemAccessEnergyHandlerinstead.UseEmptyEnergyHandlerinstead.UseSimpleEnergyHandlerinstead.UseEmptyResourceHandlerinstead.UseItemAccessFluidHandlerinstead. Note thatFluidHandlerItemStackwould remove entirely the data component when emptied, whereasItemAccessFluidHandlerwill set the data component toSimpleFluidContent.EMPTY. Make sure to addSimpleFluidContent.EMPTYto the prototype of your item withItem.Properties.component(net.minecraft.core.component.DataComponentType<T>, T).Deprecated with no direct equivalent, howeverItemAccessFluidHandlercan serve as inspiration. Please open an issue on GitHub if you have a use for an equivalent of this class.UseItemAccessFluidHandlerinstead, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return a different item resource if the fluid amount is 0.UseItemAccessFluidHandler, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return an empty resource if the fluid amount is not exactly 0 or the capacity of the handler.Deprecated with no direct equivalent, howeverItemAccessFluidHandlercan serve as inspiration. Please open an issue on GitHub if you have a use for an equivalent of this class.UseItemAccessFluidHandlerinstead, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return a different item resource if the fluid amount is 0.UseFluidStacksResourceHandlerinstead.UseVoidingResourceHandlerinstead.UseBucketResourceHandlerinstead.The newItemAccess-backed handler implementations will directly mutate the underlying item access, thus there is no need to represent the resulting item stack anymore.UseResourceHandlerwith aFluidResourceinstead ofIFluidHandler. For available utils, seeResourceHandlerUtilas well as the newFluidUtil.UseItemAccessItemHandlerinstead.UseResourceHandlerSlotinstead.UseResourceHandlerwith anItemResourceinstead ofIItemHandler. For available utils, seeResourceHandlerUtilas well asItemUtil.UseItemStacksResourceHandlerinstead.UseResourceHandlerSlotinstead.UseCombinedResourceHandlerinstead.UseEmptyResourceHandlerinstead.UseLivingEntityEquipmentWrapperinstead, with theEquipmentSlot.Type.HUMANOID_ARMORequipment type.UseLivingEntityEquipmentWrapperinstead.UseLivingEntityEquipmentWrapperinstead, with theEquipmentSlot.Type.HANDequipment type.UseDelegatingResourceHandlerinstead.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getArmorSlots()for the armor slots only.UsePlayerInventoryWrapperinstead.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getMainSlots()for the main slots only.UsePlayerInventoryWrapperinstead, in particularPlayerInventoryWrapper.getHandSlot(net.minecraft.world.InteractionHand)for the offhand only.UseRangedResourceHandlerinstead.ImplementRecipeInputdirectly instead.UseWorldlyContainerWrapperinstead.
-
Deprecated Enum Classes
-
Deprecated Record ClassesRecord ClassDescription
-
Deprecated FieldsFieldDescriptionForge: Use
PresetEditorManager.get(ResourceKey)instead.UseSharedConstants.getProtocolVersion()instead.UseSharedConstants.getCurrentVersion()andinstead.invalid reference
com.mojang.bridge.game.GameVersion#isStable()UseSharedConstants.getProtocolVersion()instead.UseSharedConstants.getCurrentVersion()andinstead.invalid reference
com.mojang.bridge.game.GameVersion#getWorldVersion()Neo: use thedata mapinsteadNeo: Use theacceptable villager distancesdata map insteadNeo: use thedata mapinsteadNeo: useLivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGETwith target info insteadNeoforge: useIPlayerExtension.mayFly()to read andNeoForgeMod.CREATIVE_FLIGHTAttribute to modifyNeo: use thedata mapinsteadForge: This map is patched out of vanilla code. Listen toBlockEvent.BlockToolModificationEventor overrideIBlockExtension.getToolModifiedState(BlockState, UseOnContext, net.neoforged.neoforge.common.ItemAbility, boolean).Use theinverse mapgenerated from the data map, this field will be ignored in a future versionNeo: Use thedata map, this field will be ignored in a future versionNeo: Use thecompostabledata map insteadNeo: Usethe data map, this field will be ignored in a future versionNeo: Use theinverse mapgenerated from the data map, this field will be ignored in a future versionNeo: use thedata mapinstead.
-
Deprecated MethodsMethodDescriptionNeo: call
Camera.setRotation(float, float, float)insteadRegister viaRegisterColorHandlersEvent.BlockNeo: UseAtlasGlyphProvider.Instance.renderType(Font.DisplayMode, boolean)insteadNeo: UseBakedSheetGlyph.EffectInstance.renderType(Font.DisplayMode, boolean)insteadNeo: UseBakedSheetGlyph.GlyphInstance.renderType(Font.DisplayMode, boolean)insteadNeo: UseTextRenderable.renderType(Font.DisplayMode, boolean)insteaduseRegisterMenuScreensEventinsteadNeo: use invalid input: '{@link net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent#' registerCategory(Category)} insteadRegister viaRegisterParticleProvidersEventRegister viaRegisterParticleProvidersEventNeo: use overload that accepts BlockStateNeo: useUnbakedModelParser.parse(Reader)insteadNeo: UseBlockModelPartExtension.ambientOcclusion()instead.Neo: Use invalid input: '{@link net.minecraft.client.renderer.block.model.BlockModelPart#' getRenderType(BlockState)}.Neo: UsegetMovingBlockRenderType(ChunkSectionLayer)} with the result of invalid input: '{@' link net.minecraft.client.renderer.block.model.BlockModelPart# getRenderType(BlockState)}.invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Neo: SeeBlockModelWrapper.renderType.Neo: UsegetEntityRenderType(ChunkSectionLayer)} with the result of invalid input: '{@link net.minecraft.client.renderer.block.model.BlockModelPart#' getRenderType(BlockState)}.invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Set your render type in your block model's JSON (e.g."render_type": "cutout") or overrideBlockModelPartExtension.getRenderType(BlockState)Neo: useSpriteSourceList.list(ResourceManager, java.util.Set)insteadForge: For internal use only. Use the Register events when registering values.UseBundlerInfo.unbundlePacket(Packet, Consumer, io.netty.channel.ChannelHandlerContext)instead, as it supports packet filtering and is more efficient.Neo: use overload with ConnectionType contextNeoForge: Use invalid input: '{@link net.neoforged.neoforge.registries.NeoForgeRegistries#' ENTITY_DATA_SERIALIZERS} insteadNeo: usethe source-aware variantUseServerCommonPacketListenerImpl.createCookie(ClientInformation, net.neoforged.neoforge.network.connection.ConnectionType)instead, keeping the connection type information available.Neo: Use.invalid reference
net.neoforged.neoforge.client.event.AddClientReloadListenerEventForge: Userider sensitive versionNeo: useLivingEntity.travelInFluid(Vec3, FluidState)insteadNeo:Player.getDestroySpeed(BlockState, BlockPos)insteadNeo: Modders should useRegisterSpawnPlacementsEventinstead.Neo: useFeatureFlagRegistry.Builder.create(ResourceLocation, boolean)insteadForge: useCreativeModeTab.builder()Neo: UseIItemStackExtension.isPrimaryItemFor(Holder)This method does not respectIItemStackExtension.supportsEnchantment(Holder)since theHolderis not available, which makes the result of calling it invalid.Neo: UseEnchantmentHelper.getTagEnchantmentLevel(Holder, ItemStack)for NBT enchantments, orIItemStackExtension.getEnchantmentLevel(Holder)for gameplay.Neo: callIItemStackExtension.canFitInsideContainerItems()instead, prefer overridingIItemExtension.canFitInsideContainerItems(ItemStack)Neo: do not use, useItemResource.of(net.minecraft.world.item.ItemStack)instead.Neo: do not use, usethe eventinsteadnet.minecraft.world.item.ItemStack.addAttributeTooltips(Consumer<Component>, TooltipDisplay, Player) Neo: UseaddAttributeTooltips}invalid @link
{@link net.neoforged.neoforge.common.util.AttributeUtil#Neo: UseItemStack.getTagEnchantments()for NBT enchantments, orIItemStackExtension.getAllEnchantments(net.minecraft.core.HolderLookup.RegistryLookup<net.minecraft.world.item.enchantment.Enchantment>)for gameplay.Forge: Use invalid input: '{@linkplain net.neoforged.neoforge.common.extensions.IItemStackExtension#' onDestroyed(ItemEntity, net.minecraft.world.damagesource.DamageSource) damage source sensitive version}Use ItemStack sensitive versionProjectileWeaponItem.getAllSupportedProjectiles(ItemStack)Use ItemStack sensitive versionProjectileWeaponItem.getSupportedHeldProjectiles(ItemStack)NeoForge: UseRarity.getStyleModifier()Forge: UseBaseRailBlock.getRailDirection(BlockState, BlockGetter, BlockPos, net.minecraft.world.entity.vehicle.AbstractMinecart)for enhanced ability If you do change this property be aware that other functions in this/subclasses may break as they can make assumptions about this propertyNeo: use overload with level context insteadUse IItemHandler capability instead. To preserve Container-specific interactions, useHopperBlockEntity.getContainerOrHandlerAt(net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.core.Direction)and handle both cases.Neo: UseIBlockStateExtension.getLightEmission(BlockGetter, BlockPos)insteadNeo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadNeo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadNeo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadnet.minecraft.world.level.levelgen.synth.ImprovedNoise.noise(double, double, double, double, double) Neo: use overload with level context insteadForge: UseFlowingFluid.canConvertToSource(FluidState, ServerLevel, BlockPos)instead.Neo: do not use, useFluidResource.of(net.neoforged.neoforge.fluids.FluidStack)instead.Forge: useLavaFluid.isFlammable(LevelReader,BlockPos, Direction)insteadnet.minecraft.world.level.storage.loot.LootTable.getRandomItemsRaw(LootContext, Consumer<ItemStack>) UseFMLLoader.getCurrent().getLoadingModList()instead.There is no direct equivalent for this method, since each energy handler is expected to perform this check on extraction already. Please open an issue on GitHub if you have a use for an equivalent of this method.There is no direct equivalent for this method, since each energy handler is expected to perform this check on insertion already. Please open an issue on GitHub if you have a use for an equivalent of this method.Use eitherEnergyHandler.getAmountAsLong()orEnergyHandler.getAmountAsInt()instead.Use eitherEnergyHandler.getCapacityAsLong()orEnergyHandler.getCapacityAsInt()instead.UseResourceHandler.getAmountAsInt(int)andResourceHandler.getResource(int)instead. Alternatively use theFluidUtil.getStack(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.fluid.FluidResource>, int)helper.UseResourceHandler.getCapacityAsInt(int, T)instead, passingFluidResource.EMPTYas the resource to retrieve a general tank limit.UseResourceHandler.size()instead.UseResourceHandler.isValid(int, T)instead, however note that it doesn't make the same strong guarantees regarding how long a resource is valid. In other words: the result ofisValidmight change.There is no equivalent to this method, since in the new system the container is changed directly via anItemAccess.Deprecated with no equivalent. Please open an issue on GitHub if you have a use for an equivalent of this method.Obtain anItemAccess, and find a handler by callingItemAccess.getCapability(net.neoforged.neoforge.capabilities.ItemCapability<T, net.neoforged.neoforge.transfer.access.ItemAccess>)withCapabilities.Fluid.ITEM. To ease migration, this method currently queries aCapabilities.Fluid.ITEMcapability, and wraps it in a legacyadapter.Use theCapabilities.Fluid.BLOCKcapability directly.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the source. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the source. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the destination. Note that the item access will take care of "stowing" any extra items.UseResourceHandlerUtil.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)with anItemAccess-backed handler as the destination. Note that the item access will take care of "stowing" any extra items.net.neoforged.neoforge.fluids.FluidUtil.tryFluidTransfer(IFluidHandler, IFluidHandler, int, boolean) UseResourceHandlerUtil.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)orResourceHandlerUtil.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)instead.UseResourceHandlerUtil.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)orResourceHandlerUtil.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)instead.UseResourceHandler.getCapacityAsInt(int, T)instead, passingItemResource.EMPTYas the resource to retrieve a general slot limit.UseResourceHandler.size()instead.UseResourceHandler.getResource(int)andResourceHandler.getAmountAsInt(int)instead. Alternatively use theItemUtil.getStack(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, int)helper.UseResourceHandler.insert(int, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)instead. Note thatResourceHandler.insert(int, T, int, net.neoforged.neoforge.transfer.transaction.TransactionContext)returns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted). Alternatively use theItemUtil.insertItemReturnRemaining(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, net.minecraft.world.item.ItemStack, boolean, net.neoforged.neoforge.transfer.transaction.TransactionContext)helper.UseResourceHandler.isValid(int, T)instead, however note that it doesn't make the same strong guarantees regarding how long a resource is valid. In other words: the result ofisValidmight change.UseResourceHandler.insert(Resource, int, TransactionContext)instead. Note thatResourceHandler.insertreturns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted). Alternatively use theItemUtil.insertItemReturnRemaining(net.neoforged.neoforge.transfer.ResourceHandler<net.neoforged.neoforge.transfer.item.ItemResource>, net.minecraft.world.item.ItemStack, boolean, net.neoforged.neoforge.transfer.transaction.TransactionContext)helper.UseResourceHandlerUtil.insertStacking(ResourceHandler, Resource, int, TransactionContext)instead. Note thatResourceHandlerUtil.insertStackingreturns how much was inserted, unlike this method which returns the leftover (i.e. how much was not inserted).net.neoforged.neoforge.registries.DeferredRegister.Items.registerSimpleItem(String, Item.Properties) Vanilla has deprecated intrusive holders and is in the process of moving away from them, you should not use this unless you have no better option.Only intended to be used in the case you don't have the transaction context in the method you are in, while expecting a transaction to be open already. If you have access to a transaction context already, be sure to use that rather than using this method.
-
Deprecated ConstructorsConstructorDescriptionUse
CommonListenerCookie(LevelLoadTracker, GameProfile, WorldSessionTelemetryManager, RegistryAccess.Frozen, FeatureFlagSet, String, ServerData, Screen, Map, ChatComponent.State, Map, ServerLinks, Map, boolean, net.neoforged.neoforge.network.connection.ConnectionType)instead,to indicate whether the connection is modded.Neo: useRebuildTask(RenderSectionRegion, boolean, java.util.List)insteadForge: Use the mod id variantForge: Use the mod id variantnet.minecraft.data.tags.DamageTypeTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantnet.minecraft.data.tags.EntityTypeTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantNeo: Use the mod id variantnet.minecraft.data.tags.InstrumentTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantNeo: use overload with ConnectionType contextUseCommonListenerCookie(GameProfile, int, ClientInformation, boolean, net.neoforged.neoforge.network.connection.ConnectionType)instead, to indicate whether the connection is modded.Neo: useMetadata(Component,PackCompatibility,FeatureFlagSet,List,boolean)insteadNeo: useFeatureFlag(FeatureFlagUniverse, int, int, boolean)insteadNeo: use constructor with additional data insteadNeo: use the constructorto support conditionsinvalid reference
with a default value and id setter