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


Java IntCache.getIntCache方法代码示例

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


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

示例1: 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;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:29,代码来源:FirmaGenLayerBiome.java

示例2: 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;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:20,代码来源:FirmaGenLayerIsland.java

示例3: 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;
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:21,代码来源:GenLayerRiverInit.java

示例4: 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 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;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:26,代码来源:GenLayerBiomeEpic.java

示例5: getInts

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

示例6: 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.
 * @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;
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:27,代码来源:GenLayerBiomePlanet.java

示例7: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int x, int z, int width, int depth)
{
	int[] dest = IntCache.getIntCache(width*depth);


	for (int dz=0; dz<depth; dz++)
	{
		for (int dx=0; dx<width; dx++)
		{
			this.initChunkSeed(dx+x, dz+z);
			dest[(dx+dz*width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
		}
	}
	return dest;
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:17,代码来源:GenLayerBiomesZeroQuest.java

示例8: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int x, int z, int width, int depth)
{
	int[] dest = IntCache.getIntCache(width*depth);


	for (int dz=0; dz<depth; dz++)
	{
		for (int dx=0; dx<width; dx++)
		{
			this.initChunkSeed(dx+x, dz+z);
			dest[(dx+dz*width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
			
			if(Constants.DEF_DARKLOAD == true){
			dest[(dx+dz*width)] = this.allowedDarkBiomes[nextInt(this.allowedDarkBiomes.length)].biomeID;	
			}
		}
	}
	return dest;
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:21,代码来源:GenLayerBiomesZeroQuest.java

示例9: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int par1, int par2, int par3, int par4) {
	int[] dest = IntCache.getIntCache(par3 * par4);

	for (int i1 = 0; i1 < par4; i1++) {
		for (int j1 = 0; j1 < par3; j1++) {
			this.initChunkSeed(par1 + j1, par2 + i1);
			dest[j1 + i1 * par3] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
			// this.initChunkSeed(j1 + x, i1 + z);
			// dest[(j1 + i1 * width)] =
			// this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
		}
		// if(par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
		// {
		// dest[-par1 + par2 * par3] =
		// this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID;
		// }
	}
	return dest;
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:21,代码来源:GenLayerBiomesMysticalTrinkets.java

示例10: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int x, int z, int length, int width) {
	int x1 = x - 1;
	int z1 = z - 1;
	int x2 = length + 2;
	int z2 = width + 2;
	int[] oldList = parent.getInts(x1, z1, x2, z2);
	int[] list = IntCache.getIntCache(length * width);
	for(int i = 0; i < width; i++) {
		for(int j = 0; j < length; j++) {
			int side1 = oldList[j + 0 + (i + 0) * x2];
			int side2 = oldList[j + 2 + (i + 0) * x2];
			int side3 = oldList[j + 0 + (i + 2) * x2];
			int side4 = oldList[j + 2 + (i + 2) * x2];
			int side5 = oldList[j + 1 + (i + 1) * x2];
			initChunkSeed((long) (j + x), (long) (i + z));
			if(side5 == 0 && side1 == 0 && side2 == 0 && side3 == 0 && side4 == 0 && nextInt(100) == 0) {
				list[j + i * length] = biome.biomeID;
			} else {
				list[j + i * length] = side5;
			}
		}
	}
	return list;
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:26,代码来源:AgeGenLayerAddSpecialIsland.java

示例11: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int x, int z, int width, int length) {
	int i1 = x - 1;
	int j1 = z - 1;
	int k1 = width + 2;
	int l1 = length + 2;
	int[] oldList = parent.getInts(i1, j1, k1, l1);
	int[] list = IntCache.getIntCache(width * length);
	for(int i2 = 0; i2 < length; ++i2) {
		for(int j2 = 0; j2 < width; ++j2) {
			int side1 = getValue(oldList[j2 + 0 + (i2 + 1) * k1]);
			int side2 = getValue(oldList[j2 + 2 + (i2 + 1) * k1]);
			int side3 = getValue(oldList[j2 + 1 + (i2 + 0) * k1]);
			int side4 = getValue(oldList[j2 + 1 + (i2 + 2) * k1]);
			int side5 = getValue(oldList[j2 + 1 + (i2 + 1) * k1]);
			if(side5 == side1 && side5 == side3 && side5 == side2 && side5 == side4) {
				list[j2 + i2 * width] = -1;
			} else {
				list[j2 + i2 * width] = biome.biomeID;
			}
		}
	}

	return list;
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:26,代码来源:AgeGenLayerRiver.java

示例12: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int x, int z, int width, int length) {
	int[] oldList = this.parent.getInts(x - 1, z - 1, width + 2, length + 2);
	int[] list = IntCache.getIntCache(width * length);
	for(int i1 = 0; i1 < length; ++i1) {
		for(int j1 = 0; j1 < width; ++j1) {
			initChunkSeed((long) (j1 + x), (long) (i1 + z));
			int side = oldList[j1 + 1 + (i1 + 1) * (width + 2)];
			if(nextInt(57) == 0) {
				if(side == biomeDetect.biomeID) {
					list[j1 + i1 * width] = biome.biomeID;
				} else {
					list[j1 + i1 * width] = side;
				}
			} else {
				list[j1 + i1 * width] = side;
			}
		}
	}
	return list;
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:22,代码来源:AgeGenLayerRareBiome.java

示例13: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
/**
 * Switches biomes so that there's less alias. Where non-mountainous touch mountainous replaces with mountain edge etcetc
 */
@Override
public int[] getInts(int par1, int par2, int xSize, int zSize) {
	int[] inCache = this.parent.getInts(par1 - 1, par2 - 1, xSize + 2, zSize + 2);
	validateIntArray(inCache, xSize + 2, zSize + 2);
	int[] outCache = IntCache.getIntCache(xSize * zSize);
	int var10;
	int var11;
	int var12;
	int var13;

	for (int z = 0; z < zSize; ++z) {
		for (int x = 0; x < xSize; ++x) {
			this.initChunkSeed(x + par1, z + par2);
			int thisID = inCache[x + 1 + (z + 1) * (xSize + 2)];
			var10 = inCache[x + 1 + (z + 1 - 1) * (xSize + 2)];
			var11 = inCache[x + 1 + 1 + (z + 1) * (xSize + 2)];
			var12 = inCache[x + 1 - 1 + (z + 1) * (xSize + 2)];
			var13 = inCache[x + 1 + (z + 1 + 1) * (xSize + 2)];
			outCache[x + z * xSize] = thisID;
			if (thisID == Layer.EXHILLS) {
				if(!(isMountain(var10) && isMountain(var11) && isMountain(var12) && isMountain(var13))){
					outCache[x + z * xSize] = Layer.EXHILLSEDGE;
				}
			} else if (thisID == Layer.HILLS) {
				if (!(isMountain(var10) && isMountain(var11) && isMountain(var12) && isMountain(var13))){
					outCache[x + z * xSize] = Layer.HILLSEDGE;
				}
			}
		}
	}
	validateIntArray(outCache, xSize, zSize);

	return outCache;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:38,代码来源:GenLayerBiomeEdge.java

示例14: getInts

import net.minecraft.world.gen.layer.IntCache; //导入方法依赖的package包/类
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
	int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
	int[] var6 = IntCache.getIntCache(par3 * par4);
	int var10;
	int var11;
	int var12;
	int var13;

	for (int var7 = 0; var7 < par4; ++var7)
	{
		for (int var8 = 0; var8 < par3; ++var8)
		{
			this.initChunkSeed(var8 + par1, var7 + par2);
			int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)];


			var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
			var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
			var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
			var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];

			if (isOceanic(var9))
			{
				if(!isOceanic(var10) && !isOceanic(var11) && !isOceanic(var12) && !isOceanic(var13))
					var6[var8 + var7 * par3] = Layer.LAKE;
				else
					var6[var8 + var7 * par3] = var9;
			}
			else
			{
				var6[var8 + var7 * par3] = var9;
			}
		}
	}
	this.validateIntArray(var6, par3, par4);

	return var6;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:41,代码来源:GenLayerLakes.java

示例15: 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 Biome ID's based on the particular GenLayer subclass.
    */
   @Override
public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
   {
       int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);
       int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

       for (int i = 0; i < areaHeight; ++i)
       {
           for (int j = 0; j < areaWidth; ++j)
           {
               this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
               int k = aint[j + i * areaWidth];
               k = k & -3841;
               if (isBiomeOceanic(k))
               {
                   aint1[j + i * areaWidth] = k;
               }
               else 
               {
               	aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry().biome);
               }
           }
       }

       return aint1;
   }
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:31,代码来源:WorldTypeExP.java


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