当前位置: 首页>>代码示例>>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;未经允许,请勿转载。