Remove Ocean Biome

Discussion in 'Spigot Plugin Development' started by xXPlayer2000, May 29, 2017.

  1. Hey Guys can u tell me how to remove the Ocean biome without buggy biomes? And no i doesnt want to use a generator
     
  2. Try this:
    Code (Text):
    location.getBlock().setBiome(Biome);
    Notice: Biome is an enum, and you'll need that parameter for setBiome().
     
  3. That changes the overall textures and appearance of it, along with the text in the F3 menu, but I believe he means stopping the millions of blocks of water in the world. Just because it says plains, or any other biome doesn't mean the water should stay :p Assuming he wants something along the lines of a UHC world, where players can play, but not be interrupted by the horrible land generation to it.
     
  4. Thats right.
    My code is:
    Code (Text):
    public static void changeBiome(){
            try {
                String mojangPath = "net.minecraft.server." + Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
                Class clazz = Class.forName(mojangPath + ".BiomeBase");

                Field plainsField = clazz.getDeclaredField("PLAINS");
                plainsField.setAccessible(true);
                Object plainsBiome = plainsField.get(null);
               
                //Field hillsField = clazz.getDeclaredField("EXTREMEHILLS");
                //hillsField.setAccessible(true);
                //Object hillsBiome = plainsField.get(null);

                // Biomes liste auslesen
                Field biomesField = clazz.getDeclaredField("biomes");
                biomesField.setAccessible(true);
                Object[] biomes = (Object[]) biomesField.get(null);
                for(int i = 0; i < biomes.length; i++) {
                   
                    if(i == 0 || i == 10 || i == 14 || i == 24) {
                        biomes[i] = plainsBiome;
                    }
                    if(i == 140 || i == 16 || i == 25 || i == 26) {
                        biomes[i] = plainsBiome;
                    }
                }
                int o = 0;
                // Ocean auf Plains setzen
                biomesField.set(null, biomes);
            } catch (Exception e) {
                // Error
            }
           
            }
    And:
    Code (Text):
    changeBiome();
            WorldCreator worldCreator = new WorldCreator(UHC.plugin.worldName);
            worldCreator.environment(World.Environment.NORMAL);
            worldCreator.createWorld();
     
    NO Errors nothing.
     
    • Like Like x 1
  5. Well...
    Code (Text):
    catch (Exception e) {
      // Error
    }
    You're swallowing every exception without printing anything to the console. For debugging purposes you should either use your IDE's debug mode (if you set it up correctly) or at least print the exception (e.printStackTrace()).