Java 类net.minecraft.world.gen.layer.IntCache 实例源码

项目:Firma    文件:FirmaBiomeProvider.java   
@Override
public boolean areBiomesViable(int x, int z, int radius, List<Biome> allowed) {
    IntCache.resetIntCache();
    int var5 = x - radius >> 2;
    int var6 = x - radius >> 2;
    int var7 = x + radius >> 2;
    int var8 = z + radius >> 2;
    int var9 = var7 - var5 + 1;
    int var10 = var8 - var6 + 1;
    int[] var11 = this.genBiomes.getInts(var5, var6, var9, var10);

    for (int var12 = 0; var12 < var9 * var10; ++var12) {
        FirmaBiome var13 = FirmaBiome.getBiomeList()[var11[var12]];
        if (!allowed.contains(var13)) {
            throw new RuntimeException("Non-viable biome");
            // return false;
        }
    }
    return true;
}
项目:Firma    文件:FirmaBiomeProvider.java   
@Override
public Biome[] getBiomes(Biome[] biome, int x, int z, int width, int height, boolean useCache) {
    IntCache.resetIntCache();

    if (biome == null || biome.length < width * height)
        biome = new FirmaBiome[width * height];

    if (useCache && width == 16 && height == 16 && (x & 15) == 0 && (z & 15) == 0) {
        Biome[] var9 = this.biomeCache.getCachedBiomes(x, z);
        System.arraycopy(var9, 0, biome, 0, width * height);
        return biome;
    }
    int[] var7 = this.biomeIndexLayer.getInts(x, z, width, height);
    for (int zCoord = 0; zCoord < width; ++zCoord) {
        for (int xCoord = 0; xCoord < height; ++xCoord) {
            int id = var7[zCoord * width + xCoord] != -1 ? var7[zCoord * width + xCoord] : 0;
            biome[zCoord * width + xCoord] = FirmaBiome.getBiome(id);
        }
    }
    return biome;
}
项目:Firma    文件:FirmaGenLayerBiome.java   
/**
 * Takes Continent data (only 0's and 1's) and for anything not ocean it throws any of the allowed biomes back. Can't help but wonder if I could do better than "Any of allowed" and possibly have hills mostly in-land etc. Will have to see
 */
@Override
public int[] getInts(int x, int y, int w, int h)
{
    int[] parentInts = this.parent.getInts(x, y, w, h);
    int[] newInts = IntCache.getIntCache(w * h);

    for (int currentX = 0; currentX < h; ++currentX)
    {
        for (int currentY = 0; currentY < w; ++currentY)
        {
            this.initChunkSeed(currentY + x, currentX + y);
            int id = parentInts[currentY + currentX * w];
            newInts[currentY+currentX*w]=id;
            if (id==0){
                newInts[currentY + currentX * w] = Layer.OCEAN;
            }else if(id==Layer.DOCEAN){
                continue;
            }else{ 
                newInts[currentY + currentX * w] = Biome.getIdForBiome(this.allowedBiomes[this.nextInt(this.allowedBiomes.length)]);
            }
        }
    }
    validateIntArray(newInts, w, h);
    return newInts;
}
项目:Firma    文件:FirmaGenLayerIsland.java   
@Override
public int[] getInts(int par1, int par2, int maxX, int maxZ)
{
    int[] var5 = IntCache.getIntCache(maxX * maxZ);

    for (int z = 0; z < maxZ; ++z)
    {
        for (int x = 0; x < maxX; ++x)
        {
            this.initChunkSeed(par1 + x, par2 + z);
            var5[x + z * maxX] = this.nextInt(4) == 0 ? 1 : 0;
        }
    }

    if (par1 > -maxX && par1 <= 0 && par2 > -maxZ && par2 <= 0)
        var5[-par1 + -par2 * maxX] = 1;

    return var5;
}
项目:modName    文件:BiomeProviderATG.java   
@Override
public Biome[] getBiomesForGeneration(Biome[] biomes, int x, int z, int width, int height)
{
    IntCache.resetIntCache();

    if (biomes == null || biomes.length < width * height)
    {
        biomes = new Biome[width * height];
    }

    int ix,iz,bx,bz;
    for (ix = 0; ix < width; ++ix) {
        for (iz = 0; iz < height; ++iz) {
            bx = x + ix;
            bz = z + iz;

            biomes[iz*width + ix] = getBestBiome(bx,bz);
        }
    }

    return biomes;
}
项目:4Space-5    文件:WorldChunkManagerSpace.java   
@Override
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
{
    IntCache.resetIntCache();

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

    for (int var7 = 0; var7 < par4 * par5; ++var7)
    {
        par1ArrayOfBiomeGenBase[var7] = this.getBiome();
    }

    return par1ArrayOfBiomeGenBase;
}
项目:4Space-5    文件:WorldChunkManagerSpace.java   
@Override
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6)
{
    IntCache.resetIntCache();

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

    if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0)
    {
        final BiomeGenBase[] var9 = this.biomeCache.getCachedBiomes(par2, par3);
        System.arraycopy(var9, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
        return par1ArrayOfBiomeGenBase;
    }
    else
    {
        for (int var8 = 0; var8 < par4 * par5; ++var8)
        {
            par1ArrayOfBiomeGenBase[var8] = this.getBiome();
        }

        return par1ArrayOfBiomeGenBase;
    }
}
项目:MidgarCrusade    文件:ChunkManagerOld.java   
public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

      if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
      {
          par1ArrayOfFloat = new float[par4 * par5];
      }

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          float var8 = (float)BiomeGenBase.getBiome(var6[var7]).getIntRainfall() / 65536.0F;

          if (var8 > 1.0F)
          {
              var8 = 1.0F;
          }

          par1ArrayOfFloat[var7] = var8;
      }

      return par1ArrayOfFloat;
  }
