/** 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; }
/** * 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; } }
@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; }
@Override public void cleanupCache() { handle.cleanupCache(); }
@Override public int getBiome(int x, int z) { return handle.getBiomeGenAt(x, z).biomeID; }
/** Calls the WorldChunkManager's biomeCache.cleanupCache() */ @Override public void cleanupCache() { myBiomeCache.cleanupCache(); }