Returning fuel containers doesnt account for itemstack state
EnderiumSmith opened this issue ยท 2 comments
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.
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);
}
}