项目:MidgarCrusade    文件:ChunkManagerOld.java   
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

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

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          par1ArrayOfBiomeGenBase[var7] = BiomeGenBase.getBiome(var6[var7]);
      }

      return par1ArrayOfBiomeGenBase;
  }
项目:Geographicraft    文件:GenLayerRiverInit.java   
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4)
{
    int[] aint = this.parent.getInts(par1, par2, par3, par4);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
            aint1[j1 + i1 * par3] = aint[j1 + i1 * par3] > 0 ? this.nextInt(299999) + 2 : 0;
        }
    }

    return aint1;
}
项目:Geographicraft    文件:GenLayerSwampRivers.java   
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4)
{
    int[] aint = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
            int k1 = aint[j1 + 1 + (i1 + 1) * (par3 + 2)];

            if ((k1 != Biome.getIdForBiome(Biomes.SWAMPLAND) || this.nextInt(6) != 0) && (k1 != Biome.getIdForBiome(Biomes.JUNGLE) && k1 != Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || this.nextInt(8) != 0))
            {
                aint1[j1 + i1 * par3] = k1;
            }
            else
            {
                aint1[j1 + i1 * par3] = Biome.getIdForBiome(Biomes.RIVER);
            }
        }
    }

    return aint1;
}
项目:Geographicraft    文件:GenLayerIsland.java   
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4)
{
    int[] aint = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((long)(par1 + j1), (long)(par2 + i1));
            aint[j1 + i1 * par3] = this.nextInt(squaresPerLand) == 0 ? 1 : 0;
        }
    }

    if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
    {
        //aint[-par1 + -par2 * par3] = 1;
    }

    return aint;
}
项目:Geographicraft    文件:GenLayerEdge.java   
private int[] getIntsSpecial(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_)
{
    int[] aint = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_);
    int[] aint1 = IntCache.getIntCache(p_151625_3_ * p_151625_4_);

    for (int i1 = 0; i1 < p_151625_4_; ++i1)
    {
        for (int j1 = 0; j1 < p_151625_3_; ++j1)
        {
            this.initChunkSeed((long)(j1 + p_151625_1_), (long)(i1 + p_151625_2_));
            int k1 = aint[j1 + i1 * p_151625_3_];

            if (k1 != 0 && this.nextInt(13) == 0)
            {
                k1 |= 1 + this.nextInt(15) << 8 & 3840;
            }

            aint1[j1 + i1 * p_151625_3_] = k1;
        }
    }

    return aint1;
}
项目:Geographicraft    文件:GenLayerLessRiver.java   
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4){
    int[] aint = this.parent.getInts(par1, par2, par3, par4);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
            aint1[j1 + i1 * par3] = aint[j1 + i1 * par3] > 0 ? this.nextInt(299999) + 2 : 0;
            if (aint1[j1 + i1 * par3]>0) {
                if (this.nextInt(100)<percentageReduction) {
                    aint1[j1 + i1 * par3]=0;
                }
            }

        }
    }

    return aint1;
}
项目:Geographicraft    文件:GenLayerEncode.java   
/**
 * Every pixel of "water" (value 0) has percentFilled chance of being made land
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4) {
    int i1 = par1;
    int j1 = par2;
    int k1 = par3;
    int l1 = par4;
    int[] aint = this.parent.getInts(i1, j1, k1, l1);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    encoding = new HashMap<Integer,Integer>(par3 * par4);
    for (int i2 = 0; i2 < par4; ++i2){
        for (int j2 = 0; j2 < par3; ++j2){
            this.initChunkSeed((long)(j2 + par1), (long)(i2 + par2));
            int code = nextInt(Integer.MAX_VALUE);
            aint1[j2 + i2 * par3] = code;
            encoding.put(code,aint[j2 + i2 * par3]);
        }
    }

    return aint1;
}
项目:Earth    文件:BiomeProviderEarth.java   
@Override
public Biome[] getBiomes(Biome[] biomes, int x, int z, int width, int length, boolean cache) {
    IntCache.resetIntCache();
    if (biomes == null || biomes.length < width * length) {
        biomes = new Biome[width * length];
    }
    if (cache && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0) {
        Biome[] cachedBiomes = this.biomeCache.getCachedBiomes(x, z);
        System.arraycopy(cachedBiomes, 0, biomes, 0, width * length);
        return biomes;
    } else {
        int i = 0;
        for (int partZ = 0; partZ < length; ++partZ) {
            for (int partX = 0; partX < width; ++partX) {
                biomes[i] = this.getBiomeAt(partX + x, partZ + z);
                i++;
            }
        }
        return biomes;
    }
}
项目:Earth    文件:BiomeProviderEarth.java   
@Override
public boolean areBiomesViable(int x, int z, int radius, List<Biome> allowed) {
    IntCache.resetIntCache();
    int minX = x - radius >> 2;
    int minZ = z - radius >> 2;
    int maxX = x + radius >> 2;
    int maxZ = z + radius >> 2;
    int width = maxX - minX + 1;
    int length = maxZ - minZ + 1;
    for (int partZ = 0; partZ < length; ++partZ) {
        for (int partX = 0; partX < width; ++partX) {
            Biome biome = this.getBiomeAt(partX + x, partZ + z);
            if (!allowed.contains(biome)) {
                return false;
            }
        }
    }
    return true;
}
项目:Earth    文件:BiomeProviderEarth.java   
@Override
public BlockPos findBiomePosition(int x, int z, int radius, List<Biome> biomes, Random random) {
    IntCache.resetIntCache();
    int minX = x - radius >> 2;
    int minZ = z - radius >> 2;
    int maxX = x + radius >> 2;
    int maxZ = z + radius >> 2;
    int width = maxX - minX + 1;
    int length = maxZ - minZ + 1;
    BlockPos pos = null;
    int j2 = 0;
    int i = 0;
    for (int partZ = 0; partZ < length; ++partZ) {
        for (int partX = 0; partX < width; ++partX) {
            int chunkX = minX + i % width << 2;
            int chunkZ = minZ + i / width << 2;
            Biome biome = this.getBiomeAt(partX + x, partZ + z);
            if (biomes.contains(biome) && (pos == null || random.nextInt(j2 + 1) == 0)) {
                pos = new BlockPos(chunkX, 0, chunkZ);
                ++j2;
            }
            i++;
        }
    }
    return pos;
}
项目:EvilOcean    文件:WorldChunkManagerOcean.java   
@Override
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
    IntCache.resetIntCache();

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

    int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);
    try {
        for (int i1 = 0; i1 < par4 * par5; ++i1) {
            par1ArrayOfBiomeGenBase[i1] = BiomesOcean.getBiome(aint[i1]);
        }

        return par1ArrayOfBiomeGenBase;
    } catch (Throwable throwable) {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
        crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
        crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
        crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
        crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
        crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
        throw new ReportedException(crashreport);
    }
}
项目:EvilOcean    文件:WorldChunkManagerOcean.java   
@Override
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6) {
    IntCache.resetIntCache();

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

    if ((par6) && (par4 == 16) && (par5 == 16) && ((par2 & 0xF) == 0) && ((par3 & 0xF) == 0)) {
        BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(par2, par3);
        System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
        return par1ArrayOfBiomeGenBase;
    }

    int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

    for (int i1 = 0; i1 < par4 * par5; ++i1) {
        par1ArrayOfBiomeGenBase[i1] = BiomesOcean.getBiome(aint[i1]);
    }

    return par1ArrayOfBiomeGenBase;
}
项目:PopularMMOS-EpicProportions-Mod    文件:GenLayerBiomeEpic.java   
/**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_)
    {
        int[] aint = this.parent.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_);
        int[] aint1 = IntCache.getIntCache(p_75904_3_ * p_75904_4_);

        for (int i1 = 0; i1 < p_75904_4_; ++i1)
        {
            for (int j1 = 0; j1 < p_75904_3_; ++j1)
            {
                this.initChunkSeed((long)(j1 + p_75904_1_), (long)(i1 + p_75904_2_));
                int k1 = aint[j1 + i1 * p_75904_3_];
                int l1 = (k1 & 3840) >> 8;
                k1 &= -3841;


        }


    }
        return aint1;
}
项目:McWorldGenLoop    文件:PlainsIslandTileable.java   
@Override
public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) {
    int[] aint = IntCache.getIntCache(areaWidth * areaHeight);

    for (int i1 = 0; i1 < areaHeight; ++i1) {
        for (int j1 = 0; j1 < areaWidth; ++j1) {
            this.initChunkSeed((long) (areaX + j1), (long) (areaY + i1));
            aint[j1 + i1 * areaWidth] = this.nextInt(10) == 0 ? 1 : 0;
        }
    }

    // don't do that
    // if(areaX>-areaWidth&&areaX<=0&&areaY>-areaHeight&&areaY<=0){
    // ////aint[-areaX + -areaY * areaWidth] = 1;
    // }

    return aint;
}
项目:vintagetg    文件:WorldChunkManagerVC.java   
/**
 * Returns an array of biomes for the location input.
 */
