Immersive Aircraft [Fabric/Forge]

Immersive Aircraft [Fabric/Forge]

15M Downloads

Returning fuel containers doesnt account for itemstack state

EnderiumSmith opened this issue ยท 2 comments

commented

When returning the container of a fuel, it uses the deprecated method with no itemstack parameter. This causes items with special dynamic fuel behavior to get deleted.

commented

Can you link an example of proper usage please?

commented

here is what i use in my code

            ItemStack container=ItemStack.EMPTY;
            if(inventory.getStackInSlot(2).hasCraftingRemainingItem()){
                container=inventory.getStackInSlot(2).getCraftingRemainingItem();
            }
            inventory.extractItem(2,1,false);
            if(!container.isEmpty()){
                container=inventory.insertItem(2,container,false);
                if(!container.isEmpty()){
                    Containers.dropItemStack(level, getBlockPos().getX(), getBlockPos().getY(),getBlockPos().getZ(),container);
                }
            }