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


Java EnumCreatureType類代碼示例

本文整理匯總了Java中net.minecraft.entity.EnumCreatureType的典型用法代碼示例。如果您正苦於以下問題:Java EnumCreatureType類的具體用法?Java EnumCreatureType怎麽用?Java EnumCreatureType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EnumCreatureType類屬於net.minecraft.entity包,在下文中一共展示了EnumCreatureType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
	if (pos==null) return ImmutableList.of();
	
	if (creatureType == EnumCreatureType.MONSTER) {
           //if (this.genNetherBridge.isInsideStructure(pos)) {
           //    return this.genNetherBridge.getSpawnList();
           //}

           if (this.genNetherBridge.isPositionInStructure(this.world, pos) && this.world.getBlockState(pos.down()).getBlock() == Blocks.NETHER_BRICK) {
               return this.genNetherBridge.getSpawnList();
           }
           
           return Biomes.HELL.getSpawnableList(EnumCreatureType.MONSTER); //TODO: Replace with actual-biome lists.
	}
	return ImmutableList.of();

	//Biome biome = this.world.getBiome(pos);
	//return biome.getSpawnableList(creatureType);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:20,代碼來源:ChunkProviderNeo.java

示例2: registerEntityEntries

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
@SubscribeEvent
public void registerEntityEntries(RegistryEvent.Register<EntityEntry> event) {
    EntityRegistry.registerModEntity(
            new ResourceLocation(MODID, "trumpet_skeleton"), EntityTrumpetSkeleton.class, "trumpetskeleton.TrumpetSkeleton", 0,
            this,
            80, 3, false,
            0xC1C1C1, 0xFCFC00
    );
    List<Biome> biomes = ForgeRegistries.BIOMES.getValues();
    EntityRegistry.addSpawn(
            EntityTrumpetSkeleton.class,
            25, 4, 4,
            EnumCreatureType.MONSTER,
            biomes.toArray(new Biome[biomes.size()])
    );
}
 
開發者ID:JamiesWhiteShirt,項目名稱:trumpet-skeleton,代碼行數:17,代碼來源:TrumpetSkeleton.java

示例3: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
@Override
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
	Biome biome = this.world.getBiome(pos);

	/*
	 * if (this.mapFeaturesEnabled) { if (creatureType ==
	 * EnumCreatureType.MONSTER &&
	 * this.scatteredFeatureGenerator.isSwampHut(pos)) { return
	 * this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); }
	 * 
	 * if (creatureType == EnumCreatureType.MONSTER &&
	 * this.settings.useMonuments &&
	 * this.oceanMonumentGenerator.isPositionInStructure(this.world, pos)) {
	 * return this.oceanMonumentGenerator.getScatteredFeatureSpawnList(); }
	 * }
	 */

	return biome.getSpawnableList(creatureType);
}
 
開發者ID:trigg,項目名稱:Firma,代碼行數:20,代碼來源:FirmaChunkGen.java

示例4: initializeEntityActivationType

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
/**
 * Initializes an entities type on construction to specify what group this
 * entity is in for activation ranges.
 *
 * @param entity
 * @return group id
 */
public static byte initializeEntityActivationType(Entity entity)
{
    Chunk chunk = null;
    // Cauldron start - account for entities that dont extend EntityMob, EntityAmbientCreature, EntityCreature
    if ( entity instanceof EntityMob || entity instanceof EntitySlime || entity.isCreatureType(EnumCreatureType.monster, false)) // Cauldron - account for entities that dont extend EntityMob
    {
        return 1; // Monster
    } else if ( entity instanceof EntityCreature || entity instanceof EntityAmbientCreature || entity.isCreatureType(EnumCreatureType.creature, false) 
             || entity.isCreatureType(EnumCreatureType.waterCreature, false) || entity.isCreatureType(EnumCreatureType.ambient, false))
    {
        return 2; // Animal
    // Cauldron end
    } else
    {
        return 3; // Misc
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:25,代碼來源:ActivationRange.java

示例5: init

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public static void init() {
	int id = 0;
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":withering_bolt"), EntityWitheringBolt.class, "withering_bolt", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), EntityPigZombieMage.class, "zombie_pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), 14581128, 11799808);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":pigman_mage"), EntityPigMage.class, "pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":pigman_mage"), 14581128, 11665527);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":fire_breath"), EntityFireBreath.class, "fire_breath", id++, Infernum.instance, 64, 1, true);
	
	List<Biome> spawnBiomes = new ArrayList<Biome>();
	spawnBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	spawnBiomes.add(Biomes.HELL);
	for (Biome b : spawnBiomes) {
		System.out.println(b.getBiomeName());
	}
	EntityRegistry.addSpawn(EntityPigZombieMage.class, 150, 1, 2, EnumCreatureType.MONSTER, spawnBiomes.toArray(new Biome[spawnBiomes.size()]));
}
 
開發者ID:the-realest-stu,項目名稱:Infernum,代碼行數:18,代碼來源:InfernumEntities.java

示例6: init

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public static void init()
{
	// Register mod entities
	int entityId = 1;
	EntityRegistry.registerModEntity(new ResourceLocation("btweagles:stevebeej"), EntitySteveBeej.class, "SteveBeej", entityId++, BetterThanWeagles.instance, 64, 3, true, 0xD1A288, 0x00CCCC);

	// Set up spawn criteria
	Set<Biome> validBiomes = new HashSet<>();

	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.HILLS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP));

	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.END));

	EntityRegistry.addSpawn(EntitySteveBeej.class, 10, 1, 1, EnumCreatureType.MONSTER, validBiomes.toArray(new Biome[validBiomes.size()]));

	// Register entity loot tables
	LootTableList.register(EntitySteveBeej.LOOT_TABLE);
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:23,代碼來源:ModEntities.java

