Ender IO Zoo

Ender IO Zoo

964k Downloads

[1.8.9] Stacked (held) tank drain/fill with Simple Fluid Tanks

lehjr opened this issue ยท 10 comments

commented

Issue Description:

Stacked (held) EnderIO tanks drain/fill as a single tank when interacting with Simple Fluid Tanks (right click on tank valve to drain/fill) and number of tanks in the stack is not accounted for.

What happens:

Right clicking on a Simple Fluid Tanks valve drains/fills an entire stack of tanks at once but only treats the stack as a single tank, so a stack of tanks will only drain/fill 16 buckets of fluid total (32 for pressurized tank) instead of multiplying by the number of tanks in the stack or draining/filling one at a time.

What you expected to happen:

Tanks should probably drain/fill individually, pretty much behaving like a stack of empty buckets or if filling/draining multiple tanks at once is desired then account for the number of tanks in the stack.

Steps to reproduce:

  1. Set up a Simple Fluid Tank large enough to handle multiple full EnderIO tanks
  2. Fill a few stacked EnderIO tanks with fluid
  3. right click on Simple Fluid Tank valve with held stack of EnderIO tanks to drain/fill tanks

Affected Versions (Do not use "latest"):

  • EnderIO: EnderIO-1.8.9-3.0.0.26_alpha
  • EnderCore: EnderCore-1.8.9-0.3.0.14-beta.jar
  • Minecraft: 1.8.9
  • Forge: 1.8.9 - 11.15.1.1890

Your most recent log file where the issue was present:

N/A

commented

Issue originally reported here:
Zarathul/simplefluidtanks#10

commented

The tank item is not at all involved when being filled by a block. Nothing we can do here.

Just out of curiosity, what happens if you fill a stack of buckets?

PS: For reference, here's how to correctly fill any in-hand fluid container item: https://github.com/SleepyTrousers/EnderCore/blob/1.8.9/src/main/java/com/enderio/core/common/util/FluidUtil.java#L327

commented

filling a stack of buckets fills one at a time.

commented

So basically, "The-Other-Guy" bug on both sides?

commented

with the twist that our code isn't involved in the item handling. There is no way we a tank item access the player inventory to place its filled copy into there. Which wouldn't work anyway because that'd dupe the tank with all mods that actually implement filling IFluidContainerItems completely.

commented

I just looked up what the Forge bucket does in this case. It won't fill at all because it has protection code against being used improperly. I'll steal that code for out tank. Problem solved.

commented

Just to make things clear I never wanted you to do player inventory manipulation from the item. That would indeed be stupid.

My problem is that there's no clear way how to handle things with stacked IFluidContainerItems.
There are at least 3 variants I encountered.

  1. EnderIO: Item is stackable but completely ignores stacksizes in the interface methods.
  2. OpenBlocks: Returns the total capacity for the stack and distributes to/drains from all items in the stack equally (OpenBlocks/ItemTankBlock).
  3. ThermalExpansion and Forges UniversalBucket: Item is not stackable.

As far as I can see there's no way for me to handle things on my side without fucking up either intended behavior or duping/destroying fluids. In the end I'll probably have to do the stacksplitting because broken behavior is less of a problem than duping, I just hoped that you guys had overlooked the issue and might choose option 2 or 3, in which case I wouldn't have to break anyhing. With that said, I can totally understand why you would want your item to behave like a stack of buckets.
Sorry if I caused any confusion.

commented

@HenryLoenwind i have an fairly odd but maybe usefull idea:
multiply the capacity of the stack as stack_capacity=single_capacity*stacksize

this way the stacksize is handled internally and the stack can be used without knowing it's actual stacksize, you only have to readjust the stack capacity when the stacksize changes ... if this is in any way detectable

commented

no further work is being done on 1.8

commented

It was fixed on their end, but I wasn't sure if it still applied to other mods and/or 1.9. I've stopped working on 1.8.9 myself to focus on 1.9.4. However, I am worried the vanilla chunk rendering glitch (chunks loading but not rendering at all) will make 1.9.4 unplayable.