本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}