TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Wooden buckets (and other items which use `FluidWhitelistHandler`) save fluid data to NBT causing different items not to stack.

aliceingame opened this issue ยท 2 comments

commented

Describe the bug
Make sure to include:

  1. What did you expect to happen? all empty buckets to stack
  2. What actually happened instead (i.e. what was the bug) empty bucket and empty bucket used in a recipe (dough) are not the same and do not stack
  3. If they would help to explain the issue, include screenshots
    First is a newly crafted bucket, second is as bucket from a dough recipe.
    image

To Reproduce
Attention to detail is important!

  1. Do craft 2 buckets, use one to make dough, try to stack both, they don't.

Meta Info

  • TFC Version: 125
commented

This is caused by our code and forge's base fluid handler making very different assumptions about how fluid capability objects are stored:

Our FluidWhitelistHandler extends FluidHandlerItemStackSimple, which stores fluid values directly to the NBT of the item stack. This is a behavior we do nowhere else in code, as instead we rely on capability NBT, synced via custom capability handler and share tag.

I'm not entirely sure what the best way to resolve this is. We could just remove the fluid stack tag handling as clearly that's the one that's not expected but I'm worried a particular individual would be very annoyed with that.

I'm of the opinion that we should stick to the capability NBT management in this case, as we already have recipe types for ingredients for the relevant integration possibilities, and it's more overall consistent with the rest of TFC's capability handling systems.

commented

Still an issue as of 1.2.1.44. Specific instance occurs when emptying a bucket via clicking on a barrel.

Maybe this should get fixed properly instead of a quick hack fix...