当前位置: 首页>>代码示例>>Java>>正文


Java BiomeDictionary类代码示例

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


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

示例1: preInit

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public static void preInit() {
	int biomeID = 10;
	while (BiomeDictionary.isBiomeRegistered(biomeID))
		biomeID++;
	
	// Create Town Forest
	biomeTownForest = new BiomeTownForest(biomeID).setBiomeName(BiomeTownForest.name);
       // Allow villages in this biome
	BiomeManager.addVillageBiome(biomeTownForest, true);
	BiomeDictionary.registerBiomeType(biomeTownForest, Type.MAGICAL);
	int weight = Configs.VILLAGE.town_weight;
	LogHelper.info("ModBiomes: Town Forest created with weight: " + weight);
	biomeEntryTownForest = new BiomeEntry(biomeTownForest, weight);
	BiomeManager.addBiome(BiomeType.WARM, biomeEntryTownForest);
	
	// Create City Forest
	biomeID++;
	biomeCityPlains = new BiomeCityPlains(biomeID).setBiomeName(BiomeCityPlains.name);
       // Allow villages in this biome
	BiomeManager.addVillageBiome(biomeCityPlains, true);
	BiomeDictionary.registerBiomeType(biomeCityPlains, Type.MAGICAL);
	weight = Configs.VILLAGE.city_weight;
	LogHelper.info("ModBiomes: City Plains created with weight: " + weight);
	biomeEntryCityPlains = new BiomeEntry(biomeCityPlains, weight);
	BiomeManager.addBiome(BiomeType.WARM, biomeEntryCityPlains);
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:27,代码来源:ModBiomes.java

示例2: generate

import net.minecraftforge.common.BiomeDictionary; //导入依赖的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

示例3: init

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public static void init() {
	int id = 0;
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":withering_bolt"), EntityWitheringBolt.class, "withering_bolt", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), EntityPigZombieMage.class, "zombie_pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), 14581128, 11799808);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":pigman_mage"), EntityPigMage.class, "pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":pigman_mage"), 14581128, 11665527);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":fire_breath"), EntityFireBreath.class, "fire_breath", id++, Infernum.instance, 64, 1, true);
	
	List<Biome> spawnBiomes = new ArrayList<Biome>();
	spawnBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	spawnBiomes.add(Biomes.HELL);
	for (Biome b : spawnBiomes) {
		System.out.println(b.getBiomeName());
	}
	EntityRegistry.addSpawn(EntityPigZombieMage.class, 150, 1, 2, EnumCreatureType.MONSTER, spawnBiomes.toArray(new Biome[spawnBiomes.size()]));
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:18,代码来源:InfernumEntities.java

示例4: init

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public static void init()
{
	// Register mod entities
	int entityId = 1;
	EntityRegistry.registerModEntity(new ResourceLocation("btweagles:stevebeej"), EntitySteveBeej.class, "SteveBeej", entityId++, BetterThanWeagles.instance, 64, 3, true, 0xD1A288, 0x00CCCC);

	// Set up spawn criteria
	Set<Biome> validBiomes = new HashSet<>();

	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.HILLS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP));

	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.END));

	EntityRegistry.addSpawn(EntitySteveBeej.class, 10, 1, 1, EnumCreatureType.MONSTER, validBiomes.toArray(new Biome[validBiomes.size()]));

	// Register entity loot tables
	LootTableList.register(EntitySteveBeej.LOOT_TABLE);
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:23,代码来源:ModEntities.java

示例5: getFromBiome

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public static Anima getFromBiome(Biome biome)
{
	if (BiomeDictionary.hasType(biome, Type.WATER))
		return Anima.DEPTH;
	else if (BiomeDictionary.hasType(biome, Type.FOREST) || BiomeDictionary.hasType(biome, Type.PLAINS))
		return Anima.HORIZON;
	else if (BiomeDictionary.hasType(biome, Type.DRY) || BiomeDictionary.hasType(biome, Type.NETHER)
			|| BiomeDictionary.hasType(biome, Type.HOT))
		return Anima.INFERNO;
	else if (BiomeDictionary.hasType(biome, Type.HILLS) || BiomeDictionary.hasType(biome, Type.MOUNTAIN)
			|| BiomeDictionary.hasType(biome, Type.COLD))
		return Anima.OZONE;
	else if (BiomeDictionary.hasType(biome, Type.MESA))
		return Anima.CHAOS;
	else if (biome.equals(Biomes.MUSHROOM_ISLAND) || biome.equals(Biomes.MUSHROOM_ISLAND_SHORE))
		return Anima.PEACE;
	else
		return Anima.HORIZON;
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:20,代码来源:Anima.java

示例6: generate

import net.minecraftforge.common.BiomeDictionary; //导入依赖的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: BiomeGenSpace

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public BiomeGenSpace(int var1)
{
	super(var1);
	this.topBlock = Blocks.grass;
	this.fillerBlock = Blocks.dirt;
	this.stoneBlock = Blocks.stone;
	this.spawnableCaveCreatureList.clear();
	this.spawnableCreatureList.clear();
	this.spawnableMonsterList.clear();
	this.spawnableWaterCreatureList.clear();
	
	if (!ConfigManagerCore.disableBiomeTypeRegistrations)
    {
	        BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DRY, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.SPOOKY);
    }
}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:17,代码来源:BiomeGenSpace.java

