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


Java EntityList.EntityEggInfo方法代碼示例

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


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

示例1: getChangeForSpawn

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
@Override
public int getChangeForSpawn(SpawnEventDetails details) {

    EntityList.EntityEggInfo eggInfo = EntityRegistry.getEntry(details.entity.getClass()).getEgg();
    if(eggInfo==null) {
        if(DifficultyManager.debugLogSpawns){
            LOG.info("Tried to get kills for mob with class "+details.entity.getClass()+", but not spawn egg found.  Cannot count kills for this mob for difficulty.");
        }
        return 0;
    }
    StatBase stat = eggInfo.killEntityStat;
    int killedMobs = PlayerAreaStatAccumulator.getStatForPlayersInArea(type,stat,details.entity,128);

    int contribution = (int)(((double)killedMobs * difficultyPerHundredKills) / 100);

    if(maxAddedDifficulty>=0){
        contribution = Math.min(contribution,maxAddedDifficulty);
    }

    return contribution;
}
 
開發者ID:talandar,項目名稱:ProgressiveDifficulty,代碼行數:22,代碼來源:SpecificMobKilledControl.java

示例2: drawSlot

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn)
{
    EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID);
    String s = I18n.format("entity." + EntityList.getStringFromID(entitylist$entityegginfo.spawnedID) + ".name", new Object[0]);
    int i = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d);
    int j = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e);
    String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(i), s});
    String s2 = I18n.format("stat.entityKilledBy", new Object[] {s, Integer.valueOf(j)});

    if (i == 0)
    {
        s1 = I18n.format("stat.entityKills.none", new Object[] {s});
    }

    if (j == 0)
    {
        s2 = I18n.format("stat.entityKilledBy.none", new Object[] {s});
    }

    GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_180791_2_ + 2 - 10, p_180791_3_ + 1, 16777215);
    GuiStats.this.drawString(GuiStats.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT, i == 0 ? 6316128 : 9474192);
    GuiStats.this.drawString(GuiStats.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT * 2, j == 0 ? 6316128 : 9474192);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:GuiStats.java