@Override
public BiomeVC[] getBiomesForGeneration(BiomeGenBase[] biomebase, int x, int y, int width, int height) {
    IntCache.resetIntCache();

    BiomeVC[] biomes = (BiomeVC[]) biomebase;
    if (biomes == null || biomes.length < width * height) {
        biomes = new BiomeVC[width * height];
    }

    int[] intmap = this.genBiomes.getInts(x, y, width, height);

    for (int i = 0; i < width * height; ++i) {
        int index = Math.max(intmap[i], 0);
        biomes[i] = BiomeVC.biomeList[index];
    }

    return biomes;
}
项目:vintagetg    文件:GenLayerBlurAll.java   
@Override
public int[] getInts(int xCoord, int zCoord, int sizeX, int sizeZ) {
    int margin = 10;

    xCoord -= margin;
    zCoord -= margin;
    sizeX += 2*margin;
    sizeZ += 2*margin;

    int[] inInts = this.parent.getInts(xCoord, zCoord, sizeX, sizeZ);
    int[] outInts = IntCache.getIntCache(inInts.length);

    Kernel kernel = makeKernel(radius);

    for (int i = 0; i < iterations; i++) {
        gaussBlurGrayScale(kernel, inInts, outInts, sizeX, sizeZ);
        gaussBlurGrayScale(kernel, outInts, inInts, sizeZ, sizeX);
    }

    return cutMargins(inInts, sizeX, sizeZ, margin);
}
项目:vintagetg    文件:WorldChunkManagerFlatVC.java   
@Override
public BiomeVC[] getBiomesForGeneration(BiomeGenBase[] biomebase, int x, int y, int width, int height) {
    IntCache.resetIntCache();

    BiomeVC[] biomes = (BiomeVC[]) biomebase;
    if (biomes == null || biomes.length < width * height) {
        biomes = new BiomeVC[width * height];
    }

    for (int i = 0; i < width * height; ++i) {
        biomes[i] = BiomeVC.Flat;
    }

    //System.out.println("length: " + biomes.length);
    return biomes;
}
项目:Rediscovered-Mod-1.8    文件:ChunkManagerOld.java   
@Override
  public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

      if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
      {
          par1ArrayOfFloat = new float[par4 * par5];
      }

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          float var8 = (float)BiomeGenBase.getBiome(var6[var7]).getIntRainfall() / 65536.0F;

          if (var8 > 1.0F)
          {
              var8 = 1.0F;
          }

          par1ArrayOfFloat[var7] = var8;
      }

      return par1ArrayOfFloat;
  }
