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


Java BiomeGenBase類代碼示例

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


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

示例1: registerWorldChunkManager

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
/**
 * creates a new world chunk manager for WorldProvider
 */
protected void registerWorldChunkManager()
{
    WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType();

    if (worldtype == WorldType.FLAT)
    {
        FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions());
        this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), 0.5F);
    }
    else if (worldtype == WorldType.DEBUG_WORLD)
    {
        this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F);
    }
    else
    {
        this.worldChunkMgr = new WorldChunkManager(this.worldObj);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:WorldProvider.java

示例2: decorateChunk

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
@Override
public void decorateChunk(World world, Random rand, BiomeGenBase biome, int x, int z)
{
	if (this.currentWorld != null)
	{
		throw new RuntimeException("Already decorating!!");
	}
	else
	{
		this.currentWorld = world;
		this.randomGenerator = rand;
		this.chunk_X = x;
		this.chunk_Z = z;
		this.genDecorations(biome);
		this.currentWorld = null;
		this.randomGenerator = null;
	}
}
 
開發者ID:BlesseNtumble,項目名稱:TRAPPIST-1,代碼行數:19,代碼來源:TPBiomeDecorator.java

示例3: func_175354_a

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
private static void func_175354_a(String p_175354_0_, Item p_175354_1_, int p_175354_2_, BiomeGenBase p_175354_3_, List<String> p_175354_4_, FlatLayerInfo... p_175354_5_)
{
    FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo();

    for (int i = p_175354_5_.length - 1; i >= 0; --i)
    {
        flatgeneratorinfo.getFlatLayers().add(p_175354_5_[i]);
    }

    flatgeneratorinfo.setBiome(p_175354_3_.biomeID);
    flatgeneratorinfo.func_82645_d();

    if (p_175354_4_ != null)
    {
        for (String s : p_175354_4_)
        {
            flatgeneratorinfo.getWorldFeatures().put(s, Maps.<String, String>newHashMap());
        }
    }

    FLAT_WORLD_PRESETS.add(new GuiFlatPresets.LayerItem(p_175354_1_, p_175354_2_, p_175354_0_, flatgeneratorinfo.toString()));
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:23,代碼來源:GuiFlatPresets.java

示例4: GenLayerBiome

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_)
{
    super(p_i45560_1_);
    this.parent = p_i45560_3_;

    if (p_i45560_4_ == WorldType.DEFAULT_1_1)
    {
        this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
        this.field_175973_g = null;
    }
    else if (p_i45560_4_ == WorldType.CUSTOMIZED)
    {
        this.field_175973_g = ChunkProviderSettings.Factory.jsonToFactory(p_i45560_5_).func_177864_b();
    }
    else
    {
        this.field_175973_g = null;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:GenLayerBiome.java

示例5: getPossibleCreatures

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    if (creatureType == EnumCreatureType.MONSTER)
    {
        if (this.genNetherBridge.func_175795_b(pos))
        {
            return this.genNetherBridge.getSpawnList();
        }

        if (this.genNetherBridge.func_175796_a(this.worldObj, pos) && this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.nether_brick)
        {
            return this.genNetherBridge.getSpawnList();
        }
    }

    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);
    return biomegenbase.getSpawnableList(creatureType);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:ChunkProviderHell.java

示例6: Start

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public Start(World worldIn, Random p_i2060_2_, int p_i2060_3_, int p_i2060_4_)
{
    super(p_i2060_3_, p_i2060_4_);
    BiomeGenBase biomegenbase = worldIn.getBiomeGenForCoords(new BlockPos(p_i2060_3_ * 16 + 8, 0, p_i2060_4_ * 16 + 8));

    if (biomegenbase != BiomeGenBase.jungle && biomegenbase != BiomeGenBase.jungleHills)
    {
        if (biomegenbase == BiomeGenBase.swampland)
        {
            ComponentScatteredFeaturePieces.SwampHut componentscatteredfeaturepieces$swamphut = new ComponentScatteredFeaturePieces.SwampHut(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16);
            this.components.add(componentscatteredfeaturepieces$swamphut);
        }
        else if (biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills)
        {
            ComponentScatteredFeaturePieces.DesertPyramid componentscatteredfeaturepieces$desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16);
            this.components.add(componentscatteredfeaturepieces$desertpyramid);
        }
    }
    else
    {
        ComponentScatteredFeaturePieces.JunglePyramid componentscatteredfeaturepieces$junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16);
        this.components.add(componentscatteredfeaturepieces$junglepyramid);
    }

    this.updateBoundingBox();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:27,代碼來源:MapGenScatteredFeature.java

示例7: biome

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public static boolean biome(BiomeGenBase p_biome_0_, BiomeGenBase[] p_biome_1_)
{
    if (p_biome_1_ == null)
    {
        return true;
    }
    else
    {
        for (int i = 0; i < p_biome_1_.length; ++i)
        {
            if (p_biome_1_[i] == p_biome_0_)
            {
                return true;
            }
        }

        return false;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:Matches.java

示例8: canLightningStrike

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public boolean canLightningStrike(BlockPos strikePosition)
{
    if (!this.isRaining())
    {
        return false;
    }
    else if (!this.canSeeSky(strikePosition))
    {
        return false;
    }
    else if (this.getPrecipitationHeight(strikePosition).getY() > strikePosition.getY())
    {
        return false;
    }
    else
    {
        BiomeGenBase biomegenbase = this.getBiomeGenForCoords(strikePosition);
        return biomegenbase.getEnableSnow() ? false : (this.canSnowAt(strikePosition, false) ? false : biomegenbase.canSpawnLightningBolt());
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:World.java

示例9: provideChunk

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的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:SkidJava,項目名稱:BaseClient,代碼行數:30,代碼來源:ChunkProviderHell.java

示例10: getBiome

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public BiomeGenBase getBiome(BlockPos pos, WorldChunkManager chunkManager)
{
    int i = pos.getX() & 15;
    int j = pos.getZ() & 15;
    int k = this.blockBiomeArray[j << 4 | i] & 255;

    if (k == 255)
    {
        BiomeGenBase biomegenbase = chunkManager.getBiomeGenerator(pos, BiomeGenBase.plains);
        k = biomegenbase.biomeID;
        this.blockBiomeArray[j << 4 | i] = (byte)(k & 255);
    }

    BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(k);
    return biomegenbase1 == null ? BiomeGenBase.plains : biomegenbase1;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:17,代碼來源:Chunk.java

示例11: getPossibleCreatures

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);

    if (this.mapFeaturesEnabled)
    {
        if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.func_175798_a(pos))
        {
            return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList();
        }

        if (creatureType == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.func_175796_a(this.worldObj, pos))
        {
            return this.oceanMonumentGenerator.func_175799_b();
        }
    }

    return biomegenbase.getSpawnableList(creatureType);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:ChunkProviderGenerate.java

示例12: matches

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public boolean matches(EntityLiving p_matches_1_)
{
    if (this.biomes != null)
    {
        BiomeGenBase biomegenbase = p_matches_1_.spawnBiome;
        boolean flag = false;

        for (int i = 0; i < this.biomes.length; ++i)
        {
            BiomeGenBase biomegenbase1 = this.biomes[i];

            if (biomegenbase1 == biomegenbase)
            {
                flag = true;
                break;
            }
        }

        if (!flag)
        {
            return false;
        }
    }

    return this.heights != null && p_matches_1_.spawnPosition != null ? this.heights.isInRange(p_matches_1_.spawnPosition.getY()) : true;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:27,代碼來源:RandomMobsRule.java

示例13: biomeBaseToBiome

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
public static Biome biomeBaseToBiome(BiomeGenBase base) {
    if (base == null) {
        return null;
    }

    return BIOME_MAPPING[base.biomeID];
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:8,代碼來源:CraftBlock.java

示例14: canSpawnStructureAtCoords

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ)
{
    int i = chunkX;
    int j = chunkZ;

    if (chunkX < 0)
    {
        chunkX -= this.field_175800_f - 1;
    }

    if (chunkZ < 0)
    {
        chunkZ -= this.field_175800_f - 1;
    }

    int k = chunkX / this.field_175800_f;
    int l = chunkZ / this.field_175800_f;
    Random random = this.worldObj.setRandomSeed(k, l, 10387313);
    k = k * this.field_175800_f;
    l = l * this.field_175800_f;
    k = k + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2;
    l = l + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2;

    if (i == k && j == l)
    {
        if (this.worldObj.getWorldChunkManager().getBiomeGenerator(new BlockPos(i * 16 + 8, 64, j * 16 + 8), (BiomeGenBase)null) != BiomeGenBase.deepOcean)
        {
            return false;
        }

        boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(i * 16 + 8, j * 16 + 8, 29, field_175802_d);

        if (flag)
        {
            return true;
        }
    }

    return false;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:41,代碼來源:StructureOceanMonument.java

示例15: getColorVanilla

import net.minecraft.world.biome.BiomeGenBase; //導入依賴的package包/類
private int getColorVanilla(BiomeGenBase p_getColorVanilla_1_, BlockPos p_getColorVanilla_2_)
{
    double d0 = (double)MathHelper.clamp_float(p_getColorVanilla_1_.getFloatTemperature(p_getColorVanilla_2_), 0.0F, 1.0F);
    double d1 = (double)MathHelper.clamp_float(p_getColorVanilla_1_.getFloatRainfall(), 0.0F, 1.0F);
    d1 = d1 * d0;
    int i = (int)((1.0D - d0) * (double)(this.width - 1));
    int j = (int)((1.0D - d1) * (double)(this.height - 1));
    return this.getColor(i, j);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:CustomColormap.java


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