示例7: getSpawnableList

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<BiomeGenBase.SpawnListEntry> getSpawnableList(EnumCreatureType creatureType)
{
    switch (creatureType)
    {
        case MONSTER:
            return this.spawnableMonsterList;

        case CREATURE:
            return this.spawnableCreatureList;

        case WATER_CREATURE:
            return this.spawnableWaterCreatureList;

        case AMBIENT:
            return this.spawnableCaveCreatureList;

        default:
            return Collections.<BiomeGenBase.SpawnListEntry>emptyList();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:21,代碼來源:BiomeGenBase.java

示例8: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    if (creatureType == EnumCreatureType.MONSTER)
    {
        if (this.genNetherBridge.func_175795_b(pos))
        {
            return this.genNetherBridge.getSpawnList();
        }

        if (this.genNetherBridge.func_175796_a(this.worldObj, pos) && this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.nether_brick)
        {
            return this.genNetherBridge.getSpawnList();
        }
    }

    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);
    return biomegenbase.getSpawnableList(creatureType);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:ChunkProviderHell.java

示例9: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<BiomeGenBase.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos);

    if (this.mapFeaturesEnabled)
    {
        if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.func_175798_a(pos))
        {
            return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList();
        }

        if (creatureType == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.func_175796_a(this.worldObj, pos))
        {
            return this.oceanMonumentGenerator.func_175799_b();
        }
    }

    return biomegenbase.getSpawnableList(creatureType);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:ChunkProviderGenerate.java

示例10: addEntitySpawns

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
/**
 * Add spawning rules for the living mobs we want to be able to spawn naturally.
 */
public static void addEntitySpawns()
{
	// get the list of biomes that creepers can spawn in, we'll use the same biomes for all of our mobs
	Biome[] biomes = getBiomeList(EntityCreeper.class, EnumCreatureType.MONSTER);

	// add the spawn rules to the entity registry
	EntityRegistry.addSpawn(EntityJumpkin.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityZombieHands.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHallowitch.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityCreeperween.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHaunter.class, 5, 1, 1, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityTreater.class, 50, 4, 4, EnumCreatureType.MONSTER, biomes);
}
 
開發者ID:crazysnailboy,項目名稱:Halloween,代碼行數:17,代碼來源:ModEntities.java

示例11: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
@Override
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
    Biome biome = this.world.getBiome(pos);

    for (MapGenStructure structure : this.structureGenerators)
    {
        if (this.featureSpawnListActions.containsKey(structure)) {
            List<Biome.SpawnListEntry> list = this.featureSpawnListActions.get(structure).apply(structure, creatureType, pos);
            if (list != null) {
                return list;
            }
        }
    }

    return biome.getSpawnableList(creatureType);
}
 
開發者ID:stuebz88,項目名稱:modName,代碼行數:17,代碼來源:ChunkProviderBasic.java

示例12: getSpawnableList

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<Biome.SpawnListEntry> getSpawnableList(EnumCreatureType creatureType)
{
    switch (creatureType)
    {
        case MONSTER:
            return this.spawnableMonsterList;

        case CREATURE:
            return this.spawnableCreatureList;

        case WATER_CREATURE:
            return this.spawnableWaterCreatureList;

        case AMBIENT:
            return this.spawnableCaveCreatureList;

        default:
            return Collections.<Biome.SpawnListEntry>emptyList();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:21,代碼來源:Biome.java

示例13: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    if (creatureType == EnumCreatureType.MONSTER)
    {
        if (this.genNetherBridge.isInsideStructure(pos))
        {
            return this.genNetherBridge.getSpawnList();
        }

        if (this.genNetherBridge.isPositionInStructure(this.world, pos) && this.world.getBlockState(pos.down()).getBlock() == Blocks.NETHER_BRICK)
        {
            return this.genNetherBridge.getSpawnList();
        }
    }

    Biome biome = this.world.getBiome(pos);
    return biome.getSpawnableList(creatureType);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:19,代碼來源:ChunkProviderHell.java

示例14: getPossibleCreatures

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    Biome biome = this.worldObj.getBiome(pos);

    if (this.mapFeaturesEnabled)
    {
        if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.isSwampHut(pos))
        {
            return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList();
        }

        if (creatureType == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.isPositionInStructure(this.worldObj, pos))
        {
            return this.oceanMonumentGenerator.getScatteredFeatureSpawnList();
        }
    }

    return biome.getSpawnableList(creatureType);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:20,代碼來源:ChunkProviderOverworld.java

示例15: addSpawn

import net.minecraft.entity.EnumCreatureType; //導入依賴的package包/類
/**
 * Add a spawn entry for the supplied entity in the supplied {@link BiomeGenBase} list
 * @param entityClass Entity class added
 * @param weightedProb Probability
 * @param min Min spawn count
 * @param max Max spawn count
 * @param typeOfCreature Type of spawn
 * @param biomes List of biomes
 */
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, Biome... biomes)
{
    for (Biome biome : biomes)
    {
        List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);

        boolean found = false;
        for (SpawnListEntry entry : spawns)
        {
            //Adjusting an existing spawn entry
            if (entry.entityClass == entityClass)
            {
                entry.itemWeight = weightedProb;
                entry.minGroupCount = min;
                entry.maxGroupCount = max;
                found = true;
                break;
            }
        }

        if (!found)
            spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:34,代碼來源:EntityRegistry.java


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