项目:Rediscovered-Mod-1.8    文件:ChunkManagerOld.java   
@Override
  public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

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

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          par1ArrayOfBiomeGenBase[var7] = BiomeGenBase.getBiome(var6[var7]);
      }

      return par1ArrayOfBiomeGenBase;
  }
项目:It-s-About-Time-Minecraft-Mod    文件:WorldChunkManagerNowhere.java   
/**
 * Returns an array of biomes for the location input.
 */
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
{
    IntCache.resetIntCache();if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
    {
        par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
    }int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);try
    {
        for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            par1ArrayOfBiomeGenBase[i1] = BiomeGenBase.getBiome(aint[i1]);
        }return par1ArrayOfBiomeGenBase;
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
        crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
        crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
        crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
        crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
        crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
        throw new ReportedException(crashreport);
    }
}
项目:It-s-About-Time-Minecraft-Mod    文件:WorldChunkManagerNowhere.java   
/**
 * 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)
 */
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6)
{
    IntCache.resetIntCache();if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
    {
        par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
    }if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0)
    {
        BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(par2, par3);
        System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
        return par1ArrayOfBiomeGenBase;
    }
    else
    {
        int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            par1ArrayOfBiomeGenBase[i1] = BiomeGenBase.getBiome(aint[i1]);
        }return par1ArrayOfBiomeGenBase;
    }
}
项目:It-s-About-Time-Minecraft-Mod    文件:WorldChunkManagerCretaceous.java   
/**
 * Returns an array of biomes for the location input.
 */
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
{
    IntCache.resetIntCache();if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
    {
        par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
    }int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);try
    {
        for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            par1ArrayOfBiomeGenBase[i1] = BiomeGenBase.getBiome(aint[i1]);
        }return par1ArrayOfBiomeGenBase;
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
        crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
        crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
        crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
        crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
        crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
        throw new ReportedException(crashreport);
    }
}
项目:It-s-About-Time-Minecraft-Mod    文件:WorldChunkManagerCretaceous.java   
/**
 * 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)
 */
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6)
{
    IntCache.resetIntCache();if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
    {
        par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
    }if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0)
    {
        BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(par2, par3);
        System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
        return par1ArrayOfBiomeGenBase;
    }
    else
    {
        int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            par1ArrayOfBiomeGenBase[i1] = BiomeGenBase.getBiome(aint[i1]);
        }return par1ArrayOfBiomeGenBase;
    }
}
项目:AdvancedRocketry    文件:GenLayerBiomePlanet.java   
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 * @param properties 
 */
