本文整理匯總了Java中net.minecraft.world.biome.Biome.getIdForBiome方法的典型用法代碼示例。如果您正苦於以下問題:Java Biome.getIdForBiome方法的具體用法?Java Biome.getIdForBiome怎麽用?Java Biome.getIdForBiome使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.biome.Biome
的用法示例。
在下文中一共展示了Biome.getIdForBiome方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: provideChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
@Override
public Chunk provideChunk(int x, int z) {
this.rand.setSeed(x * 341873128712L + z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.setBlocksInChunk(x, z, chunkprimer);
Biome[] biomesForGeneration = this.replaceBiomeBlocks(x, z, chunkprimer);
this.caveGenerator.generate(this.world, x, z, chunkprimer);
this.ravineGenerator.generate(world, x, z, chunkprimer);
Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int i = 0; i < abyte.length; i++) {
abyte[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i + 19]);
}
chunk.setBiomeArray(abyte);
chunk.generateSkylightMap();
return chunk;
}
示例2: prep
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public static void prep() {
OCEAN = Biome.getIdForBiome(FirmaBiome.OCEAN);
DOCEAN = Biome.getIdForBiome(FirmaBiome.DEEPOCEAN);
LAKE = Biome.getIdForBiome(FirmaBiome.LAKE);
RIVER = Biome.getIdForBiome(FirmaBiome.RIVER);
PLAINS = Biome.getIdForBiome(FirmaBiome.PLAINS);
HILLS = Biome.getIdForBiome(FirmaBiome.HILLS);
EXHILLS = Biome.getIdForBiome(FirmaBiome.EXHILLS);
HILLSEDGE = Biome.getIdForBiome(FirmaBiome.HILLSEDGE);
EXHILLSEDGE = Biome.getIdForBiome(FirmaBiome.EXHILLSEDGE);
SWAMP = Biome.getIdForBiome(FirmaBiome.SWAMP);
BEACH = Biome.getIdForBiome(FirmaBiome.BEACH);
GBEACH = Biome.getIdForBiome(FirmaBiome.GRAVELBEACH);
FOREST = Biome.getIdForBiome(FirmaBiome.FOREST);
}
示例3: processMessage
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
private void processMessage(MessageBiomeChange message, MessageContext ctx, WorldClient world)
{
Biome targetBiome = Biome.getBiomeForId(message.biomeID);
if(targetBiome == null)
return;
byte[] currentArray;
for(byte nX = -5; nX <= 5; nX++)
{
for(byte nZ = -5; nZ <= 5; nZ++)
{
Chunk c = world.getChunkFromBlockCoords(new BlockPos(message.changeCenter.getX() + nX*16, 0, message.changeCenter.getZ() + nZ*16));
currentArray = c.getBiomeArray();
for(int n = 0; n < currentArray.length; n++)
{
currentArray[n] = (byte) Biome.getIdForBiome(targetBiome);
}
c.setBiomeArray(currentArray);
c.setModified(true);
}
}
}
示例4: generateChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
@Override
public Chunk generateChunk(int x, int z) {
ChunkPrimer chunkprimer = new ChunkPrimer();
this.fillChunk(x,z,chunkprimer);
Biome[] biomes = this.world.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
this.replaceBiomeBlocks(x,z, chunkprimer, biomes);
this.generateFeatures(x,z, chunkprimer);
Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int l = 0; l < abyte.length; ++l)
{
abyte[l] = (byte)Biome.getIdForBiome(biomes[l]);
}
chunk.generateSkylightMap();
return chunk;
}
示例5: provideChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public Chunk provideChunk(int x, int z)
{
this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.prepareHeights(x, z, chunkprimer);
this.buildSurfaces(x, z, chunkprimer);
this.genNetherCaves.generate(this.world, x, z, chunkprimer);
if (this.generateStructures)
{
this.genNetherBridge.generate(this.world, x, z, chunkprimer);
}
Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
Biome[] abiome = this.world.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
byte[] abyte = chunk.getBiomeArray();
for (int i = 0; i < abyte.length; ++i)
{
abyte[i] = (byte)Biome.getIdForBiome(abiome[i]);
}
chunk.resetRelightChecks();
return chunk;
}
示例6: provideChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public Chunk provideChunk(int x, int z)
{
this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
this.setBlocksInChunk(x, z, chunkprimer);
this.buildSurfaces(chunkprimer);
if (this.mapFeaturesEnabled)
{
this.endCityGen.generate(this.worldObj, x, z, chunkprimer);
}
Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int i = 0; i < abyte.length; ++i)
{
abyte[i] = (byte)Biome.getIdForBiome(this.biomesForGeneration[i]);
}
chunk.generateSkylightMap();
return chunk;
}
示例7: getColorGrid
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
private int getColorGrid(Biome p_getColorGrid_1_, BlockPos p_getColorGrid_2_)
{
int i = Biome.getIdForBiome(p_getColorGrid_1_);
int j = p_getColorGrid_2_.getY() - this.yOffset;
if (this.yVariance > 0)
{
int k = p_getColorGrid_2_.getX() << 16 + p_getColorGrid_2_.getZ();
int l = Config.intHash(k);
int i1 = this.yVariance * 2 + 1;
int j1 = (l & 255) % i1 - this.yVariance;
j += j1;
}
return this.getColor(i, j);
}
示例8: changeBiomeArea
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public void changeBiomeArea(World world, BlockPos thisPosition)
{
if(world == null) { return; }
if(targetBiome == null) { return; }
if(world.provider.getDimension() != worldId) { return; } //Do nothing unless this is the specified world.
for(byte nX = -5; nX <= 5; nX++)
{
for(byte nZ = -5; nZ <= 5; nZ++)
{
Chunk c = world.getChunkFromBlockCoords(new BlockPos(thisPosition.getX() + nX*16, 0, thisPosition.getZ() + nZ*16));
this.currentArray = c.getBiomeArray();
for(int n = 0; n < this.currentArray.length; n++)
{
this.currentArray[n] = (byte) Biome.getIdForBiome(targetBiome);
}
c.setBiomeArray(this.currentArray);
c.setModified(true);
}
}
PacketHandler.INSTANCE.sendToDimension(new MessageBiomeChange((byte) Biome.getIdForBiome(targetBiome), this.getPos()), world.provider.getDimension());
}
示例9: provideChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public Chunk provideChunk(int x, int z)
{
ChunkPrimer chunkprimer = new ChunkPrimer();
for (int i = 0; i < this.cachedBlockIDs.length; ++i)
{
IBlockState iblockstate = this.cachedBlockIDs[i];
if (iblockstate != null)
{
for (int j = 0; j < 16; ++j)
{
for (int k = 0; k < 16; ++k)
{
chunkprimer.setBlockState(j, i, k, iblockstate);
}
}
}
}
for (MapGenBase mapgenbase : this.structureGenerators.values())
{
mapgenbase.generate(this.worldObj, x, z, chunkprimer);
}
Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
Biome[] abiome = this.worldObj.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
byte[] abyte = chunk.getBiomeArray();
for (int l = 0; l < abyte.length; ++l)
{
abyte[l] = (byte)Biome.getIdForBiome(abiome[l]);
}
chunk.generateSkylightMap();
return chunk;
}
示例10: getInts
import net.minecraft.world.biome.Biome; //導入方法依賴的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;
}
示例11: provideChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public Chunk provideChunk(int x, int z)
{
ChunkPrimer chunkprimer = new ChunkPrimer();
for (int i = 0; i < this.cachedBlockIDs.length; ++i)
{
IBlockState iblockstate = this.cachedBlockIDs[i];
if (iblockstate != null)
{
for (int j = 0; j < 16; ++j)
{
for (int k = 0; k < 16; ++k)
{
chunkprimer.setBlockState(j, i, k, iblockstate);
}
}
}
}
for (MapGenBase mapgenbase : this.structureGenerators)
{
mapgenbase.generate(this.worldObj, x, z, chunkprimer);
}
Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
Biome[] abiome = this.worldObj.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
byte[] abyte = chunk.getBiomeArray();
for (int l = 0; l < abyte.length; ++l)
{
abyte[l] = (byte)Biome.getIdForBiome(abiome[l]);
}
chunk.generateSkylightMap();
return chunk;
}
示例12: getInts
import net.minecraft.world.biome.Biome; //導入方法依賴的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 areaX, int areaY, int areaWidth, int areaHeight)
{
int i = areaX - 1;
int j = areaY - 1;
int k = areaWidth + 2;
int l = areaHeight + 2;
int[] aint = this.parent.getInts(i, j, k, l);
int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
for (int i1 = 0; i1 < areaHeight; ++i1)
{
for (int j1 = 0; j1 < areaWidth; ++j1)
{
int k1 = aint[j1 + 0 + (i1 + 0) * k];
int l1 = aint[j1 + 2 + (i1 + 0) * k];
int i2 = aint[j1 + 0 + (i1 + 2) * k];
int j2 = aint[j1 + 2 + (i1 + 2) * k];
int k2 = aint[j1 + 1 + (i1 + 1) * k];
this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));
if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(100) == 0)
{
aint1[j1 + i1 * areaWidth] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND);
}
else
{
aint1[j1 + i1 * areaWidth] = k2;
}
}
}
return aint1;
}
示例13: getInts
import net.minecraft.world.biome.Biome; //導入方法依賴的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 areaX, int areaY, int areaWidth, int areaHeight)
{
int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
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 + 1 + (i + 1) * (areaWidth + 2)];
if (this.nextInt(57) == 0)
{
if (k == Biome.getIdForBiome(Biomes.PLAINS))
{
aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MUTATED_PLAINS);
}
else
{
aint1[j + i * areaWidth] = k;
}
}
else
{
aint1[j + i * areaWidth] = k;
}
}
}
return aint1;
}
示例14: getInts
import net.minecraft.world.biome.Biome; //導入方法依賴的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 areaX, int areaY, int areaWidth, int areaHeight)
{
int[] aint = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight);
int[] aint1 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight);
int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight);
for (int i = 0; i < areaWidth * areaHeight; ++i)
{
if (aint[i] != Biome.getIdForBiome(Biomes.OCEAN) && aint[i] != Biome.getIdForBiome(Biomes.DEEP_OCEAN))
{
if (aint1[i] == Biome.getIdForBiome(Biomes.RIVER))
{
if (aint[i] == Biome.getIdForBiome(Biomes.ICE_PLAINS))
{
aint2[i] = Biome.getIdForBiome(Biomes.FROZEN_RIVER);
}
else if (aint[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND) && aint[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE))
{
aint2[i] = aint1[i] & 255;
}
else
{
aint2[i] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE);
}
}
else
{
aint2[i] = aint[i];
}
}
else
{
aint2[i] = aint[i];
}
}
return aint2;
}
示例15: generateChunk
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
@Override
public Chunk generateChunk(int x, int z) {
this.random.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
generateShape(x,z,chunkprimer);
//this.prepareHeights(x, z, chunkprimer);
//this.buildSurfaces(x, z, chunkprimer);
//this.genNetherCaves.generate(this.world, x, z, chunkprimer);
//if (this.generateStructures) {
this.genNetherBridge.generate(this.world, x, z, chunkprimer);
//}
Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
//Copy biomes in from biomeProvider
//Biome[] abiome = this.world.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
byte[] abyte = chunk.getBiomeArray();
for(int zi=0; zi<16; zi++) {
for(int xi=0; xi<16; xi++) {
int baseX = x; if (baseX<0) baseX-=1; baseX*=16;
int baseZ = z; if (baseZ<0) baseZ-=1; baseZ*=16;
Biome vanillaBiome = world.getBiome(new BlockPos(baseX+xi, 0, baseZ+zi));
byte id = (byte)Biome.getIdForBiome(Biomes.HELL);
if (vanillaBiome instanceof NeoBiome) {
id = (byte)BiomeRegistry.NEO_HELL.getIDForObject((NeoBiome)vanillaBiome);
//id = (byte)((NeoBiome)vanillaBiome).getId();
}
abyte[zi*16+xi] = id;
}
}
//for (int i = 0; i < abyte.length; ++i) {
// abyte[i] = (byte)Biome.REGISTRY.getIDForObject(Biomes.HELL);
//}
//None of the following things changed the fact that relighting takes up like 99% of world load time
//chunk.setLightPopulated(true);
//chunk.generateSkylightMap();
//chunk.resetRelightChecks();
return chunk;
/* #### old NeoHellGen ####
//System.out.println("NeoHellGen: "+x+","+z);
this.random.setSeed(x * 341873128712L + z * 132897987541L);
Block[] ablock = new Block[16*16*256];
byte[] meta = new byte[ablock.length];
//BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager()
// .loadBlockGeneratorData((BiomeGenBase[]) null, x * 16, z * 16, 16, 16);
this.generateShape(x, z, ablock, meta);
//this.replaceBiomeBlocks(x, z, ablock, meta, abiomegenbase);
//this.genNetherBridge.func_151539_a(this, this.worldObj, x, z, ablock);
Chunk chunk = new Chunk(this.world, x, z);
byte[] abyte = chunk.getBiomeArray();
for (int k = 0; k < abyte.length; ++k) {
abyte[k] = (byte) Biome.getIdForBiome(Biomes.HELL);
}
chunk.generateSkylightMap();
//chunk.enqueueRelightChecks();
//chunk.generateHeightMap();
chunk.resetRelightChecks();
//chunk.isTerrainPopulated = false;
return chunk;*/
}