本文整理匯總了Java中net.minecraftforge.fml.common.registry.EntityRegistry.addSpawn方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityRegistry.addSpawn方法的具體用法?Java EntityRegistry.addSpawn怎麽用?Java EntityRegistry.addSpawn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fml.common.registry.EntityRegistry
的用法示例。
在下文中一共展示了EntityRegistry.addSpawn方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的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()]));
}
示例2: init
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的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);
}
示例3: addEntitySpawns
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的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);
}
示例4: registerEntityEgg
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntityEgg(Class eClass, String name, BiomeGenBase... biomes)
{
int id = getUniqueEntityId();
Random rand = new Random(name.hashCode());
int mainColor = rand.nextInt() * 16777215;
int secondColor = rand.nextInt() * 16777215;
EntityRegistry.registerGlobalEntityID(eClass, name, id);
//TODO Model error
//EntityRegistry.registerModEntity(eClass, name, id, ARKCraft.instance(), 64, 4, true);
EntityRegistry.addSpawn(eClass, CoreBalance.DINO_PROPERTIES.SPAWN_PROBABILITY, 2, 4,
EnumCreatureType.CREATURE, biomes);
EntityList.idToClassMapping.put(id, eClass);
EntityList.entityEggs.put(Integer.valueOf(id), new EntityList.EntityEggInfo(id, mainColor,
secondColor));
}
示例5: init
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void init() {
int endermanEggColor1 = new Color(254, 85, 176).getRGB();
int endermanEggColor2 = new Color(97, 230, 150).getRGB();
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "enderman_evolved"), EntityEvolvedEnderman.class, "evolved_enderman", 0, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor2);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "frienderman"), EntityFrienderman.class, "frienderman", 1, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor1);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "friender_pearl"), EntityFrienderPearl.class, "friender_pearl", 2, EndermanEvolution.INSTANCE, 80, 3, true);
EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "evolved_endermite"), EntityEvolvedEndermite.class, "evolved_endermite", 4, EndermanEvolution.INSTANCE, 80, 3, false, new Color(1, 66, 16).getRGB(), endermanEggColor2);
EntitySpawnPlacementRegistry.setPlacementType(EntityEvolvedEnderman.class, SpawnPlacementType.ON_GROUND);
EntitySpawnPlacementRegistry.setPlacementType(EntityFrienderman.class, SpawnPlacementType.ON_GROUND);
EntityRegistry.addSpawn(EntityEvolvedEnderman.class, ConfigOptions.ENDERMAN_PROBABILITY, 1, ConfigOptions.ENDERMAN_MAX_SPAWN, EnumCreatureType.MONSTER, getBiomeList());
EntityRegistry.addSpawn(EntityFrienderman.class, ConfigOptions.FRIENDERMAN_PROBABILITY, 1, ConfigOptions.FRIENDERMAN_MAX_SPAWN, EnumCreatureType.CREATURE, Biomes.SKY, Biomes.DESERT, Biomes.HELL);
}
示例6: updateMobSpawning
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void updateMobSpawning() {
ArrayList<Biome> biomesList = new ArrayList<Biome>();
for (Biome biome : GameRegistry.findRegistry(Biome.class)){
if(biome!=Biomes.HELL && biome!=Biomes.SKY)
biomesList.add(biome);
}
if (!TF2ConfigVars.disableSpawn) {
Biome[] biomes = biomesList.toArray(new Biome[biomesList.size()]);
for(Entry<Class<? extends EntityLiving>, Integer> entry:TF2ConfigVars.spawnRate.entrySet()) {
EntityRegistry.addSpawn(entry.getKey(), entry.getValue().intValue(), 1, 3, EnumCreatureType.MONSTER, biomes);
}
}
}
示例7: registerSpawn
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
private static void registerSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max,
EnumCreatureType typeOfCreature, Biome... biomes) {
if (biomes.length == 0) {
biomes = Biome.EXPLORATION_BIOMES_LIST.toArray(new Biome[Biome.EXPLORATION_BIOMES_LIST.size()]);
}
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biomes);
}
示例8: addSpawn
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
private static void addSpawn(List<BiomeDictionary.Type> biomeTypes, Class<? extends EntityLiving> entityClass,
EnumCreatureType mobType, int spawnProbability, int spawnMinCount, int spawnMaxCount) {
List<Biome> biomes = new ArrayList<>();
for (BiomeDictionary.Type biomeType : biomeTypes) {
biomes.addAll(BiomeDictionary.getBiomes(biomeType));
}
Biome[] biomeArray = new Biome[biomes.size()];
biomes.toArray(biomeArray);
EntityRegistry.addSpawn(entityClass, spawnProbability, spawnMinCount, spawnMaxCount, mobType, biomeArray);
}
示例9: addPenguinSpawn
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void addPenguinSpawn(Class<? extends EntityAgeable> penguinClass, EntityEntry penguinEntry, int defaultWeight, int defaultMin, int defaultMax, Biome... biomes) {
String subCategoryNames = ConfigurationHandler.CATEGORY_PENGUIN_SPAWNS + Configuration.CATEGORY_SPLITTER + penguinEntry.getRegistryName().getResourcePath();
int weight = ConfigurationHandler.config.get(subCategoryNames, "Weight", defaultWeight).getInt();
int min = ConfigurationHandler.config.get(subCategoryNames, "Min", defaultMin).getInt();
int max = ConfigurationHandler.config.get(subCategoryNames, "Max", defaultMax).getInt();
ConfigurationHandler.config.save();
if (weight != 0) {
EntityRegistry.addSpawn(penguinClass, weight, min, max, EnumCreatureType.CREATURE, biomes);
}
}
示例10: createEntity
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void createEntity(Class<? extends Entity> entityClass, String entityName, int solidColor, int spotColor)
{
int randomId = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId);
EntityRegistry.registerModEntity(entityClass, entityName, randomId, Tannery.modInstance, 42,
1, true);
createEgg(randomId, solidColor, spotColor);
// EntityRegistry.addSpawn(Elk.class, 1, 21, 1,
// EnumCreatureType.CREATURE, BiomeGenBase.iceMountains);
EntityRegistry.addSpawn(Elk.class, 62, 3, 7, EnumCreatureType.CREATURE,
BiomeGenBase.iceMountains, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains,
BiomeGenBase.frozenOcean);
}
示例11: init
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public void init()
{
//Remove vanilla horses spawn
EntityRegistry.removeSpawn(EntityHorse.class, EnumCreatureType.CREATURE, Biome.getBiome(1), Biome.getBiome(35));
EntityList.ENTITY_EGGS.remove("EntityHorse");
//Register Custom Horse
EntityRegistry.registerModEntity(EntityHorseCustom.class, "EquidCraftHorse", 5500, EquidCraft.instance, 500, 1, true);
EntityRegistry.registerEgg(EntityHorseCustom.class, 0xAF8968, 0xECDB9A);
EntityRegistry.addSpawn(EntityHorseCustom.class, 5, 2, 6, EnumCreatureType.CREATURE, Biomes.PLAINS);
}
示例12: register
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void register(InfinityMod mod, IForgeRegistry<EntityEntry> registry) {
ResourceLocation registryName = new ResourceLocation(mod.getModId(), this.getName());
if(hasEgg) {
this.setEgg(new EntityList.EntityEggInfo(registryName, primaryColor, secondaryColor));
}
if(doSpawn && EntityLiving.class.isAssignableFrom(this.getEntityClass())) {
EntityRegistry.addSpawn((Class<? extends EntityLiving>) this.getEntityClass(), weight, min, max, type, biomes);
}
InfinityLib.proxy.register(mod, registry, this, this.getName());
this.callback.run();
}
示例13: registerMonster
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerMonster(Class eClass, String name, Biome... biomes)
{
Random rand = new Random(name.hashCode());
int mainColor = rand.nextInt() * 16777215;
int secondColor = rand.nextInt() * 16777215;
EntityRegistry.registerModEntity(eClass, name, idCount++, ARKCraft.instance(), 10, 1, false, mainColor, secondColor);
EntityRegistry.addSpawn(eClass, 25, 2, 4, EnumCreatureType.CREATURE, biomes);
}
示例14: registerMonster
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerMonster(Class eClass, String name, BiomeGenBase... biomes)
{
int eggID = EntityRegistry.findGlobalUniqueEntityId();
Random rand = new Random(name.hashCode());
int mainColor = rand.nextInt() * 16777215;
int secondColor = rand.nextInt() * 16777215;
EntityRegistry.registerGlobalEntityID(eClass, name, eggID);
EntityRegistry.addSpawn(eClass, 25, 2, 4, EnumCreatureType.CREATURE, biomes);
EntityRegistry
.registerModEntity(eClass, name, ++entityID, ARKCraft.instance(), 64, 3, true);
EntityList.entityEggs.put(Integer.valueOf(eggID), new EntityList.EntityEggInfo(++entityID,
mainColor, secondColor));
}
示例15: Initialize
import net.minecraftforge.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
@Override
public void Initialize()
{
int eggColor_main = ColorUtil.rgbToHex(41, 79, 46);
int eggColor_ext = ColorUtil.rgbToHex(125, 156, 37);
MCS.entity(EntityTurtle.class, "Turtle", 0, _Turtle.INSTANCE, 80, 3, true, eggColor_main, eggColor_ext);
EntityRegistry.addSpawn(EntityTurtle.class, 4, 0, 3, EnumCreatureType.CREATURE,
BiomeGenBase.swampland);
super.Initialize();
}