本文整理汇总了Java中net.minecraft.world.gen.layer.IntCache类的典型用法代码示例。如果您正苦于以下问题:Java IntCache类的具体用法?Java IntCache怎么用?Java IntCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntCache类属于net.minecraft.world.gen.layer包,在下文中一共展示了IntCache类的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;
}
示例2: getBiomes
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
@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;
}
示例3: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}
示例4: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
@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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
}
示例8: 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;
}
示例9: 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;
}
示例10: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}
示例11: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}
示例12: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}
示例13: getIntsSpecial
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
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;
}
示例14: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}
示例15: getInts
import net.minecraft.world.gen.layer.IntCache; //导入依赖的package包/类
/**
* 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;
}