1.15.2 Plot-like world generator

Discussion in 'Spigot Plugin Development' started by superblaze27, Feb 29, 2020.

  1. I need to make a world generator that essentially generates a plot world. How can this be done? I looked online but found nothing really helpful. (No, I do not want to use plotsquared etc.)
     
  2. Well if you dont want to use it, you could look at the source on how they do it.
     
  3. First, you could download a plot world and put in on the server.

    You could also use plugins like Multiverse who have world generators implemented for plot-worlds.

    Some plugins like the one you mentioned have their own, some other devs code their own generator (or this so called basic one I just found)

    Maybe you can get the gist of how they work.

    You could code your own but since there are so many already existing ones and you basically just want to create a world with plots, I'm sure you can save a lot of time and work with them.
     
    #3 Rawora, Mar 1, 2020
    Last edited: Mar 1, 2020
  4. Code (Java):
    public class Main extends JavaPlugin {

        @Override
        public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
            return new VoidGenerator();
        }

    }
    Code (Java):
    public class VoidGenerator extends ChunkGenerator {

        @Override
        public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) {
            ChunkData result = createChunkData(world);
            result.setRegion(0, 0, 0, 16, world.getMaxHeight(), 16, Material.VOID_AIR);
            for (int x1 = 0; x1 < 16; x1++) {
                for (int z1 = 0; z1 < 16; z1++) {
                    for (int y = 0; y < world.getMaxHeight(); y++) {
                        biome.setBiome(x1, y, z1, Biome.THE_VOID);
                    }
                }
            }
            return result;
        }

    }
     
    There is a lot more you can do with it, but this is the most simple implementation I could come up with as an example.