MinecraftServer crashes when very quickly generating/unloading chunks
When i was generating a mod to pregenerate chunks in minecraft to improve its performance i ran into a issue.
Random Block Updates cause a crash when chunks near players get created/unload really quickly (less then a game tick).
Yes its done with a mod. But i am using only Minecrafts parts after the server tick happend to load chunks and directly calling to unload them.
Edit:
The reason why it could be a minecraft bug is this:
This function that calls the randomUpdate has the BlockLeave already found and its searching for the block again in the same call and it doesn't find it. And my pregenerator is not working while the main game is running. It only works after its done working.
WorldServer.class
IBlockState iblockstate = extendedblockstorage.get(k1, i2, l1); Block block = iblockstate.getBlock(); this.theProfiler.startSection("randomTick"); if (block.getTickRandomly()) { block.randomTick(this, new BlockPos(k1 + j, i2 + extendedblockstorage.getYLocation(), l1 + k), iblockstate, this.rand); }
BlockLeaves.class
private void destroy(World worldIn, BlockPos pos) { this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); worldIn.setBlockToAir(pos); }
Steps to replicate this:
1: Create a Chunkloader that generates chunks in a square/cycle in a 50-100 chunk radius.
2: Let the Chunkloader create a new chunk without a population and directly unload them and make sure its getting removed from the loaded chunk map after its generated
3: Place a Player inside of the area
4: Let the generator run.
If needed i can provide the sourcecode of the mod if it stays in a closed range.
---- Minecraft Crash Report ---- // Oops. Time: 17.10.17 19:16 Description: Exception ticking world java.lang.IllegalArgumentException: Cannot get property PropertyEnum{name=variant, clazz=class net.minecraft.block.BlockPlanks$EnumType, values=[oak, spruce, birch, jungle]} as it does not exist in BlockStateContainer{block=minecraft:air, properties=[]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:199) at net.minecraft.block.BlockOldLeaf.getSaplingDropChance(BlockOldLeaf.java:47) at net.minecraft.block.BlockLeaves.getDrops(BlockLeaves.java:281) at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:678) at net.minecraft.block.BlockLeaves.dropBlockAsItemWithChance(BlockLeaves.java:222) at net.minecraft.block.Block.dropBlockAsItem(Block.java:668) at net.minecraft.block.BlockLeaves.destroy(BlockLeaves.java:184) at net.minecraft.block.BlockLeaves.updateTick(BlockLeaves.java:176) at net.minecraft.block.Block.randomTick(Block.java:582) at net.minecraft.world.WorldServer.updateBlocks(WorldServer.java:492) at net.minecraft.world.WorldServer.tick(WorldServer.java:229) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:773) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:688) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:537) at java.lang.Thread.run(Unknown Source)
2017-10-18, 11:50 PM
2022-07-30, 07:19 AM
2020-02-17, 09:28 AM
0
1
-