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


Java BiomeDictionary.getTypes方法代碼示例

本文整理匯總了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;
			}
		}
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:14,代碼來源:WorldGenOre.java

示例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;
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:14,代碼來源:CatacombsGenerator.java

示例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()]));
}
 
開發者ID:GirafiStudios,項目名稱:Waddles,代碼行數:12,代碼來源:Waddles.java

示例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();
	}
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:13,代碼來源:BiomeInfo.java

示例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;
}
 
開發者ID:Greymerk,項目名稱:minecraft-roguelike,代碼行數:36,代碼來源:CommandRouteBiome.java

示例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);
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:5,代碼來源:MemorialGenerator.java

示例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));
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:6,代碼來源:SingleGraveGenerator.java

示例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));
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Graves,代碼行數:5,代碼來源:GraveGenerationHelper.java

示例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);
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Graves,代碼行數:45,代碼來源:GraveGenerationHelper.java


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