public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_)
{
    //int[] aint = this.parent.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_);
    int[] aint1 = IntCache.getIntCache(p_75904_3_ * p_75904_4_);

    for (int i1 = 0; i1 < p_75904_4_; ++i1)
    {
        for (int j1 = 0; j1 < p_75904_3_; ++j1)
        {
            this.initChunkSeed((long)(j1 + p_75904_1_), (long)(i1 + p_75904_2_));

            aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry().biome.biomeID;

        }
    }

    //TODO: DEBUG:
    //Arrays.fill(aint1, BiomeGenBase.desert.biomeID);

    return aint1;
}
项目:Rediscovered-Mod-1.8.8    文件:ChunkManagerOld.java   
@Override
  public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

      if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
      {
          par1ArrayOfFloat = new float[par4 * par5];
      }

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          float var8 = (float)BiomeGenBase.getBiome(var6[var7]).getIntRainfall() / 65536.0F;

          if (var8 > 1.0F)
          {
              var8 = 1.0F;
          }

          par1ArrayOfFloat[var7] = var8;
      }

      return par1ArrayOfFloat;
  }
项目:Rediscovered-Mod-1.8.8    文件:ChunkManagerOld.java   
@Override
  public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
  {
      IntCache.resetIntCache();

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

int var6[] = getBiomesGens(par2, par3, par4, par5);

      for (int var7 = 0; var7 < par4 * par5; ++var7)
      {
          par1ArrayOfBiomeGenBase[var7] = BiomeGenBase.getBiome(var6[var7]);
      }

      return par1ArrayOfBiomeGenBase;
  }
