当前位置: 首页>>代码示例>>Java>>正文


Java IntCache.resetIntCache方法代码示例

本文整理汇总了Java中net.minecraft.world.gen.layer.IntCache.resetIntCache方法的典型用法代码示例。如果您正苦于以下问题:Java IntCache.resetIntCache方法的具体用法?Java IntCache.resetIntCache怎么用?Java IntCache.resetIntCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.gen.layer.IntCache的用法示例。


在下文中一共展示了IntCache.resetIntCache方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: areBiomesViable

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:21,代码来源:FirmaBiomeProvider.java

示例2: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:23,代码来源:BiomeProviderATG.java

示例3: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:WorldChunkManagerSpace.java

示例4: getBiomeGenAt

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:WorldChunkManagerSpace.java

示例5: getRainfall

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
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;
  }
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:26,代码来源:ChunkManagerOld.java

示例6: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
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;
  }
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:19,代码来源:ChunkManagerOld.java

示例7: getBiomes

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:22,代码来源:BiomeProviderEarth.java

示例8: areBiomesViable

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:20,代码来源:BiomeProviderEarth.java

示例9: findBiomePosition

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:27,代码来源:BiomeProviderEarth.java

示例10: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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);
	}
}
 
开发者ID:kormic911,项目名称:EvilOcean,代码行数:27,代码来源:WorldChunkManagerOcean.java

示例11: getBiomeGenAt

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
}
 
开发者ID:kormic911,项目名称:EvilOcean,代码行数:23,代码来源:WorldChunkManagerOcean.java

示例12: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:tyronx,项目名称:vintagetg,代码行数:22,代码来源:WorldChunkManagerVC.java

示例13: getRainfall

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
  }
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:27,代码来源:ChunkManagerOld.java

示例14: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@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;
  }
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:20,代码来源:ChunkManagerOld.java

示例15: getBiomesForGeneration

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
/**
 * 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);
	}
}
 
开发者ID:Alex-the-666,项目名称:It-s-About-Time-Minecraft-Mod,代码行数:28,代码来源:WorldChunkManagerNowhere.java


注:本文中的net.minecraft.world.gen.layer.IntCache.resetIntCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。