Example #1
0
 /** Given a chunk, find a random position in it. */
 protected static ChunkPosition getRandomSpawningPointInChunk(
     World par0World, int par1, int par2) {
   Chunk chunk = par0World.getChunkFromChunkCoords(par1, par2);
   int i = par1 * 16 + par0World.rand.nextInt(16);
   int j =
       par0World.rand.nextInt(chunk != null ? Math.max(128, chunk.getTopFilledSegment()) : 128);
   int k = par2 * 16 + par0World.rand.nextInt(16);
   return new ChunkPosition(i, j, k);
 }
Example #2
0
 /** Given a chunk, find a random position in it. */
 protected static ChunkPosition getRandomSpawningPointInChunk(
     World par0World, int par1, int par2) {
   Chunk chunk = par0World.getChunkFromChunkCoords(par1, par2);
   int i = par1 * 16 + par0World.rand.nextInt(16);
   int j = par2 * 16 + par0World.rand.nextInt(16);
   int k =
       par0World.rand.nextInt(
           chunk != null ? (chunk.getTopFilledSegment() + 16) - 1 : par0World.getActualHeight());
   return new ChunkPosition(i, k, j);
 }