Tetra

Tetra

12M Downloads

Infinite loop crash when placing two forge hammers side-by-side in the world

jimmed opened this issue ยท 2 comments

commented

Bug Report

Observed Behaviour
Two Forge Hammers were placed side-by-side in the world:

image

On placing the second one, both client AND server crashed with an infinite loop. Note that loading a world where the blocks are already placed like this does not trigger the crash.

I'm afraid I don't have a client log as this comes from a user report on a server I maintain. The server crashed as follows:

[09:57:22] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.StackOverflowError: null
	at net.minecraft.world.World.func_217353_a(World.java:167) ~[?:?]
	at net.minecraft.world.IWorldReader.func_217348_a(IWorldReader.java:112) ~[?:?]
	at net.minecraft.world.World.func_212866_a_(World.java:163) ~[?:?]
	at net.minecraft.world.World.func_175726_f(World.java:159) ~[?:?]
	at net.minecraft.world.World.func_175625_s(World.java:598) ~[?:?]
	at se.mickelus.tetra.util.TileEntityOptional.from(TileEntityOptional.java:11) ~[tetra:3.5.3]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseBlock.onNeighborChange(HammerBaseBlock.java:323) ~[tetra:3.5.3]
	at net.minecraftforge.common.extensions.IForgeBlockState.onNeighborChange(IForgeBlockState.java:475) ~[forge:?]
	at net.minecraft.world.World.func_175666_e(World.java:1009) ~[?:?]
	at net.minecraft.world.World.func_175646_b(World.java:805) ~[?:?]
	at net.minecraft.tileentity.TileEntity.func_70296_d(TileEntity.java:103) ~[?:?]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseTile.sync(HammerBaseTile.java:411) ~[tetra:3.5.3]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseTile.updateRedstonePower(HammerBaseTile.java:184) ~[tetra:3.5.3]
	at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_212]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseBlock.onNeighborChange(HammerBaseBlock.java:323) ~[tetra:3.5.3]
	at net.minecraftforge.common.extensions.IForgeBlockState.onNeighborChange(IForgeBlockState.java:475) ~[forge:?]
	at net.minecraft.world.World.func_175666_e(World.java:1009) ~[?:?]
	at net.minecraft.world.World.func_175646_b(World.java:805) ~[?:?]
	at net.minecraft.tileentity.TileEntity.func_70296_d(TileEntity.java:103) ~[?:?]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseTile.sync(HammerBaseTile.java:411) ~[tetra:3.5.3]
	at se.mickelus.tetra.blocks.forged.hammer.HammerBaseTile.updateRedstonePower(HammerBaseTile.java:184) ~[tetra:3.5.3]
	// ... repeats until the max stack depth is reached ...

Expected Behaviour

Neither client nor server crashes.

Minimal setup needed to reproduce

Note: I believe this will be reproducible with just Tetra alone, but I have not had time to verify this yet.

Steps to reproduce

  1. Place a Forge Hammer
  2. Place another Forge Hammer horizontally adjacent to the first
  3. Client & server crash.
commented

This was fixed in 3.6.0, please make sure you're using the latest version before submitting issues in the future.

commented

My bad, I didn't realise this had been fixed. Issue exists for posterity if anybody else stumbles across it ๐Ÿ‘