本文整理汇总了Java中net.minecraftforge.common.BiomeDictionary.getTypes方法的典型用法代码示例。如果您正苦于以下问题:Java BiomeDictionary.getTypes方法的具体用法?Java BiomeDictionary.getTypes怎么用?Java BiomeDictionary.getTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.BiomeDictionary
的用法示例。
在下文中一共展示了BiomeDictionary.getTypes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
}
}
示例2: isBiomeAllowed
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
protected static boolean isBiomeAllowed(World world, int x, int z) {
List<BiomeDictionary.Type> biomeTypesList = new ArrayList<>(BiomeDictionary.getTypes(world.getBiome(new BlockPos(x, 0, z))));
if (!biomeTypesList.contains(BiomeDictionary.Type.WATER) && !biomeTypesList.contains(BiomeDictionary.Type.SWAMP) &&
!biomeTypesList.contains(BiomeDictionary.Type.JUNGLE) && !biomeTypesList.contains(BiomeDictionary.Type.MAGICAL) &&
!biomeTypesList.contains(BiomeDictionary.Type.HILLS) && !biomeTypesList.contains(BiomeDictionary.Type.MOUNTAIN)) {
if (biomeTypesList.contains(BiomeDictionary.Type.PLAINS) || biomeTypesList.contains(BiomeDictionary.Type.FOREST) ||
biomeTypesList.contains(BiomeDictionary.Type.SNOWY) || biomeTypesList.contains(BiomeDictionary.Type.WASTELAND)) {
return true;
}
}
return false;
}
示例3: init
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
List<Biome> spawnable_biomes = Lists.newArrayList();
for (Biome biome : Biome.REGISTRY) {
Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(biome);
if (types.contains(SNOWY) && !types.contains(FOREST) && !types.contains(NETHER) && !biome.getSpawnableList(EnumCreatureType.CREATURE).isEmpty()) {
spawnable_biomes.add(biome);
}
}
PenguinRegistry.addPenguinSpawn(EntityAdeliePenguin.class, PenguinRegistry.ADELIE_PENGUIN, 2, 1, 4, spawnable_biomes.toArray(new Biome[spawnable_biomes.size()]));
}
示例4: BiomeInfo
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
public BiomeInfo(@Nonnull final Biome biome) {
this.biome = biome;
if (!this.isFake()) {
this.hasPrecipitation = canRain() || getEnableSnow();
this.biomeTypes = BiomeDictionary.getTypes(this.biome);
this.biomeId = Biome.getIdForBiome(this.biome);
} else {
this.biomeTypes = ImmutableSet.of();
this.biomeId = ((FakeBiome) this.biome).getBiomeId();
}
}
示例5: execute
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@Override
public void execute(ICommandContext context, List<String> args) {
ArgumentParser ap = new ArgumentParser(args);
IWorldEditor editor = context.createEditor();
Coord pos;
if(!ap.hasEntry(0)){
pos = context.getPos();
} else {
int x; int z;
try {
x = CommandBase.parseInt(ap.get(0));
z = CommandBase.parseInt(ap.get(1));
} catch (NumberInvalidException e) {
context.sendMessage("Failure: Invalid Coords: X Z", MessageType.ERROR);
return;
}
pos = new Coord(x, 0, z);
}
context.sendMessage("Biome Information for " + pos.toString(), MessageType.SPECIAL);
Biome biome = editor.getInfo(pos).getBiome();
context.sendMessage(biome.getBiomeName(), MessageType.SPECIAL);
Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome);
String types = "";
for(BiomeDictionary.Type type : biomeTypes){
types += type.getName() + " ";
}
context.sendMessage(types, MessageType.SPECIAL);
return;
}
示例6: isBiomeAllowed
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
protected static boolean isBiomeAllowed(World world, int x, int z) {
List<BiomeDictionary.Type> biomeTypesList = new ArrayList<>(BiomeDictionary.getTypes(world.getBiome(new BlockPos(x, 0, z))));
return !biomeTypesList.contains(BiomeDictionary.Type.WATER);
}
示例7: isBiomeAllowed
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
protected static boolean isBiomeAllowed(World world, int x, int z) {
List<BiomeDictionary.Type> biomeTypesList = new ArrayList<>(BiomeDictionary.getTypes(world.getBiome(new BlockPos(x, 0, z))));
return !biomeTypesList.contains(BiomeDictionary.Type.WATER) &&
(ExtendedConfig.generateGravesInMushroomBiomes || !BiomeDictionary.getTypes(world.getBiome(new BlockPos(x, 0, z))).equals(BiomeDictionary.Type.MUSHROOM));
}
示例8: isMossyGrave
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
public static boolean isMossyGrave(World world, BlockPos pos, EnumGraveMaterial graveMaterial) {
Set<BiomeDictionary.Type> biomeTypesList = BiomeDictionary.getTypes(world.getBiome(pos));
return graveMaterial != EnumGraveMaterial.OTHER && (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE) || biomeTypesList.contains(BiomeDictionary.Type.SWAMP));
}
示例9: getGraveMaterialByBiomes
import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
public static EnumGraveMaterial[] getGraveMaterialByBiomes(World world, BlockPos pos) {
Set<BiomeDictionary.Type> biomeTypesList = BiomeDictionary.getTypes(world.getBiome(pos));
ArrayList<EnumGraveMaterial> materials = new ArrayList<>();
if (biomeTypesList.contains(BiomeDictionary.Type.SANDY) || biomeTypesList.contains(BiomeDictionary.Type.BEACH)) {
materials.add(EnumGraveMaterial.SANDSTONE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE) || biomeTypesList.contains(BiomeDictionary.Type.SWAMP)) {
materials.add(EnumGraveMaterial.STONE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.MOUNTAIN)) {
materials.add(EnumGraveMaterial.GRANITE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.HILLS)) {
materials.add(EnumGraveMaterial.ANDESITE);
materials.add(EnumGraveMaterial.DIORITE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.PLAINS) || biomeTypesList.contains(BiomeDictionary.Type.MUSHROOM)) {
materials.add(EnumGraveMaterial.STONE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.FOREST)) {
materials.add(EnumGraveMaterial.WOOD);
}
if (biomeTypesList.contains(BiomeDictionary.Type.SNOWY)) {
materials.add(EnumGraveMaterial.ICE);
}
if (biomeTypesList.contains(BiomeDictionary.Type.NETHER)) {
materials.add(EnumGraveMaterial.QUARTZ);
}
if (biomeTypesList.contains(BiomeDictionary.Type.MESA)) {
materials.add(EnumGraveMaterial.RED_SANDSTONE);
}
// TODO if (biomeTypesList.contains(BiomeDictionary.Type.END)) {} ????????
if (biomeTypesList.contains(BiomeDictionary.Type.WATER)) {
materials.add(EnumGraveMaterial.PRIZMARINE);
}
if (materials.isEmpty()) {
materials.add(EnumGraveMaterial.STONE);
}
EnumGraveMaterial[] materialsArray = new EnumGraveMaterial[materials.size()];
return materials.toArray(materialsArray);
}