Java 类net.minecraft.entity.EntityList.EntityEggInfo 实例源码

项目:ARKCraft-Code    文件:EntityHandler.java   
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));
}
项目:BetterSpawnEggs    文件:DefaultFunctionality.java   
@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);
        }
    }
}
项目:Uranium    文件:CraftStatistic.java   
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;
}
项目:CrystalMod    文件:ModEntites.java   
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;
}
项目:ThermosRebased    文件:CraftStatistic.java   
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;
}
项目:Thermos    文件:CraftStatistic.java   
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;
}
项目:KCauldron    文件:CraftStatistic.java   
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;
}
项目:CauldronGit    文件:CraftStatistic.java   
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;
}
项目:Cauldron-Old    文件:CraftStatistic.java   
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;
}
项目:Cauldron-Reloaded    文件:CraftStatistic.java   
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;
}
项目:FFoKC    文件:CraftStatistic.java   
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;
}
项目:ARKCraft-Code    文件:EntityHandler.java   
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));
}
项目:ARKCraft-Code    文件:EntityHandler.java   
public static void registerMonster(Class eClass, String name)
{
    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, BiomeGenBase.beach,
            BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.birchForest,
            BiomeGenBase.extremeHills);
    EntityRegistry.registerModEntity(eClass, name, entityID, ARKCraft.instance(), 64, 1, true);
    EntityList.entityEggs.put(Integer.valueOf(eggID), new EntityList.EntityEggInfo(entityID,
            mainColor, secondColor));
}
项目:Easy-Editors    文件:GuiSelectStat.java   
@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;
    }
}
项目:NausicaaMod    文件:LapMain.java   
/**
 * @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));
}
项目:NausicaaMod    文件:Main.java   
@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));
}
项目:Cauldron    文件:CraftStatistic.java   
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;
}
项目:projectzulu1.7.10-pre-1.3a    文件:EggableDeclaration.java   
@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));
}
项目:Electro-Magic-Tools    文件:BaseEntityRegistry.java   
@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;
}
项目:EnderZoo    文件:RegistryHandler.java   
@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);
      }
}
项目:projectzulu1.7.10    文件:EggableDeclaration.java   
@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));
}
项目:CountryGamer_PlantsVsZombies    文件:Zombies.java   
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);

}
项目:CountryGamer_PlantsVsZombies    文件:EntDec.java   
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));
}
项目:WuppyMods    文件:ModEntities.java   
@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));
}
项目:WuppyMods    文件:ModEntities.java   
@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));
}
项目:WuppyMods    文件:ModEntities.java   
@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));
}
项目:OpenBlocks    文件:SoundIconRegistry.java   
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);
}
项目:4Space-5    文件:ItemInfo.java   
private static void addEntityEgg(Class<?> entity, int i, int j) {
    int id = (Integer)EntityList.classToIDMapping.get(entity);
    EntityList.entityEggs.put(id, new EntityEggInfo(id, i, j));
}
项目:BIGB    文件:ItemInfo.java   
private static void addEntityEgg(Class<?> entity, int i, int j) {
    int id = (Integer)EntityList.classToIDMapping.get(entity);
    EntityList.entityEggs.put(id, new EntityEggInfo(id, i, j));
}
项目:ARKCraft-Code    文件:EntityHandler.java   
public static void registerEntity(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));
}
项目:WikiLink    文件:GuiWikiLinkMenu.java   
@Override
public void initGui() {
    guiLeft = (width - xSize) / 2;
    guiTop = (height - ySize) / 2;

    linkCollection = WikiLinkAPI.linkRegistry.getLink(topic);
    topicName = linkCollection.getTopicName();
    if(topic instanceof ItemStack) {
        stack = (ItemStack) topic;
    } else if(topic instanceof Entity) {
        EntityEggInfo egg = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID((Entity) topic)));
        if(egg != null) {
            stack = new ItemStack(Items.spawn_egg, 1, egg.spawnedID);
        }
    }

    browserButton = new GuiButton(0, guiLeft + 7, guiTop + 149, 68, 20, StatCollector.translateToLocal("wikilink.gui.browser"));
    clipboardButton = new GuiButton(1, guiLeft + 79, guiTop + 149, 68, 20, StatCollector.translateToLocal("wikilink.gui.clipboard"));
    summarizeButton = new GuiButton(2, guiLeft + 152, guiTop + 149, 16, 20, StatCollector.translateToLocal("wikilink.gui.summarize"));

    browserButton.enabled = false;
    clipboardButton.enabled = false;
    summarizeButton.enabled = false;

    buttonList.add(browserButton);
    buttonList.add(clipboardButton);
    buttonList.add(summarizeButton);

    int index = 0;
    linkButtons = new GuiButtonLink[linkCollection.getAllLinks().size()];
    ArrayList<ILink> links = new ArrayList<ILink>();
    links.addAll(linkCollection.getAllLinks());
    Collections.sort(links, WikiLinkAPI.linkRegistry.getLinkComparator());
    Collections.sort(links, WikiLinkAPI.linkRegistry.getLinkComparator());
    for(ILink link : links) {
        linkButtons[index] = new GuiButtonLink(3 + index, guiLeft + 8, guiTop + 26 + index * 24, 138, 24, link);
        linkButtons[index].enabled = false;
        linkButtons[index].visible = false;
        buttonList.add(linkButtons[index]);
        index++;
    }

    scrollTo(0.0F);
}
项目:atlantis-mod    文件:AtlantisMod.java   
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));
}
项目:NausicaaMod    文件:MMod.java   
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));
}
项目:PneumaticCraft    文件:EntityRegistrator.java   
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));
}
项目:Soul-Forest    文件:soul_forest.java   
/**
    * In here an entity egg will be registered
    */  
   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));
   }
项目:Dendrology    文件:IMobEggHandler.java   
/**
 * @param safariNet
 *            The Safari Net that is looking for egg info.
 *
 * @return An EntityEggInfo, or null if this instance cannot handle this
 *         mob.
 */
public EntityEggInfo getEgg(ItemStack safariNet);
项目:PneumaticCraft    文件:IMobEggHandler.java   
/**
 * @param safariNet The Safari Net that is looking for egg info.
 * @return An EntityEggInfo, or null if this instance cannot handle this mob.
 */
public EntityEggInfo getEgg(ItemStack safariNet);