本文整理汇总了Java中net.minecraft.entity.EntityList.EntityEggInfo类的典型用法代码示例。如果您正苦于以下问题:Java EntityEggInfo类的具体用法?Java EntityEggInfo怎么用?Java EntityEggInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityEggInfo类属于net.minecraft.entity.EntityList包,在下文中一共展示了EntityEggInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerEntityEgg
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的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));
}
示例2: addVanillaSpawnEggs
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static void addVanillaSpawnEggs() throws RuntimeException {
for (EntityEggInfo info : (Collection<EntityEggInfo>) EntityList.entityEggs.values()) {
int registerID = VANILLA_START + info.spawnedID;
String mobID = EntityList.getStringFromID(info.spawnedID);
if (registerID > Short.MAX_VALUE || registerID < Short.MIN_VALUE)
throw new RuntimeException("RegisterID out of bounds for " + mobID);
try {
SpawnEggRegistry.registerSpawnEgg(new SpawnEggInfo((short)registerID, mobID,
new NBTTagCompound(), info.primaryColor, info.secondaryColor));
}
catch(IllegalArgumentException e) {
throw new RuntimeException(e);
}
}
}
示例3: getEntityStatistic
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static net.minecraft.stats.StatBase getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) {
EntityEggInfo entityEggInfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(entity.getTypeId()));
if (entityEggInfo != null) {
return entityEggInfo.field_151512_d;
}
return null;
}
示例4: registerEntityEgg
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static EntityEggInfo registerEntityEgg(String id, Class<? extends Entity> entity,
int primaryColor, int secondaryColor) {
ResourceLocation res = CrystalMod.resourceL(id);
EntityEggInfo info = new EntityEggInfo(res, primaryColor, secondaryColor);
EntityList.ENTITY_EGGS.put(res, info);
return info;
}
示例5: registerMonster
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的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));
}
示例6: getOverrideCallbackValue
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@Override
protected StatBase getOverrideCallbackValue(StatBase originalValue) {
if (requiresParameterBlock()) {
return StatList.getBlockStats(parameterBlock);
} else if (requiresParameterItem()) {
String statId = originalValue.statId;
if ("stat.pickup".equals(statId)) {
return StatList.getObjectsPickedUpStats(parameterItem);
} else if ("stat.drop".equals(statId)) {
return StatList.getDroppedObjectStats(parameterItem);
} else if ("stat.useItem".equals(statId)) {
return StatList.getObjectUseStats(parameterItem);
} else if ("stat.breakItem".equals(statId)) {
return StatList.getObjectBreakStats(parameterItem);
} else if ("stat.craftItem".equals(statId)) {
return StatList.getCraftStats(parameterItem);
} else {
throw new AssertionError();
}
} else if (requiresParameterEntity()) {
EntityEggInfo eggInfo = EntityList.ENTITY_EGGS.get(parameterEntity);
if ("stat.killEntity".equals(originalValue.statId)) {
return eggInfo.killEntityStat;
} else {
return eggInfo.entityKilledByStat;
}
} else {
return originalValue;
}
}
示例7: registerEntity
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
/**
* @param entityClass a Entity__.class
* @param entityName name of entity
* @param the color of egg
*/
@Override
public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) {
int id = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor));
}
示例8: registerEntity
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@Override
public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) {
int id = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor));
}
示例9: registerEgg
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@Override
public void registerEgg() {
super.registerEgg();
int eggID = ProjectZulu_Core.getNextDefaultEggID();
while (EntityList.IDtoClassMapping.containsKey(eggID)) {
eggID = ProjectZulu_Core.getNextDefaultEggID();
}
EntityList.IDtoClassMapping.put(eggID, mobClass);
EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2));
}
示例10: registerEntityEgg
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
int id = getUniqueEntityID();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
return;
}
示例11: onEntityRegister
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SubscribeEvent
public void onEntityRegister(Register<EntityEntry> e) {
for (MobInfo mob : MobInfo.values()) {
EntityEntry entry = new EntityEntry(mob.getClz(), mob.getName());
ResourceLocation name = new ResourceLocation(EnderZoo.MODID, mob.getName());
entry.setRegistryName(name);
entry.setEgg(new EntityEggInfo(name, mob.getEggBackgroundColor(), mob.getEggForegroundColor()));
e.getRegistry().register(entry);
registerEntity(mob);
}
}
示例12: createZombie
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void createZombie(String name,
Class<? extends EntityLiving> entityClass, int id,
int secondaryColor) {
EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance,
80, 3, true);
EntityList.IDtoClassMapping.put(id, entityClass);
EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id,
primaryColor, secondaryColor));
EntityRegistry.addSpawn(entityClass, 20, 2, 6,
EnumCreatureType.monster, spawnBiomes);
}
示例13: createPlant
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void createPlant(int id, Class<? extends Entity> entityClass,
String name, int secondaryColor) {
EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance,
80, 3, true);
EntityList.IDtoClassMapping.put(id, entityClass);
EntityList.entityEggs.put(id, new EntityEggInfo(id,
primaryColor, secondaryColor));
}
示例14: registerEntityEgg
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor)
{
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
示例15: addMob
import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
private static void addMob(MappedCategory category, String soundId, ResourceLocation mobId, boolean isHostile) {
final EntityEggInfo mobInfo = EntityList.ENTITY_EGGS.get(mobId);
// TODO maybe some default colors for egg-less mobs?
if (mobInfo != null) addMob(category, soundId, isHostile, mobInfo.primaryColor, mobInfo.secondaryColor);
else addMob(category, soundId, isHostile, 0xFFFFFFFF, 0x00000000);
}