Attempting to get info for unloaded block
Harleyoc1 opened this issue ยท 1 comments
Branches and blocks need to query adjacent blocks in Block.getShape
, but sometimes doing so requests information from an unloaded chunk, causing a crash (or spamming the console if surrounded with try/catch).
There should be a way of checking if the chunk is loaded before querying the block state, but it will need to be looked into further. For now, we just catch the exception and log it.
Fixed using this method, which uses another new method (isBlockLoaded
) to check a block is loaded from an IBlockReader
, and returns null if not instead of Minecraft crashing (or spamming errors to the logs if you surround with try/catch).