Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

World generation features are bounded by loaded chunks #19

Description

@OLEGSHA

When a worldgen feature is generated, only a 3x3x3 cube of chunks is guaranteed to be loaded. While this is enough for most features, some structures, mostly trees at this point, may need to exceed the inherent 16-block size limit.

Currently attempts to place blocks outside the 3x3x3 cube sometimes result in a crash because the chunk isn't loaded. This is correct behaviour for most circumstances but not for worldgen features. Instead, access to unloaded or not generated chunks should result in chunkloading. The chunk should be loaded as if it were part of the 3x3x3 cube: if it doesn't exist, generate terrain only.

To test the fix, set pine tree (TestTreeFeature) height to something like 40:

//int height = (int) stretch(size, 8, 12);
int height = (int) stretch(size, 40, 40);

This should work properly.

N.B.: A similar issue exists in Minecraft (see here for example). In MC, world population (analogous to feature generation) is triggered by terrain generation directly, so there is no fix for MC. In Progressia, features are triggered separately and so this shouldn't lead to problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions