The Lost Cities

The Lost Cities

59M Downloads

[1.15.2] Crash on starting a new single world, and when logging in to multiplayer -java.lang.RuntimeException: We are asking a region for a chunk out of bound | 0 0

ProsperCraft opened this issue ยท 5 comments

commented

Worldtype - Lost Caverns
lostcities-1.15-3.0.0-alpha.jar
forge-1.15.2-31.1.25
Modpack- TownCraft TWO Beta - 0.13
https://www.curseforge.com/minecraft/modpacks/towncraft/files/2904957

Server crashlog-
https://gist.github.com/ProsperCraft/819cc5ee38fabd929812ce5b6d34fe54

Server logs-
latest.log
debug.log

Client Log of crash when making a single player world-
2020-03-18-3.log

commented

I've seen the same crash, repeatedly. The lower I configure the city probability, the more exploring it takes to trigger the crash. Guessing it occurs when a city includes a chunk that includes a bee hive?

crash-2020-03-14_13.34.53-server.txt

Each crash has ChunkDriver.updateAdjacent calling (I think) updatePostPlacement on an instance of net.minecraft.block.BeehiveBlock.

Love the mod!

commented

I will check this out

commented

I have added some crash protection for this case for the next version to be released soon. Hope that helps

commented

I managed to catch this one in the debugger, so I could have a look around. I think I see the problem.

    private BlockState updateAdjacent(BlockState state, Direction direction, BlockPos pos, IChunk thisChunk) {
        BlockState adjacent = region.getBlockState(pos);
        if (adjacent.getBlock() instanceof LadderBlock) {
            return adjacent;
        }
        BlockState newAdjacent = null;
        try {
            newAdjacent = adjacent.getBlock().updatePostPlacement(adjacent, direction, state, region, pos, current);
        } catch (Exception e) {
            // We got an exception. For example for beehives there can potentially be a problem so in this case we just ignore it
            return adjacent;
        }
        if (newAdjacent != adjacent) {
            IChunk chunk = region.getChunk(pos);
            if (chunk == thisChunk || chunk.getStatus().isAtLeast(ChunkStatus.FULL)) {
                region.setBlockState(pos, newAdjacent, 0);
            }
        }
        return newAdjacent;
    }

If I understand what I'm seeing, this.current is a position relative to the current chunk, whereas pos is absolute. It looks like the updatePostPlacement method wants its 4th and 5th arguments to both be absolute.

I'll submit a PR.

commented

Good catch. I merged this and will release shortly. I will keep my current try/catch though. It can't hurt in case some mod does something bad in that method