示例8: oilPassGenerate

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public void oilPassGenerate(World worldIn, Random rand, Biome biome, BlockPos pos)
{
	float chance = BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY) ? 0.03125F : 0.015625F;
	if (rand.nextFloat() < chance)
	{
		int x = rand.nextInt(16) + 8;
		int z = rand.nextInt(16) + 8;
		BlockPos at = new BlockPos(x, 0, z);
		EventGenOil event = new EventGenOil(worldIn, at, rand, genOil);
		if (MinecraftForge.TERRAIN_GEN_BUS.post(event))
		{
			return;
		}

		event.generator.generate(worldIn, rand, pos.add(at));
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:18,代码来源:ExPBiomeDecorator.java

示例9: coralPassGenerate

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public void coralPassGenerate(World worldIn, Random rand, Biome biome, BlockPos pos)
{
	if (!BiomeDictionary.areSimilar(biome, Biomes.OCEAN))
	{
		return;
	}
	
	int x = rand.nextInt(16) + 8;
	int z = rand.nextInt(16) + 8;
	BlockPos at = worldIn.getHeight(pos.add(x, 0, z));
	EventGenCoral event = new EventGenCoral(worldIn, at, rand, genCoral);
	if (MinecraftForge.TERRAIN_GEN_BUS.post(event))
	{
		return;
	}
	
	event.generator.generate(worldIn, rand, at);
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:19,代码来源:ExPBiomeDecorator.java

示例10: generateCrystalTree

import net.minecraftforge.common.BiomeDictionary; //导入依赖的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

示例11: modifiedIncidence

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
public int modifiedIncidence(Numbered<Biome> biomeIncidence) {
    Biome biome = biomeIncidence.item();
    // increase mountains;
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN)) {
        // multiply by 4
        return biomeIncidence.count()*4;
    }
    // check that extreme hills are a mountain biome
    if (biomeIncidence.item() == Biomes.EXTREME_HILLS) {
        return biomeIncidence.count()*4;
    }
    // Hills unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.HILLS)) {
        // multiply by 4
        return biomeIncidence.count();
    }
    // Oceans unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.OCEAN)) {
        // multiply by 4
        return biomeIncidence.count();
    }
    // everything else suppressed;
    return 0;
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:25,代码来源:MountainFormer.java

示例12: getToxicWaterCatch

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
protected List<ItemStack> getToxicWaterCatch(Set<BiomeDictionary.Type> biomeTypesList) {
    List<ItemStack> tempList = new ArrayList<>();
    int chance = this.rand.nextInt(100) + Math.round(luck);

    if (chance < 50) {
        tempList.add(new ItemStack(Items.BONE));
        tempList.add(new ItemStack(Items.ROTTEN_FLESH));
        tempList.add(new ItemStack(Items.SPIDER_EYE));
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.GREEN_JELLYFISH.ordinal()));
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.BONE_FISH.ordinal()));
    } else if (chance < 80) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SPOOKYFIN.ordinal()));
    } else if (chance < 95) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.CURSED_KOI.ordinal()));
    } else {
        if (chance < 98) {
            tempList.add(new ItemStack(Blocks.SKULL, 1, 0)); // SKELETON
            tempList.add(new ItemStack(Blocks.SKULL, 1, 2)); // ZOMBIE
        } else {
            EnchantmentHelper.addRandomEnchantment(rand, new ItemStack(GSItem.ENCHANTED_SKULL, 1, 0), new RandomValueRange(30, 40).generateInt(rand), true);
        }
    }
    return tempList;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:25,代码来源:EntityBoneFishHook.java

示例13: tier2

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
protected void tier2(List<ItemStack> tempList, Set<BiomeDictionary.Type> biomeTypesList) {
    if (biomeTypesList.contains(BiomeDictionary.Type.OCEAN) || biomeTypesList.contains(BiomeDictionary.Type.BEACH)) {
        tempList.add(new ItemStack(Items.FISH, 1, 3)); //puffer
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.END)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.PEARL_BASS.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SANDY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SANDY_BASS.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SNOWY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SNOWY_CRUCIAN.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SWAMP)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.RUFFE.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.PIRANHA.ordinal()));
    }
    if (tempList.isEmpty()) {
        tempList.add(new ItemStack(Items.FISH, 1, 1)); //salmon
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:24,代码来源:EntityCustomFishHook.java

示例14: tier3

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
protected void tier3(List<ItemStack> tempList, Set<BiomeDictionary.Type> biomeTypesList) {
    if (biomeTypesList.contains(BiomeDictionary.Type.OCEAN) || biomeTypesList.contains(BiomeDictionary.Type.BEACH)) {
        tempList.add(new ItemStack(Items.FISH, 1, 2)); // clown
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.END)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.CHORUS_KOI.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SANDY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.GOLDEN_KOI.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SNOWY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.FROST_MINNOW.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SWAMP)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.MUD_TUNA.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SPARKLING_EEL.ordinal()));
    }
    if (tempList.isEmpty()) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.EXPLOSIVE_CRUCIAN.ordinal()));
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:24,代码来源:EntityCustomFishHook.java

示例15: onInitialSpawn

import net.minecraftforge.common.BiomeDictionary; //导入依赖的package包/类
@Override
@Nullable
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) {
    livingdata = super.onInitialSpawn(difficulty, livingdata);

    Biome biome = this.getEntityWorld().getBiome(new BlockPos(this));
    if ((BiomeDictionary.hasType(biome, BiomeDictionary.Type.DRY) ||
            BiomeDictionary.hasType(biome, BiomeDictionary.Type.SAVANNA)) &&
            this.getRNG().nextInt(5) > 0) {
        this.setMobType(EnumUndeadMobType.HUSK);
    }

    this.setSkin(new Random().nextInt(CAT_TYPES));

    return livingdata;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:17,代码来源:EntityZombieCat.java


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