List of usage examples for net.minecraftforge.common BiomeDictionary hasType
public static boolean hasType(Biome biome, Type type)
From source file:com.crackedzombie.common.CrackedZombie.java
License:Open Source License
private Biome[] getBiomesFromTypes(BiomeDictionary.Type... types) { LinkedList<Biome> list = new LinkedList<>(); Collection<Biome> biomes = ForgeRegistries.BIOMES.getValuesCollection(); for (Biome biome : biomes) { int count = types.length; int shouldAdd = 0; for (BiomeDictionary.Type t : types) { if (BiomeDictionary.hasType(biome, t)) { shouldAdd++;// w ww .ja v a 2s .c om } } if (!list.contains(biome) && shouldAdd == count) { list.add(biome); if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { info(" >>> getBiomesFromTypes: " + biome.getBiomeName()); } } } return list.toArray(new Biome[0]); }
From source file:com.crackedzombie.common.CrackedZombie.java
License:Open Source License
private Biome[] excludeBiomesWithTypes(BiomeDictionary.Type... types) { LinkedList<Biome> list = new LinkedList<>(); Collection<Biome> biomes = ForgeRegistries.BIOMES.getValuesCollection(); for (Biome biome : biomes) { for (BiomeDictionary.Type t : types) { if (!BiomeDictionary.hasType(biome, t)) { if (!list.contains(biome)) { list.add(biome);//from w ww. j a va 2 s .c o m if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { info(" >>> excludeBiomesWithTypes: " + biome.getBiomeName()); } } } } } return list.toArray(new Biome[0]); }
From source file:forestry.api.core.BiomeHelper.java
License:Open Source License
/** * Determines if a given Biome is of HELLISH temperature, since it is treated separately from actual temperature values. * Uses the BiomeDictionary.// w w w.j a va 2 s. c o m * * @param biomeGen Biome of the biome in question * @return true, if the Biome is a Nether-type biome; false otherwise. */ public static boolean isBiomeHellish(Biome biomeGen) { if (isBiomeHellishCache.containsKey(biomeGen)) { return isBiomeHellishCache.get(biomeGen); } boolean isBiomeHellish = BiomeDictionary.hasType(biomeGen, BiomeDictionary.Type.NETHER); isBiomeHellishCache.put(biomeGen, isBiomeHellish); return isBiomeHellish; }