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


Java BiomeDictionary.getTypesForBiome方法代碼示例

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


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

示例1: isBiomeValid

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
private boolean isBiomeValid(World world, int chunkX, int chunkZ, ArrayList<Type> biomeTypes, ArrayList<Integer> biomeIDs)
{
	if (biomeTypes != null)
	{
		for (Type type : BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 0, chunkZ * 16))))
		{
			if (biomeTypes.contains(type))
			{
				return true;
			}
		}
	}
	if (biomeIDs != null)
	{
		BiomeGenBase biome = world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 0, chunkZ * 16));
		if (biomeIDs.contains(biome.biomeID))
		{
			return true;
		}
	}
	return false;
}
 
開發者ID:VapourDrive,項目名稱:GenLoader,代碼行數:23,代碼來源:GL_WorldGenerator.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: 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

示例4: shouldGenerateSource

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public static boolean shouldGenerateSource(World world, int x, int y, int z) {
    //If the arrays haven't been initialized yet. Only runs once per game session and is called on first instance of water updating
    if (!waterInitialized) {
        waterInitialized = true;
        LocationChecker.initArrays();
    }
    int currentDim = world.provider.dimensionId;

    //Ocean dimension
    if (LocationChecker.isOceanDim(currentDim)) {
        return true;
    }
    //Banned dimension
    if (LocationChecker.isBannedDim(currentDim)) {
        return false;
    }
    //Y-axis check
    if (y < ConfigHandler.waterLower || y > ConfigHandler.waterUpper) {
        return false;
    }

    //Banned biome
    BiomeDictionary.Type[] currentBiomeTypes = BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoords(x, z));
    if (LocationChecker.containsBannedBiome(currentBiomeTypes)) {
        return false;
    }

    //Config set to reverse, or valid dim and biome
    return ConfigHandler.reverse || LocationChecker.isValidDim(currentDim) && LocationChecker.containsValidBiome(currentBiomeTypes);
}
 
開發者ID:Zerrens,項目名稱:Regional-Water,代碼行數:31,代碼來源:TransformMethods.java

示例5: matches

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
protected BaseMatchResult matches(World world, BlockPos pos) {
    if(world == null) return BaseMatchResult.False;

    // Get all the tags for this biome:
    BiomeDictionary.Type[] biomeTags = BiomeDictionary.getTypesForBiome(
            world.getBiome(pos));

    // Figure out if we match:
    for(BiomeDictionary.Type type : biomeTags) {
        if(!types.contains(type)) continue;
        return BaseMatchResult.True;
    }

    return BaseMatchResult.False;
}
 
開發者ID:legendblade,項目名稱:CraftingHarmonics,代碼行數:16,代碼來源:BaseBiomeTypeMatcher.java

示例6: matches

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
public Match matches(BiomeGenBase biome) {
	BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome);
	
	if (hasBiomeSpecificOverride(biome)) {
		return Match.PriorityMatch;
	}
	
	if (existsInSet(excludedBiomeTypes, types)) {
		return Match.NoMatch;
	}
	
	return existsInSet(includedBiomeTypes, types) ? Match.Match : Match.NoMatch;
}
 
開發者ID:vidaj,項目名稱:BigTrees,代碼行數:14,代碼來源:BiomeConfiguration.java

示例7: isSatisfied

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
@Override
public boolean isSatisfied(IPlayerTeam team) {
    for (EntityPlayer player: team.getTeamEntities()) { //If any team member has the achievement
        Type types[] = BiomeDictionary.getTypesForBiome(player.worldObj.getBiome(new BlockPos(player)));
        for (Type type : theBiomeTypes) {
            for (Type compare : types) {
                if (compare == type) return true;
            }
        }
    }

    return false;
}
 
開發者ID:joshiejack,項目名稱:Progression,代碼行數:14,代碼來源:ConditionBiomeType.java

示例8: generateAtLevel

import net.minecraftforge.common.BiomeDictionary; //導入方法依賴的package包/類
private void generateAtLevel(Random random, int chunkX, int chunkZ,
		World world, int level) {
	List<Gen> matchingGens = new ArrayList<Gen>();
	GenManager genManager = GenManager.getInstance();
	BiomeGenBase biome = world.getBiomeGenForCoords(new BlockPos(chunkX*16, 0, chunkZ*16));
	Type[] types = BiomeDictionary.getTypesForBiome(biome);
	
	for (int i = 0; i < genManager.getNumGens(); i++) {
		Gen gen = genManager.getGenByIndex(i);
		for (int j = 0; j < types.length; j++) {
			if(gen.generatesInBiome(types[j]) && gen.getLevel() == level) {
				matchingGens.add(gen);

				/* add the gen additional times based on its weight */
				for (int k = 0; k < gen.getWeight(); k++) {
					matchingGens.add(gen);
				}

				break;
			}
		}
	}
	
	if(matchingGens.size() > 0) {
		generateGen(chunkX, chunkZ, world, matchingGens.get(random.nextInt(matchingGens.size())), random);
	}
}
 
開發者ID:mickelus,項目名稱:customgen,代碼行數:28,代碼來源:ForgeGenerator.java


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