项目:atlantis-mod    文件:WorldChunkManagerAtlantis.java   
public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) {
    IntCache.resetIntCache();

    if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
    {
        par1ArrayOfFloat = new float[par4 * par5];
    }

    int[] aint = this.myBiomeIndexLayer.getInts(par2, par3, par4, par5);

    for (int i1 = 0; i1 < par4 * par5; ++i1)
    {
        float f = (float) BiomeGenBase.getBiomeGenArray()[aint[i1]].getIntRainfall() / 65536.0F;

        if (f > 1.0F) {
            f = 1.0F;
        }

        par1ArrayOfFloat[i1] = f;
    }

    return par1ArrayOfFloat;
}
项目:atlantis-mod    文件:WorldChunkManagerAtlantis.java   
public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) {
    IntCache.resetIntCache();

    if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
    {
        par1ArrayOfFloat = new float[par4 * par5];
    }

    int[] aint = this.myBiomeIndexLayer.getInts(par2, par3, par4, par5);

    for (int i1 = 0; i1 < par4 * par5; ++i1)
    {
        float f = (float) ((int)BiomeGenBase.getBiomeGenArray()[aint[i1]].temperature) / 65536.0F;

        if (f > 1.0F) {
            f = 1.0F;
        }

        par1ArrayOfFloat[i1] = f;
    }

    return par1ArrayOfFloat;
}
项目:atlantis-mod    文件:WorldChunkManagerAtlantis.java   
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) {
    IntCache.resetIntCache();

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

    int[] aint = this.myGenBiomes.getInts(par2, par3, par4, par5);

    for (int i = 0; i < par4 * par5; ++i) {
        if (aint[i] >= 0) {
            par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiomeGenArray()[aint[i]];
        } else {
            par1ArrayOfBiomeGenBase[i] = AtlantisMod.atlantisOcean;
        }
    }

    return par1ArrayOfBiomeGenBase;
}
项目:atlantis-mod    文件:WorldChunkManagerAtlantis.java   
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) {
        BiomeGenBase[] abiomegenbase1 = this.myBiomeCache.getCachedBiomes(x, y);
        System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, width * length);
        return par1ArrayOfBiomeGenBase;
    } else {
        int[] aint = this.myBiomeIndexLayer.getInts(x, y, width, length);

        for (int i = 0; i < width * length; ++i) {
            if (aint[i] >= 0) {
                par1ArrayOfBiomeGenBase[i] = BiomeGenBase.getBiomeGenArray()[aint[i]];
            } else {
                par1ArrayOfBiomeGenBase[i] = AtlantisMod.atlantisOcean;
            }
        }

        return par1ArrayOfBiomeGenBase;
    }
}
项目:atlantis-mod    文件:WorldChunkManagerAtlantis.java   
public boolean areBiomesViable(int par1, int par2, int par3, List par4List) {
    IntCache.resetIntCache();
    int l = par1 - par3 >> 2;
    int i1 = par2 - par3 >> 2;
    int j1 = par1 + par3 >> 2;
    int k1 = par2 + par3 >> 2;
    int l1 = j1 - l + 1;
    int i2 = k1 - i1 + 1;
    int[] aint = this.myGenBiomes.getInts(l, i1, l1, i2);

    for (int j2 = 0; j2 < l1 * i2; ++j2) {
        BiomeGenBase biomegenbase = BiomeGenBase.getBiomeGenArray()[aint[j2]];

        if (!par4List.contains(biomegenbase)) {
            return false;
        }
    }

    return true;
}
项目:vintagecraft    文件:GenLayerBlurAll.java   
@Override
public int[] getInts(int xCoord, int zCoord, int sizeX, int sizeZ) {
    int margin = 10;

    xCoord -= margin;
    zCoord -= margin;
    sizeX += 2*margin;
    sizeZ += 2*margin;

    int[] inInts = this.parent.getInts(xCoord, zCoord, sizeX, sizeZ);
    int[] outInts = IntCache.getIntCache(inInts.length);

    Kernel kernel = makeKernel(radius);

    for (int i = 0; i < iterations; i++) {
        gaussBlurGrayScale(kernel, inInts, outInts, sizeX, sizeZ);
        gaussBlurGrayScale(kernel, outInts, inInts, sizeZ, sizeX);
    }

    return cutMargins(inInts, sizeX, sizeZ, margin);
}