daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Oct 20th, 2018 63 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. package DarkMessiahMods;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.src.IChunkProvider;
  6. import net.minecraft.src.World;
  7. import net.minecraft.src.WorldGenMinable;
  8. import cpw.mods.fml.common.IWorldGenerator;
  9.  
  10. public class WorldgeneratorNethermod implements IWorldGenerator
  11. {
  12.  public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  13.  {
  14.   switch (world.provider.worldType)
  15.   {
  16.    case -1: generateNether(world, random, chunkX*16, chunkZ*16);
  17.    case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
  18.   }
  19.  }
  20.  
  21.  
  22.  
  23.   private void generateSurface(World world, Random random, int blockX, int blockZ)
  24.  {
  25.   int XCoordinates = blockX + random.nextInt(16);
  26.   int YCoordinates = random.nextInt(60);
  27.   int ZCoordinates = blockZ + random.nextInt(16);
  28.  
  29.  
  30.  }
  31.  
  32.  private void generateNether(World world, Random random, int blockX, int blockZ)
  33.  {
  34.  int Xcoord = blockX + random.nextInt(16);
  35.  int Ycoord = random.nextInt(128);
  36.  int Zcoord = blockZ + random.nextInt(16);
  37.  
  38.  /*
  39.   * How to add another generation:
  40.   * add the same line as down here.
  41.   * Change the Orename, done!
  42.   */
  43.  (new WorldGenMinableNetherForDarkMessiahsMods(mod_DarkMessiahsMods.NetherriumOre.blockID, 10)).generate(world, random, Xcoord, Ycoord, Zcoord);
  44.  
  45.  
  46.  }
  47. }
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. package DarkMessiahMods;
  81.  
  82. import java.util.Random;
  83.  
  84. import net.minecraft.src.Block;
  85. import net.minecraft.src.MathHelper;
  86. import net.minecraft.src.World;
  87. import net.minecraft.src.WorldGenerator;
  88.  
  89. public class WorldGenMinableNetherForDarkMessiahsMods extends WorldGenerator
  90. {
  91.     /** The block ID of the ore to be placed using this generator. */
  92.     private int minableBlockId;
  93.  
  94.     private int metadata;
  95.    
  96.     /** The number of blocks to generate. */
  97.     private int numberOfBlocks;
  98.  
  99.     public WorldGenMinableNetherForDarkMessiahsMods(int par1, int par3)
  100.     {
  101.         minableBlockId = par1;
  102.         numberOfBlocks = par3;
  103.     }
  104.  
  105.     public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
  106.     {
  107.         float f = par2Random.nextFloat() * (float)Math.PI;
  108.         double d = (float)(par3 + 8) + (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
  109.         double d1 = (float)(par3 + 8) - (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
  110.         double d2 = (float)(par5 + 8) + (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
  111.         double d3 = (float)(par5 + 8) - (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
  112.         double d4 = (par4 + par2Random.nextInt(3)) - 2;
  113.         double d5 = (par4 + par2Random.nextInt(3)) - 2;
  114.  
  115.         for (int i = 0; i <= numberOfBlocks; i++)
  116.         {
  117.             double d6 = d + ((d1 - d) * (double)i) / (double)numberOfBlocks;
  118.             double d7 = d4 + ((d5 - d4) * (double)i) / (double)numberOfBlocks;
  119.             double d8 = d2 + ((d3 - d2) * (double)i) / (double)numberOfBlocks;
  120.             double d9 = (par2Random.nextDouble() * (double)numberOfBlocks) / 16D;
  121.             double d10 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
  122.             double d11 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
  123.             int j = MathHelper.floor_double(d6 - d10 / 2D);
  124.             int k = MathHelper.floor_double(d7 - d11 / 2D);
  125.             int l = MathHelper.floor_double(d8 - d10 / 2D);
  126.             int i1 = MathHelper.floor_double(d6 + d10 / 2D);
  127.             int j1 = MathHelper.floor_double(d7 + d11 / 2D);
  128.             int k1 = MathHelper.floor_double(d8 + d10 / 2D);
  129.  
  130.             for (int l1 = j; l1 <= i1; l1++)
  131.             {
  132.                 double d12 = (((double)l1 + 0.5D) - d6) / (d10 / 2D);
  133.  
  134.                 if (d12 * d12 >= 1.0D)
  135.                 {
  136.                     continue;
  137.                 }
  138.  
  139.                 for (int i2 = k; i2 <= j1; i2++)
  140.                 {
  141.                     double d13 = (((double)i2 + 0.5D) - d7) / (d11 / 2D);
  142.  
  143.                     if (d12 * d12 + d13 * d13 >= 1.0D)
  144.                     {
  145.                         continue;
  146.                     }
  147.  
  148.                     for (int j2 = l; j2 <= k1; j2++)
  149.                     {
  150.                         double d14 = (((double)j2 + 0.5D) - d8) / (d10 / 2D);
  151.  
  152.                         if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlockId(l1, i2, j2) ==Block.netherrack.blockID)
  153.                         {
  154.                             par1World.setBlock(l1, i2, j2, minableBlockId);
  155.                         }
  156.                     }
  157.                 }
  158.             }
  159.         }
  160.  
  161.         return true;
  162.     }
  163. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top