[BUG] 1.10 Ticking block entity
deadspidervenom opened this issue · 5 comments
Issue description: Ticking block entity
Steps to reproduce: Stick a rftools builder in quarry mode(clear) fully powered against a ender rift (so that its depositing the items straight into it so from the bottom) make sure the rift and builder has enough power and that the builder as a large area, turn on the builder.
Versions:
- Minecraft: 1.10
- Forge: latest via twitch launcher
- CompatLayer (only if on Minecraft 1.10 or 1.11): latest 1.10
- McJtyLib: latest 1.10
- RFTools: latest 1.10
Relevant logs, if any:
// You should try our sister game, Minceraft!
Time: 3/17/19 1:07 AM
Description: Ticking block entity
java.lang.NullPointerException: Ticking block entity
at gigaherz.enderRift.rift.storage.RiftInventory.insertItem(RiftInventory.java:116)
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:264)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkAndInsertItems(BuilderTileEntity.java:1531)
at mcjty.rftools.blocks.builder.BuilderTileEntity.quarryBlock(BuilderTileEntity.java:1257)
at mcjty.rftools.blocks.builder.BuilderTileEntity.handleSingleBlock(BuilderTileEntity.java:1047)
at mcjty.rftools.blocks.builder.BuilderTileEntity.handleBlockShaped(BuilderTileEntity.java:950)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServerShaped(BuilderTileEntity.java:683)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServer(BuilderTileEntity.java:719)
at mcjty.rftools.blocks.builder.BuilderTileEntity.func_73660_a(BuilderTileEntity.java:697)
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:116)
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:264)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkAndInsertItems(BuilderTileEntity.java:1531)
at mcjty.rftools.blocks.builder.BuilderTileEntity.quarryBlock(BuilderTileEntity.java:1257)
at mcjty.rftools.blocks.builder.BuilderTileEntity.handleSingleBlock(BuilderTileEntity.java:1047)
at mcjty.rftools.blocks.builder.BuilderTileEntity.handleBlockShaped(BuilderTileEntity.java:950)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServerShaped(BuilderTileEntity.java:683)
at mcjty.rftools.blocks.builder.BuilderTileEntity.checkStateServer(BuilderTileEntity.java:719)
at mcjty.rftools.blocks.builder.BuilderTileEntity.func_73660_a(BuilderTileEntity.java:697)
-- 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: 0 total; []
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: 623510 game time, 623510 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 3174 (now: false), thunder time: 8577 (now: true)
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)
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
Hmm are you sure it is invalid? This is for 1.10 right? In 1.10 ItemStacks could still be null
Hey just noticed this, they had reported it to me first, at gigaherz/Ender-Rift#41 -- they just decided not to mention it anywhere, so it's lacking all the context.
As I said there, I believe the underlying issue is in rftools because it's calling insertItem with a null stack, when the function's stack parameter is not nullable, so I suggested that they might want to report that to you. I will probably release a bugfix of the mod to avoid crashing due to invalid input, but I still think it IS invalid input.
🤷♂️ I'd have argued that since the param isn't nullable, it shouldn't be null, and semantically it makes no sense to insert an empty stack, but forge's ItemStackHandler did nullcheck, so it could als obe argued that as the reference implementation, if it nullchecks, I should have nullchecked too. In any case I already released a fix to avoid the crash, not going to spend more time worrying about it since it's 1.10.