本文整理匯總了Java中net.minecraftforge.common.BiomeDictionary.Type類的典型用法代碼示例。如果您正苦於以下問題:Java Type類的具體用法?Java Type怎麽用?Java Type使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Type類屬於net.minecraftforge.common.BiomeDictionary包,在下文中一共展示了Type類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: preInit
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的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);
}
示例2: getFromBiome
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的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;
}
示例3: isBiomeValid
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的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;
}
示例4: Generation
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
public Generation(IGenerationCategory Category, EnumGenerationPriority GeneratorPriority, EnumGenerationType GeneratorType, float Chance, int Frequency, int MinY, int MaxY, int Size, ArrayList<Integer> Dimensions, ArrayList<Type> BiomeTypes, ArrayList<Integer> BiomeIDs, IWeightedBlockState[] WeightedBlocks, IParsableBlockState BlockToReplace)
{
this.category = Category;
this.generatorPriority = GeneratorPriority;
this.generatorType = GeneratorType;
this.frequency = Frequency;
this.minY = MinY;
this.maxY = MaxY;
this.size = Size;
this.dimensions = Dimensions;
this.weightedBlocks = WeightedBlocks;
this.biomeTypes = BiomeTypes;
this.biomeIDs = BiomeIDs;
this.blockToReplace = BlockToReplace;
this.chance = Chance;
}
示例5: biomeMultiplyer
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
/**
* returns different spawn rates for different biomes TODO find a cleaner
* method of implementation, poor case-by-case
*
* @param biome
* @return
*/
public int biomeMultiplyer(BiomeGenBase biome)
{
if (BiomeDictionary.isBiomeOfType(biome, Type.SWAMP))
{
return 16;
}
if (BiomeDictionary.isBiomeOfType(biome, Type.CONIFEROUS))
{
return 10;
}
if (BiomeDictionary.isBiomeOfType(biome, Type.PLAINS))
{
return 6;
}
else
{
return 0;
}
}
示例6: setField
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public boolean setField(String fieldName, Object object) {
String fieldValue = (String) object;
String[] split = fieldValue.split(",");
StringBuilder fullString = new StringBuilder();
try {
Type[] types = new Type[split.length];
for (int i = 0; i < types.length; i++) {
types[i] = Type.getType(split[i].trim());
}
theBiomeTypes = types;
} catch (Exception e) {}
biomeTypes = fieldValue;
return true;
}
示例7: addSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature)
{
for (BiomeGenBase biome : BiomeGenBase.biomeList)
{
if(biome != null)
{
if(BiomeDictionary.isBiomeRegistered(biome))
{
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.END))
{
return;
}
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER))
{
return;
}
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MUSHROOM))
{
return;
}
}
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biome);
}
}
}
示例8: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Autumn Woods");
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Green Hills");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
HashSet<String> nonFrozenForest = new HashSet<String>();
nonFrozenForest.addAll(typeToArray(Type.FOREST));
nonFrozenForest.addAll(typeToArray(Type.PLAINS));
nonFrozenForest.removeAll(typeToArray(Type.FROZEN));
defaultBiomesToSpawn.addAll(nonFrozenForest);
return defaultBiomesToSpawn;
}
示例9: generate
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider)
{
final Settings settings = Settings.INSTANCE;
if (settings.isOverworldTreeGenEnabled())
{
final int x = (chunkX << 4) + 8 + random.nextInt(16);
final int z = (chunkZ << 4) + 8 + random.nextInt(16);
final BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
final List<Type> biomeTypes = ImmutableList.copyOf(BiomeDictionary.getTypesForBiome(biome));
if (!(biomeTypes.contains(Type.NETHER) || biomeTypes.contains(Type.END)))
if (random.nextInt(settings.overworldTreeGenRarity()) == 0)
{
final OverworldTreeSpecies species =
OverworldTreeSpecies.values()[random.nextInt(OverworldTreeSpecies.values().length)];
final WorldGenerator tree = species.worldTreeGenerator();
final int maxY = world.getHeightValue(x, z) * 2;
final int y = maxY > 0 ? random.nextInt(maxY) : 0;
tree.generate(world, random, x, y, z);
}
}
}
示例10: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Green Hills");
defaultBiomesToSpawn.add("Mountain Taiga");
defaultBiomesToSpawn.add("Pine Forest");
defaultBiomesToSpawn.add("Rainforest");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Snow Forest");
defaultBiomesToSpawn.add("Snowy Rainforest");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST));
return defaultBiomesToSpawn;
}
示例11: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Autumn Woods");
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Green Hills");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
HashSet<String> nonFrozenForest = new HashSet<String>();
nonFrozenForest.addAll(typeToArray(Type.FOREST));
nonFrozenForest.addAll(typeToArray(Type.PLAINS));
nonFrozenForest.removeAll(typeToArray(Type.FROZEN));
defaultBiomesToSpawn.addAll(nonFrozenForest);
return defaultBiomesToSpawn;
}
示例12: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Autumn Woods");
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Mountain Taiga");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Snow Forest");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
HashSet<String> nonFrozenForest = new HashSet<String>();
nonFrozenForest.addAll(typeToArray(Type.FOREST));
nonFrozenForest.removeAll(typeToArray(Type.FROZEN));
defaultBiomesToSpawn.addAll(nonFrozenForest);
return defaultBiomesToSpawn;
}
示例13: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Autumn Woods");
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Green Hills");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
HashSet<String> nonFrozenForest = new HashSet<String>();
nonFrozenForest.addAll(typeToArray(Type.FOREST));
nonFrozenForest.addAll(typeToArray(Type.PLAINS));
nonFrozenForest.removeAll(typeToArray(Type.FROZEN));
defaultBiomesToSpawn.addAll(nonFrozenForest);
return defaultBiomesToSpawn;
}
示例14: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName);
defaultBiomesToSpawn.add("Alpine");
defaultBiomesToSpawn.add("Mountain Taiga");
defaultBiomesToSpawn.add("Snow Forest");
defaultBiomesToSpawn.add("Snowy Rainforest");
HashSet<String> nonFrozenForest = new HashSet<String>();
defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST));
nonFrozenForest.retainAll(typeToArray(Type.FROZEN));
defaultBiomesToSpawn.addAll(nonFrozenForest);
return defaultBiomesToSpawn;
}
示例15: getDefaultBiomesToSpawn
import net.minecraftforge.common.BiomeDictionary.Type; //導入依賴的package包/類
@Override
public HashSet<String> getDefaultBiomesToSpawn() {
HashSet<String> defaultBiomesToSpawn = new HashSet<String>();
defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName);
defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName);
defaultBiomesToSpawn.add("Autumn Woods");
defaultBiomesToSpawn.add("Birch Forest");
defaultBiomesToSpawn.add("Forested Hills");
defaultBiomesToSpawn.add("Forested Island");
defaultBiomesToSpawn.add("Mountain Taiga");
defaultBiomesToSpawn.add("Redwood Forest");
defaultBiomesToSpawn.add("Lush Redwoods");
defaultBiomesToSpawn.add("Snow Forest");
defaultBiomesToSpawn.add("Temperate Rainforest");
defaultBiomesToSpawn.add("Woodlands");
defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST));
return defaultBiomesToSpawn;
}