1.15.2 Generating Islands

Discussion in 'Spigot Plugin Development' started by ChickenStyle, Sep 19, 2020.

  1. Hey, I am trying to create a custom world generator that should look something like this (except the color):
    [​IMG]


    Here is what I have up to now:
    [​IMG]

    Code (Java):
        @Override
        public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
            SimplexOctaveGenerator generator = new SimplexOctaveGenerator(new Random(world.getSeed()),8);
            ChunkData chunk = createChunkData(world);
            generator.setScale(0.02D);
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    double generatedNoise = generator.noise(chunkX*16+x, chunkZ*16+z, 0.6D,0.8D);
                    int currentHeight = (int) ((generatedNoise * 7D)+70D);
                   
                    double minY = (currentHeight - ((generatedNoise*generatedNoise*0.85) *9D) + 2);
                   
                    if (currentHeight > 73) {
                        chunk.setBlock(x, currentHeight, z, Material.GRASS_BLOCK);
                        for (int i = currentHeight - 1; i > minY;i--) {
                            if (random.nextBoolean()) {
                                chunk.setBlock(x, i, z, Material.STONE);
                            } else {
                                chunk.setBlock(x, i, z, Material.MOSSY_COBBLESTONE);
                            }
                        }
                    }
               
                   
                   
                   
                }
            }
            return chunk;
        }


    how can I improve/change the code to make it look more like in the first picture?
     
    • Like Like x 2
  2. bump
     
    • Like Like x 1
  3. You can generate world as a forest biome with end generation, this is done with the buffet generation type i believe. Then just copy the world and drop it in ur server
     
  4. Hm, maybe It will work, I will try that out

    Maybe I should try to decode the mod and try to understand how the code works

    Couldn't find anything useful, still looking for help)
     
    #6 ChickenStyle, Sep 21, 2020
    Last edited by a moderator: Sep 23, 2020
    • Agree Agree x 1
  5. I can't give you a full answer (that's why I didn't answer it initially) , but maybe a hint. You already have the base for generating islands, the trick now is choosing the right parameters/constants. To get more extreme hills, you might try increasing the scale (now 0.02)? Another thing you might want to do is to tweek minY a bit so it is a bit lower (so the island flatten off more near the edges).

    What helped most in my plugin was separating the generator that decides on islands from the generator that does the heigth:
    I made two SimplexOctaveGenerator's. One decides whether or not there is an island when you loop over x and z, I call it "islandGenerator". For example when it returns something greater than 0.5 (make sure to set the generator.noise(...) to normalise its output) there should be land here. Now use the second generator to actually decide the height/terrain of the island. This way you can choose island frequency and size based on islandgenerator and control the steepness separately with the second generator.
     
    • Like Like x 1
  6. I will try to do something like this,thanks!
     
  7. Let me know how it turns out, I am curious to see how much you can do with this approach! (never fully finished mine but looked promising for me)
     
  8. yeah sure, btw how did you make this cool signature image? like it has exact downloads and reviews, how xD
     
  9. Take a look at https://mcbanners.com/, they provide a free and awesome service for it! You can create a lot of them, also for user profiles (once you make an account). You can however only have one image on spigot signature unless you donate to spigot.
     
    • Like Like x 1
  10. yeah but like how it has the exact amount of downloads and reviews? does it change or something like this?

    edit: oh shit, it looks really nice
     
    #12 ChickenStyle, Sep 23, 2020
    Last edited: Sep 23, 2020
    • Agree Agree x 1
  11. Yeah they update the images periodically, so the reviews etc update with a certain delay. I wish I had a plugin with 2K downloads though haha.
     
  12. Lol yeah, it was my first plugin and its kinda, 'kinda' famous xD because the idea is unique and its very useful plugin