本文整理汇总了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);
}
示例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()])
);
}
示例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);
}
示例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
}
}
示例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()]));
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
示例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));
}
}