Check Block Underneath Crashing

Published by qSided on Mon, 03/30/2020 - 16:26
Status
Resolved
Type
Product/platform
MCreator/Windows
Priority
Normal
Issue description

When making a procedure for a sapling to check if the block it is on is grass or dirt the program is fine. Once you load into a world and place the sapling though, the game crashes immediately. There really isn't anything more too it than that.

Issue comments

When you place sapling, on block added is called and another sapling is placed on the same location. This new placement triggers on block added again. You get the idea?

The crash log reflects this:

java.lang.StackOverflowError: null
   at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:106) ~[?:?] {re:classloading}
   at net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(BlockSnapshot.java:106) ~[?:?] {re:classloading}
   at net.minecraft.world.World.setBlockState(World.java:206) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.minecraft.world.World.setBlockState(World.java:206) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:39) ~[?:?] {re:classloading}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:39) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:40) ~[?:?] {re:classloading}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:40) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:40) ~[?:?] {re:classloading}
   at net.qsided.extended.procedures.YorkSaplingBlockAddedProcedure.executeProcedure(YorkSaplingBlockAddedProcedure.java:40) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.qsided.extended.block.YorkSaplingBlock$CustomBlock.onBlockAdded(YorkSaplingBlock.java:105) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.block.BlockState.onBlockAdded(BlockState.java:268) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:285) ~[?:?] {re:classloading}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}
   at net.minecraft.world.World.setBlockState(World.java:214) ~[?:?] {re:classloading,pl:accesstransformer:B}

Don't be afraid to try to understand the crash logs ;)



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.