MinecraftModDevelopmentMods / Tesla-Core-Lib

Minecraft library useful in creating power hungry machines
https://minecraft.curseforge.com/projects/tesla-core-lib
MIT License
6 stars 8 forks source link

Crash caused by emptying fluid containers #28

Closed brisingraerowing closed 5 years ago

brisingraerowing commented 6 years ago

No crash log (It was a hang)

Here is the error (from Game Output):

[20:45:04] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking block entity
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:771) ~[MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666) ~[MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185) ~[chd.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Caused by: kotlin.KotlinNullPointerException
    at net.ndrei.teslacorelib.utils.FluidUtils.fillFluidFrom(FluidUtils.kt:60) ~[FluidUtils.class:?]
    at net.ndrei.teslacorelib.utils.FluidextensionsKt.fillFrom(fluidextensions.kt:16) ~[FluidextensionsKt.class:?]
    at net.ndrei.teslacorelib.utils.FluidextensionsKt.fillFrom(fluidextensions.kt:22) ~[FluidextensionsKt.class:?]
    at net.ndrei.teslacorelib.utils.FluidextensionsKt.processInputInventory(fluidextensions.kt:27) ~[FluidextensionsKt.class:?]
    at net.ndrei.teslacorelib.tileentities.SidedTileEntity.processFluidItems(SidedTileEntity.kt:541) ~[SidedTileEntity.class:?]
    at net.ndrei.teslacorelib.tileentities.SidedTileEntity.processImmediateInventories(SidedTileEntity.kt:211) ~[SidedTileEntity.class:?]
    at net.ndrei.teslacorelib.tileentities.SidedTileEntity.func_73660_a(SidedTileEntity.kt:988) ~[SidedTileEntity.class:?]
    at net.minecraft.world.World.func_72939_s(World.java:1829) ~[amu.class:?]
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:612) ~[oo.class:?]
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:765) ~[MinecraftServer.class:?]
faceofcat commented 6 years ago

can't figure this one out... do you happen to have any more info?...

was it a one time thing?... happened more time since reported?

what exactly were/are you doing when this happens?

brisingraerowing commented 6 years ago

I haven't tried this since this crash (I actually forgot about this issue). IIRC, I had put a Pressure Pipes fluid canister into an Industrial Foregoing Black Hole tank, and the 'crash' happened when the canister fluid level dipped below 1 bucket (I think it was around 720 mb).

This line is the one that crashed, and I think that the pressure pipes canister is a bit buggy, as it seems that the contents were null on that line (but not on the one before).

Ciannicay commented 6 years ago

same error. info copied from discord for issue tracking purposes.

i did just crash to desktop with teslacorelib mentioned as culprit in the log.

what i actually did: I inserted a bottle of water (item info says vanilla item) into a potion brewer from industrial foregoing into the fluid container slot. don't know why it says the coremod burped and not the Industrial Foregoing mod. Please note that binnie coremod is also present and might interfere as it also has Water bottles n stuff (F3+H says its still vanilla item, tho) Looks like this created a persistent problem as i get thrown out of the server immediately with exactly the same error. Pack is DW20 1.12: V2.1.0 playing on a server

Full Crash-report: https://pastebin.com/EH9P7D44

ps: i did not try to replicate it as i needed an admin to worldedit that block away to log in again.

SanAndreaP commented 6 years ago

I got a very similar crash like @Ciannicay whilst doing the exact same things (insert a bottle of water into an IF brewer) https://paste.dimdev.org/oquloroyil.mccrash

brisingraerowing commented 6 years ago

I just noticed that EnderCore makes Vanilla water bottles a fluid handler, and the above two reporters both have it. That may be part of the issue here.

SanAndreaP commented 6 years ago

After looking into @BrisingrAerowing 's comment, I have disabled the option fluidContainerBottles in EnderCore. I can't insert water bottles into the machine anymore, which I guess is intended behavior. At least it doesn't crash :+1:

HenryLoenwind commented 5 years ago

Found your bug:

https://github.com/MinecraftModDevelopmentMods/Tesla-Core-Lib/blob/cdd2de7d35b85eb3aab49c9a699947b6d06166bd/src/main/kotlin/net/ndrei/teslacorelib/utils/FluidUtils.kt#L59-L60

In the first line you drain the stack and it the second line you ask it again for its content---being surprised that it is empty. (result.contents is a method call on a live object...)

faceofcat commented 5 years ago

ah... so I assumed that people would return a clone and not a live object here: https://github.com/MinecraftModDevelopmentMods/Tesla-Core-Lib/blob/cdd2de7d35b85eb3aab49c9a699947b6d06166bd/src/main/kotlin/net/ndrei/teslacorelib/utils/FluidUtils.kt#L44

that's stupid tho... people should always return clones.... but... I see your point... I will try to find time to fix this.

InfiniteX95 commented 5 years ago

Same crash for me. I tried to place a xp bucket in the black hole tank of industrial foregoing and it crashed my server. Crash report: crash-2019-04-01_21.23.24-server.txt

johnfriedrich commented 5 years ago

Thanks for fixing this issue! Mind uploading that version to Curse Forge?

xJon commented 4 years ago

Any update regarding releasing this fix? Thank you!