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


Java Chunk.getBiomeArray方法代码示例

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


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

示例1: renderGameOverlayEvent

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * When possible, presents corrected biome information in the F3 overlay for Neo-Hell
 * @param event
 */
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderGameOverlayEvent(RenderGameOverlayEvent.Text event) {
	if (!Minecraft.getMinecraft().gameSettings.showDebugInfo) return;
	
	if (Minecraft.getMinecraft().world.provider.getDimension()!=-1) return;
	
	
	ArrayList<String> left = event.getLeft();
	final int LINE_BIOME = 11;
	if (left.size()<=LINE_BIOME || !left.get(LINE_BIOME).startsWith("Biome:")) return; //Someone's already tampered

	
	String biomeName = "MEMES(NULL)";
	BlockPos pos = Minecraft.getMinecraft().player.getPosition();
	Chunk chunk = Minecraft.getMinecraft().world.getChunkFromBlockCoords(pos);
	byte[] biomeArray = chunk.getBiomeArray();
	int x = pos.getX() & 15;
	int z = pos.getZ() & 15;
	int biomeId = biomeArray[z*16+x];
	NeoBiome biome = BiomeRegistry.NEO_HELL.getObjectById(biomeId);
	if (biome!=null) biomeName = biome.getBiomeName();
	
	left.set(LINE_BIOME, "Biome: "+biomeId+" ("+biomeName+")");
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:30,代码来源:ThermionicsWorld.java

示例2: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:ChunkProviderHell.java

示例3: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
public Chunk provideChunk(int x, int z)
{
    this.hellRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.func_180515_a(x, z, chunkprimer);
    this.func_180516_b(x, z, chunkprimer);
    this.netherCaveGenerator.generate(this, this.worldObj, x, z, chunkprimer);

    if (this.field_177466_i)
    {
        this.genNetherBridge.generate(this, this.worldObj, x, z, chunkprimer);
    }

    Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
    BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16);
    byte[] abyte = chunk.getBiomeArray();

    for (int i = 0; i < abyte.length; ++i)
    {
        abyte[i] = (byte)abiomegenbase[i].biomeID;
    }

    chunk.resetRelightChecks();
    return chunk;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:ChunkProviderHell.java

示例4: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ChunkProviderEnd.java

示例5: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
public Chunk provideChunk(int x, int z)
{
    this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.func_180520_a(x, z, chunkprimer);
    this.func_180519_a(chunkprimer);
    Chunk chunk = new Chunk(this.endWorld, chunkprimer, x, z);
    byte[] abyte = chunk.getBiomeArray();

    for (int i = 0; i < abyte.length; ++i)
    {
        abyte[i] = (byte)this.biomesForGeneration[i].biomeID;
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:ChunkProviderEnd.java

示例6: calculateChunkSize

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
protected int calculateChunkSize(Chunk chunkIn, boolean p_189556_2_, int p_189556_3_)
{
    int i = 0;
    ExtendedBlockStorage[] aextendedblockstorage = chunkIn.getBlockStorageArray();
    int j = 0;

    for (int k = aextendedblockstorage.length; j < k; ++j)
    {
        ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[j];

        if (extendedblockstorage != Chunk.NULL_BLOCK_STORAGE && (!this.doChunkLoad() || !extendedblockstorage.isEmpty()) && (p_189556_3_ & 1 << j) != 0)
        {
            i = i + extendedblockstorage.getData().getSerializedSize();
            i = i + extendedblockstorage.getBlocklightArray().getData().length;

            if (p_189556_2_)
            {
                i += extendedblockstorage.getSkylightArray().getData().length;
            }
        }
    }

    if (this.doChunkLoad())
    {
        i += chunkIn.getBiomeArray().length;
    }

    return i;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:SPacketChunkData.java

示例7: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
public Chunk provideChunk(int x, int z)
{
    ChunkPrimer chunkprimer = new ChunkPrimer();

    for (int i = 0; i < 16; ++i)
    {
        for (int j = 0; j < 16; ++j)
        {
            int k = x * 16 + i;
            int l = z * 16 + j;
            chunkprimer.setBlockState(i, 60, j, Blocks.barrier.getDefaultState());
            IBlockState iblockstate = func_177461_b(k, l);

            if (iblockstate != null)
            {
                chunkprimer.setBlockState(i, 70, j, iblockstate);
            }
        }
    }

    Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
    chunk.generateSkylightMap();
    BiomeGenBase[] abiomegenbase = this.world.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16);
    byte[] abyte = chunk.getBiomeArray();

    for (int i1 = 0; i1 < abyte.length; ++i1)
    {
        abyte[i1] = (byte)abiomegenbase[i1].biomeID;
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:38,代码来源:ChunkProviderDebug.java

示例8: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
@Override
public Chunk provideChunk(int x, int z)
{
	this.rand.setSeed(x * 341873128712L + z * 132897987541L);
	Block[] blockStorage = new Block[256 * 256];
	byte[] metaStorage = new byte[256 * 256];
	this.generateTerrain(x, z, blockStorage, metaStorage);
	this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
	this.replaceBlocksForBiome(x, z, blockStorage, metaStorage, this.biomesForGeneration);
	this.onChunkProvider(x, z, blockStorage, metaStorage);
	Chunk chunk = new Chunk(this.worldObj, blockStorage, metaStorage, x, z);
	byte[] chunkBiomes = chunk.getBiomeArray();

	if (this.worldGenerators == null)
       {
           this.worldGenerators = this.getWorldGenerators();
       }

       for (MapGenBaseMeta generator : this.worldGenerators)
       {
           generator.generate(this, this.worldObj, x, z, blockStorage, metaStorage);
       }
	for (int i = 0; i < chunkBiomes.length; i++)
	{
		chunkBiomes[i] = (byte)this.biomesForGeneration[i].biomeID;
	}
	chunk.generateSkylightMap();
	return chunk;
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:30,代码来源:ChunkProviderSpaceLakes.java

示例9: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
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, this.worldObj, x, z, chunkprimer);
    }

    Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
    BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16);
    byte[] abyte = chunk.getBiomeArray();

    for (int l = 0; l < abyte.length; ++l)
    {
        abyte[l] = (byte)abiomegenbase[l].biomeID;
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:42,代码来源:ChunkProviderFlat.java

示例10: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:38,代码来源:ChunkProviderFlat.java

示例11: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public Chunk provideChunk(int x, int z)
{
    ChunkPrimer chunkprimer = new ChunkPrimer();

    for (int i = 0; i < 16; ++i)
    {
        for (int j = 0; j < 16; ++j)
        {
            int k = x * 16 + i;
            int l = z * 16 + j;
            chunkprimer.setBlockState(i, 60, j, BARRIER);
            IBlockState iblockstate = getBlockStateFor(k, l);

            if (iblockstate != null)
            {
                chunkprimer.setBlockState(i, 70, j, iblockstate);
            }
        }
    }

    Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
    chunk.generateSkylightMap();
    Biome[] abiome = this.world.getBiomeProvider().getBiomes((Biome[])null, x * 16, z * 16, 16, 16);
    byte[] abyte = chunk.getBiomeArray();

    for (int i1 = 0; i1 < abyte.length; ++i1)
    {
        abyte[i1] = (byte)Biome.getIdForBiome(abiome[i1]);
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:ChunkProviderDebug.java

示例12: generateChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的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;*/
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:82,代码来源:ChunkProviderNeo.java

示例13: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
 * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
 * specified chunk from the map seed and chunk seed
 */
public Chunk provideChunk(int x, int z)
{
    this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.setBlocksInChunk(x, z, chunkprimer);
    this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.replaceBlocksForBiome(x, z, chunkprimer, this.biomesForGeneration);

    if (this.settings.useCaves)
    {
        this.caveGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useRavines)
    {
        this.ravineGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useMineShafts && this.mapFeaturesEnabled)
    {
        this.mineshaftGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useVillages && this.mapFeaturesEnabled)
    {
        this.villageGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useStrongholds && this.mapFeaturesEnabled)
    {
        this.strongholdGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useTemples && this.mapFeaturesEnabled)
    {
        this.scatteredFeatureGenerator.generate(this, this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useMonuments && this.mapFeaturesEnabled)
    {
        this.oceanMonumentGenerator.generate(this, 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)this.biomesForGeneration[i].biomeID;
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:59,代码来源:ChunkProviderGenerate.java

示例14: provideChunk

import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public Chunk provideChunk(int x, int z)
{
    this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.setBlocksInChunk(x, z, chunkprimer);
    this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.replaceBiomeBlocks(x, z, chunkprimer, this.biomesForGeneration);

    if (this.settings.useCaves)
    {
        this.caveGenerator.generate(this.worldObj, x, z, chunkprimer);
    }

    if (this.settings.useRavines)
    {
        this.ravineGenerator.generate(this.worldObj, x, z, chunkprimer);
    }

    if (this.mapFeaturesEnabled)
    {
        if (this.settings.useMineShafts)
        {
            this.mineshaftGenerator.generate(this.worldObj, x, z, chunkprimer);
        }

        if (this.settings.useVillages)
        {
            this.villageGenerator.generate(this.worldObj, x, z, chunkprimer);
        }

        if (this.settings.useStrongholds)
        {
            this.strongholdGenerator.generate(this.worldObj, x, z, chunkprimer);
        }

        if (this.settings.useTemples)
        {
            this.scatteredFeatureGenerator.generate(this.worldObj, x, z, chunkprimer);
        }

        if (this.settings.useMonuments)
        {
            this.oceanMonumentGenerator.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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:58,代码来源:ChunkProviderOverworld.java


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