當前位置: 首頁>>代碼示例>>Java>>正文


Java IChunkProvider類代碼示例

本文整理匯總了Java中net.minecraft.world.chunk.IChunkProvider的典型用法代碼示例。如果您正苦於以下問題:Java IChunkProvider類的具體用法?Java IChunkProvider怎麽用?Java IChunkProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IChunkProvider類屬於net.minecraft.world.chunk包,在下文中一共展示了IChunkProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) 
{
	int blockX = chunkX * 16;
	int blockZ = chunkZ * 16;
	
	switch (world.provider.getDimension())
	{
		case -1: 
			generateNether(world, rand, blockX + 8, blockZ + 8);
			break;
		case 0: 
			generateOverworld(world, rand, blockX + 8, blockZ + 8);
			break;
		case 1: 
			generateEnd(world, rand, blockX + 8, blockZ + 8);
			break;
	}
}
 
開發者ID:TheXFactor117,項目名稱:Loot-Slash-Conquer,代碼行數:20,代碼來源:LSCWorldGenerator.java

示例2: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
{
    int i = this.range;
    this.worldObj = worldIn;
    this.rand.setSeed(worldIn.getSeed());
    long j = this.rand.nextLong();
    long k = this.rand.nextLong();

    for (int l = x - i; l <= x + i; ++l)
    {
        for (int i1 = z - i; i1 <= z + i; ++i1)
        {
            long j1 = (long)l * j;
            long k1 = (long)i1 * k;
            this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed());
            this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:MapGenBase.java

示例3: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
	switch(world.provider.getDimension())
	{
		case -1:

			break;

		case 0:
			genSurface(world, random, chunkX, chunkZ, chunkGenerator, chunkProvider);
			break;

		case 1:

			break;
	}
}
 
開發者ID:Lemonszz,項目名稱:Anima-Mundi,代碼行數:19,代碼來源:AnimaWorldGenerator.java

示例4: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
		IChunkProvider chunkProvider) {
	if (random.nextInt(20) == 0){
		int x = chunkX * 16 + 2 + random.nextInt(12);
		int z = chunkZ * 16 + 2 + random.nextInt(12);
		BlockPos p = new BlockPos(x,0,z);
		p = world.getHeight(p);
		Biome b = world.getBiome(p);
		if (BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST) || b == Biomes.FOREST || b == Biomes.FOREST_HILLS){
			if (world.getBlockState(p.down()).getBlock() instanceof BlockGrass && world.isAirBlock(p)){
				BlockTeaSapling.generateTree(world, p, Blocks.AIR.getDefaultState(), random);
			}
		}
	}
}
 
開發者ID:elucent,項目名稱:SimplyTea,代碼行數:17,代碼來源:SimplyTea.java

示例5: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	switch (world.provider.dimensionId) {
	case 0:
		this.lowOre(this.generation_copper, world, random, chunkX, chunkZ, 30, 0, 256);
		this.lowOre(this.generation_tin, world, random, chunkX, chunkZ, 30, 0, 256);
		this.mediumOre(this.generation_lead, world, random, chunkX, chunkZ, 30, 0, 256);
		this.mediumOre(this.generation_aluminium, world, random, chunkX, chunkZ, 30, 0, 256);
		this.mediumOre(this.generation_nickel, world, random, chunkX, chunkZ, 30, 0, 256);
		this.hardOre(this.generation_ruby, world, random, chunkX, chunkZ, 30, 0, 256);
		this.hardOre(this.generation_uranium, world, random, chunkX, chunkZ, 30, 0, 256);
		break;
	case -1:
		this.netherOre(this.generation_sulfur, world, random, chunkX, chunkZ, 40, 0, 256);
		break;
	case 1:
		
		break;
	}	
}
 
開發者ID:grand-mine-inc,項目名稱:Steam-and-Steel,代碼行數:22,代碼來源:BaseWorldGeneration.java

示例6: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate (Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
    int x = chunkX * 16 + 8;
    int z = chunkZ * 16 + 8;

    Biome biome = world.getBiome(new BlockPos(x, 0, z));
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD ))
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.WET)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.WASTELAND)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY))
        return;

    if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY))
        return;

    if (random.nextInt(15) > 0)
        return;

    generate(world, random, new BlockPos(x, world.getSeaLevel(), z));
}
 
開發者ID:jaquadro,項目名稱:GardenStuff,代碼行數:23,代碼來源:WorldGenCandelilla.java

