NucleoidMC / fantasy

Library to support creating dimensions at runtime
GNU Lesser General Public License v3.0
95 stars 26 forks source link

fix #14 #16

Closed Nolij closed 1 year ago

Nolij commented 1 year ago

In 1.19 the vanilla chunk generator now calls World::getSeed() to determine chunk generation seed. The default implementation simply uses the Overworld seed, not the configured seed for the given Fantasy world. RuntimeWorld now overrides this method to return the configured seed.

Nolij commented 1 year ago

Uhhhh hold on this might not work with random seeds.

Nolij commented 1 year ago

Has issues. Will re-open draft.

ashhhleyyy commented 1 year ago

Can't this just be changed to a draft?

Nolij commented 1 year ago

Can't this just be changed to a draft?

Couldn't find a way to do that. If you have a method please tell me.

EDIT: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request

No such button shows for me. Perhaps someone with write permissions to this repo can do that?

EDIT 2: I'm dumb. Draft now.

PengLx commented 1 year ago

I find this ChunkStatus package net.minecraft.world.chunk; And it seems to control chunk gen and it use the seed from World::getSeed()

PengLx commented 1 year ago

Due to this every world will spawn with same seed with overworld. And you can not modify seed in creating world. I try to use Mixin to modify that and its work. But I think We should have a database to save each seed for their world. `@Mixin(ServerWorld.class) public abstract class ServerWorldMixin {

@Overwrite
public long getSeed() {
    ServerWorld world = ServerWorld.class.cast(this);
    //TODO Check it is a fantasy world and read from file or database to return a seed that set in created.
    return ServerWorld.class.cast(this).getServer().getSaveProperties().getGeneratorOptions().getSeed();
}

} `

Nolij commented 1 year ago

1.19.3 brings necessary reworks. Will open new PR with new base branch.