Disable Diamond Ore From Generating

Discussion in 'Spigot Plugin Help' started by rp1, Mar 8, 2020.

  1. rp1

    rp1

    Hello, I have been looking and can't seem to find exactly what I need. I am using 1.12.2, and am trying to make it where when ores are generated on chunk generation, Diamond ores are not generated at all.

    This is what I have so far:

    Code (Java):
    public class Main extends JavaPlugin
    {
        @Override
        public void onEnable()
        {
            generateOres();
        }
       
        protected int chunk_X;
        protected int chunk_Z;
        protected World currentWorld;
        protected Random randomGenerator;
        protected BlockPosition b;
       
        protected WorldGenerator dirtGen;
        protected WorldGenerator gravelGen;
        protected WorldGenerator coalGen;
        protected WorldGenerator ironGen;
        protected WorldGenerator goldGen;
        protected WorldGenerator redstoneGen;
        protected WorldGenerator diamondGen;
        protected WorldGenerator lapisGen;
        protected WorldGenerator rubyGen;
        protected WorldGenerator tinGen;
        protected WorldGenerator copperGen;
        protected WorldGenerator silverGen;
        protected WorldGenerator aluminiumGen;
        protected WorldGenerator titaniumGen;
       
        protected void generateOres()
        {
            this.genStandardOre1(20, this.dirtGen, 0, 128);
            this.genStandardOre1(10, this.gravelGen, 0, 128);
            this.genStandardOre1(20, this.coalGen, 0, 128);
            this.genStandardOre1(20, this.ironGen, 0, 64);
            this.genStandardOre1(2, this.goldGen, 0, 32);
            this.genStandardOre1(8, this.redstoneGen, 0, 16);
            this.genStandardOre1(0, this.diamondGen, 0, 0);
            this.genStandardOre2(1, this.lapisGen, 16, 16);
            this.genStandardOre1(20, this.rubyGen, 0, 128);
            this.genStandardOre1(20, this.tinGen, 0, 64);
            this.genStandardOre1(20, this.copperGen, 0, 64);
            this.genStandardOre1(20, this.silverGen, 0, 64);
            this.genStandardOre1(20, this.aluminiumGen, 0, 64);
            this.genStandardOre1(20, this.titaniumGen, 0, 64);
        }
       
        protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4)
        {
            for (int var5 = 0; var5 < par1; ++var5)
            {
                int var6 = this.chunk_X + this.randomGenerator.nextInt(16);
                int var7 = this.randomGenerator.nextInt(par4 - par3) + par3;
                int var8 = this.chunk_Z + this.randomGenerator.nextInt(16);
               
                BlockPosition blockposition = this.b.a(var6, var7, var8);
               
                par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, blockposition);
            }
        }
       
        protected void genStandardOre2(int par1, WorldGenerator par2WorldGenerator, int par3, int par4)
        {
            for (int var5 = 0; var5 < par1; ++var5)
            {
                int var6 = this.chunk_X + this.randomGenerator.nextInt(16);
                int var7 = this.randomGenerator.nextInt(par4) + this.randomGenerator.nextInt(par4) + (par3 - par4);
                int var8 = this.chunk_Z + this.randomGenerator.nextInt(16);

                BlockPosition blockposition = this.b.a(var6, var7, var8);
               
                par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, blockposition);
            }
        }
    }
     
  2. Generate a world in single player with the world type customized, then click customize and go to page 2 and set all perimeters of diamond ore to their smallest value. Then upload it to the server.
     
  3. rp1

    rp1

    This isn't what I want. I am trying to generate worlds periodically for my server, so I don't want it done manually