• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BiomeForest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.world.biome.BiomeForest的典型用法代码示例。如果您正苦于以下问题:Java BiomeForest类的具体用法?Java BiomeForest怎么用?Java BiomeForest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BiomeForest类属于net.minecraft.world.biome包,在下文中一共展示了BiomeForest类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateCrystalTree

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
public static boolean generateCrystalTree(final World world, final Random random, final int chunkX, final int chunkZ) {
    final int x = chunkX * 16 + random.nextInt(16);
    final int z = chunkZ * 16 + random.nextInt(16);
    final BlockPos bp = world.getHeight(new BlockPos(x, 0, z));
    Biome biome = world.getBiome(bp);
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST) || biome instanceof BiomeForest) {
    	if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, bp, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
        {
    		WoodType type = WoodType.BLUE;
    		try{
    			type = WoodType.byMetadata(MathHelper.getInt(random, 0, WoodType.values().length-1));
    		} catch(Exception e){}
    		int size = MathHelper.getInt(random, 4, 6);
    		final boolean t = new WorldGenCrystalTree(false, size, type, random.nextInt(2) == 0).generate(world, random, bp);
    		return t;
        }
    }
    return false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:20,代码来源:CrystalTreeFeature.java


示例2: generateFeature

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean generateFeature(World world, Random random, int chunkX, int chunkZ, boolean newGen) {
	BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
	if (random.nextInt(30) == 0)
	{
		int j9 = random.nextInt(16) + 8;
		int i13 = random.nextInt(16) + 8;
		BlockPos center = world.getHeight(chunkPos.add(j9, 0, i13));
		Biome biome = world.getBiome(center);
		if(BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST) || biome instanceof BiomeForest){
			boolean placed = false;
			for (int i = 0; i < 24; ++i)
			{
				int range = 4;
				BlockPos bushPos = center.add(MathHelper.getInt(random, -range, range), MathHelper.getInt(random, -4, 4), MathHelper.getInt(random, -range, range));
				if (world.isAirBlock(bushPos.down()) && ModBlocks.crystalBush.canPlaceBlockAt(world, bushPos.down()))
				{
					int type = MathHelper.getInt(random, 0, PlantType.values().length-1);
					int age = MathHelper.getInt(random, 0, 3);
					IBlockState state = ModBlocks.crystalBush.getDefaultState().withProperty(BlockCrystalBerryBush.AGE, age).withProperty(BlockCrystalBerryBush.TYPE, PlantType.values()[type]);
					world.setBlockState(bushPos.down(), state);
					placed = true;
				}
			}
			return placed && !newGen;
		}
	}
	return false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:30,代码来源:CrystalBushFeature.java


示例3: isPermitted

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest || biome == Biomes.RIVER ||
            biome instanceof BiomePlains || biome == Biomes.BEACH ||
            biome instanceof BiomeJungle;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:8,代码来源:BlockCropHarvestable.java


示例4: isPermitted

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return (biome instanceof BiomeTaiga && biome != Biomes.COLD_TAIGA &&
            biome != Biomes.COLD_TAIGA_HILLS &&
            biome != Biomes.MUTATED_TAIGA_COLD) ||
            biome instanceof BiomeForest ||
            biome instanceof BiomePlains ||
            biome == Biomes.BEACH;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:11,代码来源:BlockCrop.java


示例5: isPermitted

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest ||
            biome instanceof BiomeOcean ||
            biome instanceof BiomePlains || biome == Biomes.RIVER ||
            biome instanceof BiomeJungle ||
            biome instanceof BiomeSavanna;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockSeedling.java


示例6: isPermitted

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeTaiga || biome instanceof BiomeHills ||
            biome instanceof BiomeBeach ||
            biome instanceof BiomeForest ||
            biome instanceof BiomePlains || biome == Biomes.RIVER ||
            biome instanceof BiomeJungle;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockCropBlockfruit.java


示例7: isPermitted

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest || biome instanceof BiomeOcean ||
            biome == Biomes.RIVER || biome instanceof BiomePlains ||
            biome == Biomes.BEACH || biome instanceof BiomeSwamp ||
            biome instanceof BiomeMushroomIsland ||
            biome instanceof BiomeJungle || biome instanceof BiomeSavanna;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockBeehive.java


示例8: getSpeciesByBiome

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public EnumWolfSpecies getSpeciesByBiome() {
    Biome biome = this.world.getBiomeForCoordsBody(new BlockPos(this));
    if (biome instanceof BiomeForest) {
        if (this.rand.nextInt(7) == 0) {
            return EnumWolfSpecies.BROWN;
        }
        return EnumWolfSpecies.FOREST;
    } else if (this.rand.nextInt(7) == 0) {
        return EnumWolfSpecies.BLACK;
    } else {
        return EnumWolfSpecies.VANILLA;
    }
}
 
开发者ID:NightKosh,项目名称:Sophisticated-wolves,代码行数:15,代码来源:EntitySophisticatedWolf.java


