ferrybig / multiworld

5 stars 16 forks source link

CUSTOMIZED worldGen type #15

Open Bodyash opened 5 years ago

Bodyash commented 5 years ago

This is WorldTypeBasedGenerator with org.Bukkit.WorldType.CUSTOMIZED and options for single MC.

Example: http://minecraft.tools/en/custom.php

Bodyash commented 5 years ago

I already tried to modify your code:

trying to set all options and pass it to default world gen

World still looks like default, but my custom generator should contain only 1 biome (works in singleplayer)

Very hard to understand everything in this code.

Bodyash commented 5 years ago

I'm sorry, Spigot 1.13 still have CUSTOMIZED world, but it's cannot be generated, so:

in WorldGenerator class i added:

BUFFET(new WorldTypeBasedGenerator(WorldType.BUFFET), "BUFFET" ,"Customized world, using presets");

in WorldTypeBasedGenerator class in makeWorld() method:

if(options.getFullGeneratorName().equalsIgnoreCase("BUFFET")) {
            ChunkGen env = WorldGenerator.getGenByName("NORMAL");
            options.setType(type);
            env.makeWorld(options);
        }else { // old code}

options object containts WorldType.Buffet

in WorldManager.loadWorld(String name):

if(world.getOptions() != null) { creator = creator.generatorSettings(world.getOptions()); }

So now creator have params.

and example config.yml for loading Buffet World (endless warm ocean):

worlds: f1: seed: -41241221 worldgen: BUFFET options: '{"biome_source":{"type":"minecraft:fixed","biomes":["minecraft:warm_ocean"]},"chunk_generator":{"type":"minecraft:surface"}}' difficulty: NORMAL autoload: true

AND IT`s Works!