gigaherz / Ender-Rift

The Powered Bottomless Storage System
https://www.curseforge.com/minecraft/mc-mods/ender-rift
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Ticking block entity crash #41

Closed deadspidervenom closed 5 years ago

deadspidervenom commented 5 years ago

So i was using the 2.1.8 version for 1.10.2 and i setup a rftools builder to quarry and its inventory it would deposit in would be the rift. (thought it was brilliant no need to worry about piping caps)

Then i got this

// There are four lights!

Time: 3/16/19 11:57 PM
Description: Ticking block entity

java.lang.NullPointerException: Ticking block entity
    at gigaherz.enderRift.rift.storage.RiftInventory.insertItem(RiftInventory.java:122)
    at gigaherz.enderRift.rift.TileEnderRift$PoweredInventory.insertItem(TileEnderRift.java:312)
    at mcjty.lib.container.InventoryHelper.insertItemsItemHandlerWithUndo(InventoryHelper.java:230)
    at mcjty.lib.container.InventoryHelper.insertItemsAtomic(InventoryHelper.java:261)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkAndInsertItems(BuilderTileEntity.java:1415)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.quarryBlock(BuilderTileEntity.java:1163)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.handleSingleBlock(BuilderTileEntity.java:954)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.handleBlockShaped(BuilderTileEntity.java:860)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServerShaped(BuilderTileEntity.java:620)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServer(BuilderTileEntity.java:652)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.func_73660_a(BuilderTileEntity.java:634)
    at net.minecraft.world.World.func_72939_s(World.java:1804)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:620)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:709)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:149)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
    at java.lang.Thread.run(Thread.java:745)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
    at gigaherz.enderRift.rift.storage.RiftInventory.insertItem(RiftInventory.java:122)
    at gigaherz.enderRift.rift.TileEnderRift$PoweredInventory.insertItem(TileEnderRift.java:312)
    at mcjty.lib.container.InventoryHelper.insertItemsItemHandlerWithUndo(InventoryHelper.java:230)
    at mcjty.lib.container.InventoryHelper.insertItemsAtomic(InventoryHelper.java:261)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkAndInsertItems(BuilderTileEntity.java:1415)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.quarryBlock(BuilderTileEntity.java:1163)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.handleSingleBlock(BuilderTileEntity.java:954)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.handleBlockShaped(BuilderTileEntity.java:860)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServerShaped(BuilderTileEntity.java:620)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServer(BuilderTileEntity.java:652)
    at mcjty.rftools.blocks.builder.BuilderTileEntity.func_73660_a(BuilderTileEntity.java:634)

-- Block entity being ticked --
Details:
    Name: rftools_builder // mcjty.rftools.blocks.builder.BuilderTileEntity
    Block type: ID #4330 (tile.rftools.builder // mcjty.rftools.blocks.builder.BuilderBlock)
    Block data value: 1 / 0x1 / 0b0001
    Block location: World: (172,47,150), Chunk: (at 12,2,6 in 10,9; contains blocks 160,0,144 to 175,255,159), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Actual block type: ID #4330 (tile.rftools.builder // mcjty.rftools.blocks.builder.BuilderBlock)
    Actual block data value: 1 / 0x1 / 0b0001
Stacktrace:
    at net.minecraft.world.World.func_72939_s(World.java:1804)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:620)