示例9: generate

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	if (world.provider.getDimension() == 0) {

		WorldGenAbstractTree apple = new WorldGenApple(false);
		WorldGenAbstractTree maple = new WorldGenMaple(false);
		WorldGenAbstractTree ebony = new WorldGenEbony(false);
		WorldGenAbstractTree fir = new WorldGenFir(false);
		WorldGenAbstractTree pine = new WorldGenPine(false);
		WorldGenAbstractTree willow = new WorldGenWillow();
		WorldGenAbstractTree yew = new WorldGenYew();

		// get the biome
		Biome biome = world.getBiome(new BlockPos(chunkX * 16, 64, chunkZ * 16));

		if (biome instanceof BiomeDesert) {
			makeTree(ebony, chunkX, chunkZ, random, world, 0, 1);
		}

		if (biome instanceof BiomeForest || biome instanceof BiomeForestMutated) {
			if (random.nextInt(4) == 0) {
				makeTree(maple, chunkX, chunkZ, random, world, 0, 3);
			}

			if (random.nextInt(12) == 0) {
				makeTree(apple, chunkX, chunkZ, random, world, 1, 2);
			}

			makeTree(pine, chunkX, chunkZ, random, world, 0, 3);
		}

		if (biome instanceof BiomeHills) {
			makeTree(maple, chunkX, chunkZ, random, world, 0, 3);
			makeTree(fir, chunkX, chunkZ, random, world, 0, 3);
		}

		if (biome instanceof BiomeMesa && random.nextBoolean()) {
			makeTree(ebony, chunkX, chunkZ, random, world, 1, 3);
		}

		if (biome instanceof BiomePlains) {
			makeTree(apple, chunkX, chunkZ, random, world, 0, 1);
		}

		if (biome instanceof BiomeRiver && random.nextInt(3) == 0) {
			makeTree(yew, chunkX, chunkZ, random, world, 0, 3);
		}

		if (biome instanceof BiomeSavanna) {
			makeTree(ebony, chunkX, chunkZ, random, world, 0, 3);
		}

		if (biome instanceof BiomeSwamp) {
			if (random.nextInt(2) == 0) {
				makeTree(willow, chunkX, chunkZ, random, world, 0, 3);
			}
			if (random.nextInt(1) == 0) {
				makeTree(yew, chunkX, chunkZ, random, world, 0, 3);
			}
		}

		if (biome instanceof BiomeTaiga) {
			makeTree(pine, chunkX, chunkZ, random, world, 0, 3);
			makeTree(fir, chunkX, chunkZ, random, world, 1, 4);
		}
		if (biome instanceof BiomeJungle) {
			makeTree(rubber, chunkX, chunkZ, random, world, 0, 3);
		}
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:71,代码来源:WorldGenerator.java


示例10: chooseTemp

import net.minecraft.world.biome.BiomeForest; //导入依赖的package包/类
/** Assigns a temperature to the biome.
 * @return The base temperature for the biome */
private static float chooseTemp(Biome biome) {
    
    if (biome == Biomes.MUTATED_ICE_FLATS) {
        
        return -4;
        
    } else if (biome instanceof BiomeSnow) {
        
        return -3;
        
    } else if (biome == Biomes.FROZEN_RIVER) {
        
        return -2;
        
    } else if (biome == Biomes.COLD_TAIGA ||
            biome == Biomes.COLD_TAIGA_HILLS ||
            biome == Biomes.MUTATED_TAIGA_COLD) {
        
        return -1;
        
    } else if (biome == Biomes.COLD_BEACH) {
        
        return -0.5F;
        
    } else if (biome instanceof BiomeHills || biome instanceof BiomeTaiga ||
            biome instanceof BiomeVoid || biome instanceof BiomeEnd) {
        
        return 0;
        
    } else if (biome == Biomes.STONE_BEACH) {
        
        return 0.5F;
        
    } else if (biome == Biomes.BIRCH_FOREST ||
            biome == Biomes.BIRCH_FOREST_HILLS) {
        
        return 1;
        
    } else if (biome instanceof BiomeOcean || biome instanceof BiomeForest
            || biome instanceof BiomeRiver) {
        
        return 2;
        
    } else if (biome instanceof BiomePlains) {
        
        return 2.5F;
        
    } else if (biome instanceof BiomeSwamp || biome instanceof BiomeBeach) {
        
        return 3;
        
    } else if (biome instanceof BiomeMushroomIsland) {

        return 4;
        
    } else if (biome instanceof BiomeJungle) {
        
        return 4.5F;
        
    } else if (biome instanceof BiomeSavanna) {
        
        return 5;
        
    } else if (biome instanceof BiomeDesert || biome instanceof BiomeMesa ||
            biome instanceof BiomeHell) {
        
        return 6;
        
    } else {

        float base = biome.getTemperature();
        float converted = (base - 1) * 10;
        Geomastery.LOG.info("Unsupported biome {} has had its temperature set to {}", biome.getBiomeName(), converted);
        return converted;
    }
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:79,代码来源:GeoBiomes.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CstLong类代码示例发布时间:2022-05-22
下一篇:
Java BytesXMLMessage类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap