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


Java BiomeDictionary.Type方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.BiomeDictionary.Type方法的典型用法代碼示例。如果您正苦於以下問題:Java BiomeDictionary.Type方法的具體用法?Java BiomeDictionary.Type怎麽用?Java BiomeDictionary.Type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.BiomeDictionary的用法示例。


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

示例1: 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

示例2: getModifierForBiome

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public static float getModifierForBiome(BiomeGenBase biome) {
    int points = 0;
    for (BiomeDictionary.Type type : BiomeDictionary.getTypesForBiome(biome)) {
        // It's not safe to do a switch on BiomeDictionary.Type; I've gotten a crash caused by weirdos modifying the enum.
        if (type == BiomeDictionary.Type.OCEAN
                || type == BiomeDictionary.Type.RIVER
                || type == BiomeDictionary.Type.WATER
                || type == BiomeDictionary.Type.NETHER
                || type == BiomeDictionary.Type.END) {
            return 0;
        }
        if (type == BiomeDictionary.Type.HOT) points++;
        if (type == BiomeDictionary.Type.JUNGLE) points -= 2;
        if (type == BiomeDictionary.Type.MAGICAL) points--;
        if (type == BiomeDictionary.Type.WASTELAND) points++;
        if (type == BiomeDictionary.Type.MOUNTAIN) points++;
        if (type == BiomeDictionary.Type.HILLS) points++;
        if (type == BiomeDictionary.Type.DEAD) points++;
        if (type == BiomeDictionary.Type.MESA) points += 3;
        if (type == BiomeDictionary.Type.SANDY) points++;
        if (type == BiomeDictionary.Type.SNOWY) points++;
        if (type == BiomeDictionary.Type.MUSHROOM) points--;
        if (type == BiomeDictionary.Type.CONIFEROUS) points++;
    }
    return 1 + biome_suitability_modifier * points;
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:27,代碼來源:CopperGeyserGen.java

示例3: 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

示例4: 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

示例5: isMatchingBiome

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
@Override
public boolean isMatchingBiome(BiomeGenBase biome) {
  
  if(isExcluded(biome)) {
    return false;
  }
  if(!names.isEmpty() && !names.contains(biome.biomeName)) {
    return false;
  }
  for(BiomeDictionary.Type type : types) {
    if(!BiomeDictionary.isBiomeOfType(biome, type)) {
      return false;
    }
  }   
  return true; 
}
 
開發者ID:SleepyTrousers,項目名稱:Structures,代碼行數:17,代碼來源:BiomeFilterAll.java

示例6: addBiomeType

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
/**
 * Adds all biomes of this type to the list of biomes allowed to generate
 * @param type
 */
public void addBiomeType(BiomeDictionary.Type type) {

	ArrayList<BiomeGenBase> entryList = new ArrayList<BiomeGenBase>();

	entryList.addAll(Arrays.asList(BiomeDictionary.getBiomesForType(type)));

	//Neither are acceptable on planets
	entryList.remove(BiomeGenBase.hell);
	entryList.remove(BiomeGenBase.sky);

	//Make sure we dont add double entries
	Iterator<BiomeGenBase> iter = entryList.iterator();
	while(iter.hasNext()) {
		BiomeGenBase nextbiome = iter.next();
		for(BiomeEntry entry : allowedBiomes) {
			if(BiomeDictionary.areBiomesEquivalent(entry.biome, nextbiome))
				iter.remove();
		}

	}
	allowedBiomes.addAll(getBiomesEntries(entryList));

}
 
開發者ID:zmaster587,項目名稱:AdvancedRocketry,代碼行數:28,代碼來源:DimensionProperties.java

示例7: removeBiomeType

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
/**
 * Removes all biomes of this type from the list of biomes allowed to generate
 * @param type
 */
public void removeBiomeType(BiomeDictionary.Type type) {

	ArrayList<BiomeGenBase> entryList = new ArrayList<BiomeGenBase>();

	entryList.addAll(Arrays.asList(BiomeDictionary.getBiomesForType(type)));

	for(BiomeGenBase biome : entryList) {
		Iterator<BiomeEntry> iterator = allowedBiomes.iterator();
		while(iterator.hasNext()) {
			if(BiomeDictionary.areBiomesEquivalent(iterator.next().biome, biome))
				iterator.remove();
		}
	}

}
 
開發者ID:zmaster587,項目名稱:AdvancedRocketry,代碼行數:20,代碼來源:DimensionProperties.java

示例8: addSpawn

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeDictionary.Type type)
{
    for (BiomeGenBase biome : BiomeGenBase.biomeList)
    {
    	if(biome != null)
    	{
    		if(BiomeDictionary.isBiomeRegistered(biome))
    		{
    			if(BiomeDictionary.isBiomeOfType(biome, type))
    			{
    				EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biome);
    			}
    		}
    	}
    }
}
 
開發者ID:TheAwesomeGem,項目名稱:MineFantasy,代碼行數:17,代碼來源:EntitylistMF.java

示例9: getBiomeMinTemp

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
private int getBiomeMinTemp(EntityPlayer player, World world)
{
    BiomeDictionary.Type[] thisBiomeTypes = BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoords((int) player.posX, (int) player.posZ));
    for (BiomeDictionary.Type type : thisBiomeTypes)
    {
        if (type == BiomeDictionary.Type.COLD || type == BiomeDictionary.Type.SNOWY)
        {
            return 0;
        }
        if (type == BiomeDictionary.Type.HOT || type == BiomeDictionary.Type.BEACH)
        {
            return 30;
        }
        if (type == BiomeDictionary.Type.NETHER)
        {
            return 40;
        }
    }
    return 25;
}
 
開發者ID:Darkona,項目名稱:AdventureBackpack2,代碼行數:21,代碼來源:ItemSteamJetpack.java

示例10: isExcluded

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
protected boolean isExcluded(Biome candidate) {
  for (BiomeDictionary.Type exType : typeExcludes) {
    if (BiomeDictionary.hasType(candidate, exType)) {
      if (Config.spawnConfigPrintDetailedOutput) {
        System.out.print("Excluded " + candidate.getBiomeName() + ", ");
      }
      return true;

    }
  }
  for (ResourceLocation exName : nameExcludes) {
    if (exName != null && exName.equals(candidate.getRegistryName())) {
      System.out.print("Excluded " + candidate.getRegistryName() + ", ");
      return false;
    }
  }
  return false;
}
 
開發者ID:SleepyTrousers,項目名稱:EnderZoo,代碼行數:19,代碼來源:AbstractBiomeFilter.java

示例11: isMatchingBiome

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
@Override
public boolean isMatchingBiome(Biome biome) {

  if (isExcluded(biome)) {
    return false;
  }
  if (!names.isEmpty() && !names.contains(biome.getRegistryName())) {
    return false;
  }
  for (BiomeDictionary.Type type : types) {
    if (!BiomeDictionary.hasType(biome, type)) {
      return false;
    }
  }
  return true;
}
 
開發者ID:SleepyTrousers,項目名稱:EnderZoo,代碼行數:17,代碼來源:BiomeFilterAll.java

示例12: generate

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public void generate(World world, int chunkX, int chunkZ, Random rand, BiomeDictionary.Type... biomeTypes) {
    boolean doGenerate = false;
    for (BiomeDictionary.Type type : biomeTypes) {
        if (BiomeDictionary.isBiomeOfType(world.getBiomeGenForCoords(chunkX + 8, chunkZ + 8), type)) {
            doGenerate = true;
        }
    }
    if (doGenerate) {
        for (int i = 0; i < clusterNum; i++) {
            int x = chunkX + rand.nextInt(16);
            int y = rand.nextInt(Math.max(maxY - minY, 0) + minY);
            int z = chunkZ + rand.nextInt(16);
            generateMinable(world, rand, x, y, z);
        }
        world.getChunkFromChunkCoords(chunkX, chunkZ).setChunkModified();
    }
}
 
開發者ID:Numerios,項目名稱:ComplexWiring,代碼行數:18,代碼來源:DecorGenerator.java

示例13: SettingsMesaTheme

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public SettingsMesaTheme(){
	
	this.id = ID;
	this.inherit.add(SettingsBase.ID);
	
	this.criteria = new SpawnCriteria();
	List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
	biomes.add(BiomeDictionary.Type.MESA);
	this.criteria.setBiomeTypes(biomes);
	
	this.towerSettings = new TowerSettings(Tower.ETHO, Theme.getTheme(Theme.ETHOTOWER));
	
	Theme[] themes = {Theme.ETHOTOWER, Theme.ETHOTOWER, Theme.CRYPT, Theme.CRYPT, Theme.NETHER};
	for(int i = 0; i < 5; ++i){
		LevelSettings level = new LevelSettings();
		level.setTheme(Theme.getTheme(themes[i]));
		levels.put(i, level);
	}
}
 
開發者ID:Greymerk,項目名稱:minecraft-roguelike,代碼行數:20,代碼來源:SettingsMesaTheme.java

示例14: WorldGenOre

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
WorldGenOre(Function<Block, IBlockState> function, Block block, int minVeinSize, int maxVeinSize, int minHeight, int maxHeight, int generationChance, Block surrounding, BiomeDictionary.Type... biomes) {
	super(block.getDefaultState(), minVeinSize);
	this.oreToGen = function.apply(block);
	this.minOreVeinSize = minVeinSize;
	this.maxOreVeinSize = maxVeinSize;
	this.maxHeight = maxHeight;
	this.minHeight = minHeight;
	this.genChance = generationChance;
	this.predicate = BlockMatcher.forBlock(surrounding);
	if (biomes != null)
		Collections.addAll(this.biomes, biomes);
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:13,代碼來源:WorldGenOre.java

示例15: generate

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	if (world.provider.getDimensionType().getId() == 0) {
		Set<BiomeDictionary.Type> set = BiomeDictionary.getTypes(world.getBiome(new BlockPos(chunkX, 0, chunkZ)));

		for (BiomeDictionary.Type type : set) {
			if (biomes.isEmpty() || biomes.contains(type)) {
				generateOre(world, random, chunkX, chunkZ);
				break;
			}
		}
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:14,代碼來源:WorldGenOre.java


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