-- Affected level --
Details:
    Level name: New World
    All players: 1 total; [EntityPlayerMP['lilcanvr'/1217346, l='New World', x=171.70, y=47.00, z=147.04]]
    Chunk stats: ServerChunkCache: 625 Drop: 0
    Level seed: 1783849346294131780
    Level generator: ID 00 - default, ver 1. Features enabled: true
    Level generator options: {"diamondSize":8,"lapisCenterHeight":16,"lavaLakeChance":80,"redstoneMaxHeight":16,"diamondMaxHeight":16,"coalMaxHeight":128,"coalMinHeight":0,"seaLevel":63,"graniteCount":10,"riverSize":4,"gravelMinHeight":0,"graniteSize":33,"redstoneSize":8,"fixedBiome":-1,"waterLakeChance":4,"dioriteMinHeight":0,"andesiteCount":10,"graniteMaxHeight":80,"redstoneMinHeight":0,"lapisSize":7,"dirtCount":10,"ironMinHeight":0,"dioriteMaxHeight":80,"coalCount":20,"gravelCount":8,"coalSize":17,"gravelSize":33,"ironMaxHeight":64,"lapisSpread":16,"dioriteCount":10,"andesiteSize":33,"biomeSize":4,"graniteMinHeight":0,"goldCount":2,"diamondCount":1,"dirtSize":33,"gravelMaxHeight":256,"goldSize":9,"ironCount":20,"diamondMinHeight":0,"ironSize":9,"redstoneCount":8,"andesiteMinHeight":0,"dioriteSize":33,"goldMaxHeight":32,"dungeonChance":8,"andesiteMaxHeight":80,"dirtMinHeight":0,"lapisCount":1,"goldMinHeight":0,"dirtMaxHeight":256,"lowerLimitScale":512.0,"biomeDepthOffset":0.0,"upperLimitScale":512.0,"heightScale":684.412,"biomeScaleWeight":1.0,"biomeDepthWeight":1.0,"mainNoiseScaleZ":80.0,"mainNoiseScaleY":160.0,"depthNoiseScaleX":200.0,"mainNoiseScaleX":80.0,"baseSize":8.5,"depthNoiseScaleZ":200.0,"stretchY":12.0,"depthNoiseScaleExponent":0.5,"biomeScaleOffset":0.0,"coordinateScale":684.412,"useStrongholds":true,"useMineShafts":true,"useTemples":true,"useLavaOceans":false,"useCaves":true,"useWaterLakes":true,"useLavaLakes":true,"useMonuments":true,"useRavines":true,"useDungeons":true,"useVillages":true}
    Level spawn location: World: (160,64,200), Chunk: (at 0,4,8 in 10,12; contains blocks 160,0,192 to 175,255,207), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 618060 game time, 618060 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 8624 (now: false), thunder time: 520 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:709)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:149)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
    at java.lang.Thread.run(Thread.java:745)

Teehee

gigaherz commented 5 years ago

Uh....

ItemStack remaining = stack.copy();

It seems the quarry decided to call insertItem with a null (empty) stack, and I don't have any protection against that (who'd think to call insert if they have nothing to insert?!).

I'd say the real bug is in the quarry code, but I guess I can make a "crash fix" release if mcjty doesn't think it's his fault or doesn't want to change the 1.10 rftools (I mean I don't want to touch 1.10 myself, if I can avoid it... :P)

deadspidervenom commented 5 years ago

Ill leave a bug report on his side as well and see.

deadspidervenom commented 5 years ago

Seems like he fixed it in the latest 1.12 build, just did a test on a world for a pack i am making (for myself)

gigaherz commented 5 years ago

1.11 and newer should never have this situation, since empty stacks are not "null" anymore, this crash would be exclusively on 1.10, if it did happen on newer versions then that would most definitely be a bug in rftools.

deadspidervenom commented 5 years ago

McJty Said:

Note how it is crashing in EnderRift: at gigaherz.enderRift.rift.storage.RiftInventory.insertItem(RiftInventory.java:116) at gigaherz.enderRift.rift.TileEnderRift$PoweredInventory.insertItem(TileEnderRift.java:312)

Please report to them

gigaherz commented 5 years ago

Welp this should fix it..... hopefully without breaking anything in the process. If you still want to play on 1.10: https://minecraft.curseforge.com/projects/ender-rift/files/2688656

deadspidervenom commented 5 years ago

Thank you! yea i would like to keep the modpack i was playing going!