本文整理匯總了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;
}
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
}
}
}
示例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;
}
}
示例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));
}
示例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();
}
}
}
示例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);
}
}
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}