示例3: onKillEntity

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase entityLivingIn)
{
    if (entityLivingIn instanceof IMob)
    {
        this.triggerAchievement(AchievementList.killEnemy);
    }

    EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entityLivingIn)));

    if (entitylist$entityegginfo != null)
    {
        this.triggerAchievement(entitylist$entityegginfo.field_151512_d);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:18,代碼來源:EntityPlayer.java

示例4: StatsMobsList

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public StatsMobsList(Minecraft mcIn)
{
    super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
    this.setShowSelectionBox(false);

    for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values())
    {
        if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0)
        {
            this.field_148222_l.add(entitylist$entityegginfo);
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:14,代碼來源:GuiStats.java

示例5: getSubItems

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
    for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values())
    {
        subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:11,代碼來源:ItemMonsterPlacer.java

示例6: onKillEntity

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * This method gets called when the entity kills another one.
 */
public void onKillEntity(EntityLivingBase entityLivingIn)
{
    if (entityLivingIn instanceof IMob)
    {
        this.addStat(AchievementList.KILL_ENEMY);
    }

    EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.ENTITY_EGGS.get(EntityList.func_191301_a(entityLivingIn));

    if (entitylist$entityegginfo != null)
    {
        this.addStat(entitylist$entityegginfo.killEntityStat);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:18,代碼來源:EntityPlayer.java

示例7: getSubItems

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
{
    for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.ENTITY_EGGS.values())
    {
        ItemStack itemstack = new ItemStack(itemIn, 1);
        applyEntityIdToItemStack(itemstack, entitylist$entityegginfo.spawnedID);
        subItems.add(itemstack);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:13,代碼來源:ItemMonsterPlacer.java

示例8: getSubItems

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
    for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.ENTITY_EGGS.values())
    {
        ItemStack itemstack = new ItemStack(itemIn, 1);
        applyEntityIdToItemStack(itemstack, entitylist$entityegginfo.spawnedID);
        subItems.add(itemstack);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:14,代碼來源:ItemMonsterPlacer.java

示例9: getStatKillEntity

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo)
{
    String s = EntityList.getStringFromID(eggInfo.spawnedID);
    return s == null ? null : (new StatBase("stat.killEntity." + s, new ChatComponentTranslation("stat.entityKill", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:6,代碼來源:StatList.java

示例10: getStatKillEntity

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo)
{
    return eggInfo.spawnedID == null ? null : (new StatBase("stat.killEntity." + eggInfo.spawnedID, new TextComponentTranslation("stat.entityKill", new Object[] {new TextComponentTranslation("entity." + eggInfo.spawnedID + ".name", new Object[0])}))).registerStat();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:StatList.java

示例11: onDeath

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * Called when the mob's health reaches 0.
 */
public void onDeath(DamageSource cause)
{
    boolean flag = this.world.getGameRules().getBoolean("showDeathMessages");
    this.connection.sendPacket(new SPacketCombatEvent(this.getCombatTracker(), SPacketCombatEvent.Event.ENTITY_DIED, flag));

    if (flag)
    {
        Team team = this.getTeam();

        if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS)
        {
            if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS)
            {
                this.mcServer.getPlayerList().sendMessageToAllTeamMembers(this, this.getCombatTracker().getDeathMessage());
            }
            else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM)
            {
                this.mcServer.getPlayerList().sendMessageToTeamOrAllPlayers(this, this.getCombatTracker().getDeathMessage());
            }
        }
        else
        {
            this.mcServer.getPlayerList().sendChatMsg(this.getCombatTracker().getDeathMessage());
        }
    }

    if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator())
    {
        this.func_190776_cN();
        this.inventory.dropAllItems();
    }

    for (ScoreObjective scoreobjective : this.world.getScoreboard().getObjectivesFromCriteria(IScoreCriteria.DEATH_COUNT))
    {
        Score score = this.getWorldScoreboard().getOrCreateScore(this.getName(), scoreobjective);
        score.incrementScore();
    }

    EntityLivingBase entitylivingbase = this.getAttackingEntity();

    if (entitylivingbase != null)
    {
        EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.ENTITY_EGGS.get(EntityList.func_191301_a(entitylivingbase));

        if (entitylist$entityegginfo != null)
        {
            this.addStat(entitylist$entityegginfo.entityKilledByStat);
        }

        entitylivingbase.addToPlayerScore(this, this.scoreValue);
    }

    this.addStat(StatList.DEATHS);
    this.takeStat(StatList.TIME_SINCE_DEATH);
    this.extinguish();
    this.setFlag(0, false);
    this.getCombatTracker().reset();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:62,代碼來源:EntityPlayerMP.java

示例12: onDeath

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
/**
 * Called when the mob's health reaches 0.
 */
public void onDeath(DamageSource cause)
{
    if (this.worldObj.getGameRules().getBoolean("showDeathMessages"))
    {
        Team team = this.getTeam();

        if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS)
        {
            if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS)
            {
                this.mcServer.getConfigurationManager().sendMessageToAllTeamMembers(this, this.getCombatTracker().getDeathMessage());
            }
            else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM)
            {
                this.mcServer.getConfigurationManager().sendMessageToTeamOrEvryPlayer(this, this.getCombatTracker().getDeathMessage());
            }
        }
        else
        {
            this.mcServer.getConfigurationManager().sendChatMsg(this.getCombatTracker().getDeathMessage());
        }
    }

    if (!this.worldObj.getGameRules().getBoolean("keepInventory"))
    {
        this.inventory.dropAllItems();
    }

    for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount))
    {
        Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective);
        score.func_96648_a();
    }

    EntityLivingBase entitylivingbase = this.func_94060_bK();

    if (entitylivingbase != null)
    {
        EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));

        if (entitylist$entityegginfo != null)
        {
            this.triggerAchievement(entitylist$entityegginfo.field_151513_e);
        }

        entitylivingbase.addToPlayerScore(this, this.scoreValue);
    }

    this.triggerAchievement(StatList.deathsStat);
    this.func_175145_a(StatList.timeSinceDeathStat);
    this.getCombatTracker().reset();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:56,代碼來源:EntityPlayerMP.java

示例13: getStatEntityKilledBy

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo)
{
    String s = EntityList.getStringFromID(eggInfo.spawnedID);
    return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new ChatComponentTranslation("stat.entityKilledBy", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:StatList.java

示例14: getColorFromItemStack

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public int getColorFromItemStack(ItemStack stack, int renderPass)
{
    EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(stack.getMetadata()));
    return entitylist$entityegginfo != null ? (renderPass == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) : 16777215;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:6,代碼來源:ItemMonsterPlacer.java

示例15: getStatEntityKilledBy

import net.minecraft.entity.EntityList; //導入方法依賴的package包/類
public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo)
{
    String s = EntityList.func_191302_a(eggInfo.spawnedID);
    return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new TextComponentTranslation("stat.entityKilledBy", new Object[] {new TextComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:StatList.java


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