示例7: populate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
    Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_);

    if (!chunk.isTerrainPopulated())
    {
        chunk.func_150809_p();

        if (this.serverChunkGenerator != null)
        {
            this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_);
            chunk.setChunkModified();
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:ChunkProviderServer.java

示例8: gen

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
void gen(World world, int x, int z, IChunkGenerator generator, IChunkProvider provider) {
	random.setSeed(world.getSeed());
	long good = random.nextLong();
	long succ = random.nextLong();

	good *= x >> 1;
	succ *= z >> 1;
	random.setSeed(good ^ succ ^ world.getSeed());
	//Generate
	if(GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity > 0D && GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity / 100D > random.nextDouble()) {
		BlockPos center = new BlockPos(x, 15 + random.nextInt(25), z);
		if(!world.canSeeSky(center) || !GEN_CONFIG.ASHEN_CUBE_STRUCTURE.underground) {
			genCubes(world, center);
		}
	}
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:18,代碼來源:AshenCubeStructure.java

示例9: getCountLoadedChunks

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
public int getCountLoadedChunks()
{
    if (this.theWorld == null)
    {
        return 0;
    }
    else
    {
        IChunkProvider ichunkprovider = this.theWorld.getChunkProvider();

        if (ichunkprovider == null)
        {
            return 0;
        }
        else
        {
            if (ichunkprovider != this.worldChunkProvider)
            {
                this.worldChunkProvider = ichunkprovider;
                this.worldChunkProviderMap = (Long2ObjectMap)Reflector.getFieldValue(ichunkprovider, Reflector.ChunkProviderClient_chunkMapping);
            }

            return this.worldChunkProviderMap == null ? 0 : this.worldChunkProviderMap.size();
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:27,代碼來源:RenderGlobal.java

示例10: populate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
    BlockFalling.fallInstantly = true;
    int var4 = par2 * 16;
    int var5 = par3 * 16;
    this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
    this.rand.setSeed(this.worldObj.getSeed());
    final long var7 = this.rand.nextLong() / 2L * 2L + 1L;
    final long var9 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed(par2 * var7 + par3 * var9 ^ this.worldObj.getSeed());
    this.decoratePlanet(this.worldObj, this.rand, var4, var5);
    this.onPopulate(par1IChunkProvider, par2, par3);

    BlockFalling.fallInstantly = false;
}
 
開發者ID:BlesseNtumble,項目名稱:TRAPPIST-1,代碼行數:17,代碼來源:ChunkProviderSpaceCraters.java

示例11: populate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void populate(IChunkProvider chunk, int x, int z)
{
	BlockFalling.fallInstantly = true;
	int var4 = x * 16;
	int var5 = z * 16;
	BiomeGenBase biomeGen = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
	this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
	this.rand.setSeed(this.worldObj.getSeed());
	long var7 = this.rand.nextLong() / 2L * 2L + 1L;
	long var9 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed(x * var7 + z * var9 ^ this.worldObj.getSeed());
	biomeGen.decorate(this.worldObj, this.rand, var4, var5);
	this.decoratePlanet(this.worldObj, this.rand, var4, var5);
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomeGen, var4 + 8, var5 + 8, 16, 16, this.rand);
	this.onPopulate(chunk, x, z);
	BlockFalling.fallInstantly = false;
}
 
開發者ID:BlesseNtumble,項目名稱:TRAPPIST-1,代碼行數:19,代碼來源:ChunkProviderSpaceLakes.java

示例12: generateWorld

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
/**
 * Callback hook for world gen - if your mod wishes to add extra mod related generation to the world
 * call this
 *
 * @param chunkX         Chunk X coordinate
 * @param chunkZ         Chunk Z coordinate
 * @param world          World we're generating into
 * @param chunkGenerator The chunk generator
 * @param chunkProvider  The chunk provider
 */
public static void generateWorld(int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
    if (sortedGeneratorList == null)
    {
        computeSortedGeneratorList();
    }
    long worldSeed = world.getSeed();
    Random fmlRandom = new Random(worldSeed);
    long xSeed = fmlRandom.nextLong() >> 2 + 1L;
    long zSeed = fmlRandom.nextLong() >> 2 + 1L;
    long chunkSeed = (xSeed * chunkX + zSeed * chunkZ) ^ worldSeed;

    for (IWorldGenerator generator : sortedGeneratorList)
    {
        fmlRandom.setSeed(chunkSeed);
        generator.generate(fmlRandom, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:29,代碼來源:GameRegistry.java

示例13: func_177460_a

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
    boolean flag = false;

    if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L)
    {
        flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_));
    }

    return flag;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:12,代碼來源:ChunkProviderGenerate.java

示例14: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	//System.out.println("Generating "+bs+" at "+chunkX+", "+chunkZ);
	int x = random.nextInt(16);
	int z = random.nextInt(16);
	BlockPos pos = new BlockPos((chunkX*16)+x,0,(chunkZ*16)+z);
	pos = world.getTopSolidOrLiquidBlock(pos);
	//pos = pos.up();
	generate(world, random, pos);
}
 
開發者ID:trigg,項目名稱:Firma,代碼行數:11,代碼來源:FirmaTree.java

示例15: generate

import net.minecraft.world.chunk.IChunkProvider; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	byte b = world.getChunkFromChunkCoords(chunkX, chunkZ).getBiomeArray()[0];
	FirmaTree[] tl = FirmaBiome.getTreeForBiome(b, chunkZ*16);
	if(tl.length==0){ return; }
	FirmaTree ft = tl[random.nextInt(tl.length)];
	FirmaBiome bi = (FirmaBiome) Biome.getBiome(b);
	for(int i = 0; i < bi.treeCount; i++){
		ft.generate(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
	}
}
 
開發者ID:trigg,項目名稱:Firma,代碼行數:12,代碼來源:FirmaTreeGen.java


注:本文中的net.minecraft.world.chunk.IChunkProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。