bdew-minecraft / bdlib

A library for minecraft modding
http://bdew.net
MIT License
19 stars 16 forks source link

Cannot Modify Empty FluidStack #54

Closed MorningSage closed 3 years ago

MorningSage commented 3 years ago

Issue:

Versions/Mods:

Full Log:

Screenshot of setup:

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-->
bdew commented 3 years ago

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

bdew commented 3 years ago

Should be fixed in v1.16.1.7

MorningSage commented 3 years ago

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

Testing now, lol, thanks!

Edit: Everything good to go!