BdLib

BdLib

97M Downloads

Cannot Modify Empty FluidStack

MorningSage opened this issue ยท 3 comments

commented

Issue:

Using the latest versions of BDLib and Advanced Generators, having multiple fluid inputs on at least a syngas generator appears to cause a game crash. I have not tested other types of generators at this point. For the test below I just have Mekanism to allow me to pipe fluids. Setup and full log included. Using the Configurator from Mekanism to start piping fluids in causes a game crash and an unrecoverable world due to the same crash occurring every time you load the save.

Versions/Mods:

  • Minecraft 1.16.5
  • Forge 36.1.24
  • BDLib 1.15.0.4
  • Advanced Generators 0.10.0.8
  • Mekanism 10.0.18

Full Log:

Screenshot of setup:

photo_2021-05-31_13-07-28

java.lang.IllegalStateException: Can't modify the empty stack.
        at net.minecraftforge.fluids.FluidStack.setAmount(FluidStack.java:191)
        at net.minecraftforge.fluids.FluidStack.shrink(FluidStack.java:201)
        at net.bdew.lib.capabilities.helpers.fluid.FluidMultiHandler.$anonfun$fill$1(FluidMultiHandler.scala:32)
        at net.bdew.lib.capabilities.helpers.fluid.FluidMultiHandler.$anonfun$fill$1$adapted(FluidMultiHandler.scala:30)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at net.bdew.lib.capabilities.helpers.fluid.FluidMultiHandler.fill(FluidMultiHandler.scala:30)
        at net.bdew.lib.capabilities.helpers.fluid.FluidHandlerProxy.fill(FluidHandlerProxy.scala:16)
        at net.bdew.lib.capabilities.helpers.fluid.FluidHandlerProxy.fill$(FluidHandlerProxy.scala:16)
        at net.bdew.lib.capabilities.helpers.fluid.RestrictedFluidHandler.fill(RestrictedFluidHandler.scala:12)
        at net.bdew.lib.capabilities.helpers.fluid.FluidHandlerProxy.fill(FluidHandlerProxy.scala:16)
        at net.bdew.lib.capabilities.helpers.fluid.FluidHandlerProxy.fill$(FluidHandlerProxy.scala:16)
        at net.bdew.lib.capabilities.helpers.fluid.FluidHandlerOptional.fill(FluidHandlerOptional.scala:6)
        at mekanism.common.content.network.distribution.FluidHandlerTarget.acceptAmount(FluidHandlerTarget.java:19)
        at mekanism.common.content.network.distribution.FluidHandlerTarget.acceptAmount(FluidHandlerTarget.java:11)
        at mekanism.common.lib.distribution.Target.sendPossible(Target.java:86)
        at mekanism.common.util.EmitUtils.lambda$sendToAcceptors$0(EmitUtils.java:41)
        at java.lang.Iterable.forEach(Unknown Source)
        at mekanism.common.util.EmitUtils.sendToAcceptors(EmitUtils.java:41)
        at mekanism.common.util.EmitUtils.sendToAcceptors(EmitUtils.java:70)
        at mekanism.common.content.network.FluidNetwork.tickEmit(FluidNetwork.java:187)
        at mekanism.common.content.network.FluidNetwork.onUpdate(FluidNetwork.java:200)
        at mekanism.common.lib.transmitter.TransmitterNetworkRegistry.onTick(TransmitterNetworkRegistry.java:108)
        at net.minecraftforge.eventbus.ASMEventHandler_52_TransmitterNetworkRegistry_onTick_ServerTickEvent.invoke(.dynamic)
        at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
        at net.minecraftforge.fml.hooks.BasicEventHooks.onPostServerTick(BasicEventHooks.java:120)
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:828)
        at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:78)
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642)
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232)
        at java.lang.Thread.run(Unknown Source)<!--EndFragment-->
commented

Mekanism is passing in an empty fluid stack... which it probably shouldn't be doing.
I'll add a check for that in the next version

commented

Should be fixed in v1.16.1.7

commented

That must have been the fastest bug fix in bug fixing history...

Testing now, lol, thanks!

Edit: Everything good to go!