コード例 #1
0
  /** Returns the BiomeGenBase related to the x, z position on the world. */
  @Override
  public BiomeGenBase getBiomeGenAt(int x, int z) {
    final BiomeGenBase biome = myBiomeCache.getBiomeGenAt(x, z);
    if (biome == null) return TechWorld.mainBiome;

    return biome;
  }
コード例 #2
0
  /**
   * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length,
   * cacheFlag (if false, don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
   */
  @Override
  public BiomeGenBase[] getBiomeGenAt(
      BiomeGenBase[] par1ArrayOfBiomeGenBase,
      int x,
      int y,
      int width,
      int length,
      boolean cacheFlag) {
    IntCache.resetIntCache();

    if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < width * length) {
      par1ArrayOfBiomeGenBase = new BiomeGenBase[width * length];
    }

    if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0) {
      final BiomeGenBase[] abiomegenbase1 = myBiomeCache.getCachedBiomes(x, y);
      System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, width * length);
      return par1ArrayOfBiomeGenBase;
    } else {
      final int[] aint = myBiomeIndexLayer.getInts(x, y, width, length);

      for (int i = 0; i < width * length; ++i) {
        if (aint[i] >= 0) {
          par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[aint[i]];
        } else {
          // Change this to a biome
          par1ArrayOfBiomeGenBase[i] = TechWorld.mainBiome;
        }
      }

      return par1ArrayOfBiomeGenBase;
    }
  }
コード例 #3
0
 @Override
 public int[] getCachedBiomes(int x, int z) {
   BiomeGenBase[] cached = handle.getCachedBiomes(x, z);
   int[] intCache = new int[cached.length];
   for (int i = 0; i < cached.length; i++) {
     intCache[i] = cached[i].biomeID;
   }
   return intCache;
 }
コード例 #4
0
 @Override
 public void cleanupCache() {
   handle.cleanupCache();
 }
コード例 #5
0
 @Override
 public int getBiome(int x, int z) {
   return handle.getBiomeGenAt(x, z).biomeID;
 }
コード例 #6
0
 /** Calls the WorldChunkManager's biomeCache.cleanupCache() */
 @Override
 public void cleanupCache() {
   myBiomeCache.cleanupCache();
 }