当前位置: 首页>>代码示例>>Java>>正文


Java ScoreObjective.getDisplayName方法代码示例

本文整理汇总了Java中net.minecraft.scoreboard.ScoreObjective.getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java ScoreObjective.getDisplayName方法的具体用法?Java ScoreObjective.getDisplayName怎么用?Java ScoreObjective.getDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.scoreboard.ScoreObjective的用法示例。


在下文中一共展示了ScoreObjective.getDisplayName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: S3BPacketScoreboardObjective

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public S3BPacketScoreboardObjective(ScoreObjective p_i45224_1_, int p_i45224_2_)
{
    this.objectiveName = p_i45224_1_.getName();
    this.objectiveValue = p_i45224_1_.getDisplayName();
    this.type = p_i45224_1_.getCriteria().getRenderType();
    this.field_149342_c = p_i45224_2_;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:S3BPacketScoreboardObjective.java

示例2: SPacketScoreboardObjective

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public SPacketScoreboardObjective(ScoreObjective objective, int actionIn)
{
    this.objectiveName = objective.getName();
    this.objectiveValue = objective.getDisplayName();
    this.type = objective.getCriteria().getRenderType();
    this.action = actionIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:SPacketScoreboardObjective.java

示例3: renderScoreboard

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
private void renderScoreboard(ScoreObjective p_180475_1_, ScaledResolution p_180475_2_)
{
    Scoreboard scoreboard = p_180475_1_.getScoreboard();
    Collection<Score> collection = scoreboard.getSortedScores(p_180475_1_);
    List<Score> list = Lists.newArrayList(Iterables.filter(collection, new Predicate<Score>()
    {
        public boolean apply(Score p_apply_1_)
        {
            return p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#");
        }
    }));

    if (list.size() > 15)
    {
        collection = Lists.newArrayList(Iterables.skip(list, collection.size() - 15));
    }
    else
    {
        collection = list;
    }

    int i = this.getFontRenderer().getStringWidth(p_180475_1_.getDisplayName());

    for (Score score : collection)
    {
        ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
        String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints();
        i = Math.max(i, this.getFontRenderer().getStringWidth(s));
    }

    int i1 = collection.size() * this.getFontRenderer().FONT_HEIGHT;
    int j1 = p_180475_2_.getScaledHeight() / 2 + i1 / 3;
    int k1 = 3;
    int l1 = p_180475_2_.getScaledWidth() - i - k1;
    int j = 0;

    for (Score score1 : collection)
    {
        ++j;
        ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
        String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());
        String s2 = EnumChatFormatting.RED + "" + score1.getScorePoints();
        int k = j1 - j * this.getFontRenderer().FONT_HEIGHT;
        int l = p_180475_2_.getScaledWidth() - k1 + 2;
        drawRect(l1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
        this.getFontRenderer().drawString(s1, l1, k, 553648127);
        this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);

        if (j == collection.size())
        {
            String s3 = p_180475_1_.getDisplayName();
            drawRect(l1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736);
            drawRect(l1 - 2, k - 1, l, k, 1342177280);
            this.getFontRenderer().drawString(s3, l1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, k - this.getFontRenderer().FONT_HEIGHT, 553648127);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:58,代码来源:GuiIngame.java

示例4: renderScoreboard

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
private void renderScoreboard(ScoreObjective objective, ScaledResolution scaledRes)
{
    Scoreboard scoreboard = objective.getScoreboard();
    Collection<Score> collection = scoreboard.getSortedScores(objective);
    List<Score> list = Lists.newArrayList(Iterables.filter(collection, new Predicate<Score>()
    {
        public boolean apply(@Nullable Score p_apply_1_)
        {
            return p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#");
        }
    }));

    if (list.size() > 15)
    {
        collection = Lists.newArrayList(Iterables.skip(list, collection.size() - 15));
    }
    else
    {
        collection = list;
    }

    int i = this.getFontRenderer().getStringWidth(objective.getDisplayName());

    for (Score score : collection)
    {
        ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
        String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + TextFormatting.RED + score.getScorePoints();
        i = Math.max(i, this.getFontRenderer().getStringWidth(s));
    }

    int i1 = collection.size() * this.getFontRenderer().FONT_HEIGHT;
    int j1 = scaledRes.getScaledHeight() / 2 + i1 / 3;
    int k1 = 3;
    int l1 = scaledRes.getScaledWidth() - i - 3;
    int j = 0;

    for (Score score1 : collection)
    {
        ++j;
        ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
        String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());
        String s2 = TextFormatting.RED + "" + score1.getScorePoints();
        int k = j1 - j * this.getFontRenderer().FONT_HEIGHT;
        int l = scaledRes.getScaledWidth() - 3 + 2;
        drawRect(l1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
        this.getFontRenderer().drawString(s1, l1, k, 553648127);
        this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);

        if (j == collection.size())
        {
            String s3 = objective.getDisplayName();
            drawRect(l1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736);
            drawRect(l1 - 2, k - 1, l, k, 1342177280);
            this.getFontRenderer().drawString(s3, l1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, k - this.getFontRenderer().FONT_HEIGHT, 553648127);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:58,代码来源:GuiIngame.java

示例5: renderScoreboard

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected void renderScoreboard(ScoreObjective objective, ScaledResolution scaledRes)
{
    Scoreboard scoreboard = objective.getScoreboard();
    Collection<Score> collection = scoreboard.getSortedScores(objective);
    List<Score> list = Lists.newArrayList(Iterables.filter(collection, new Predicate<Score>()
    {
        public boolean apply(@Nullable Score p_apply_1_)
        {
            return p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#");
        }
    }));

    if (list.size() > 15)
    {
        collection = Lists.newArrayList(Iterables.skip(list, collection.size() - 15));
    }
    else
    {
        collection = list;
    }

    int i = this.getFontRenderer().getStringWidth(objective.getDisplayName());

    for (Score score : collection)
    {
        ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
        String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + TextFormatting.RED + score.getScorePoints();
        i = Math.max(i, this.getFontRenderer().getStringWidth(s));
    }

    int i1 = collection.size() * this.getFontRenderer().FONT_HEIGHT;
    int j1 = scaledRes.getScaledHeight() / 2 + i1 / 3;
    int k1 = 3;
    int l1 = scaledRes.getScaledWidth() - i - 3;
    int j = 0;

    for (Score score1 : collection)
    {
        ++j;
        ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
        String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());
        String s2 = TextFormatting.RED + "" + score1.getScorePoints();
        int k = j1 - j * this.getFontRenderer().FONT_HEIGHT;
        int l = scaledRes.getScaledWidth() - 3 + 2;
        drawRect(l1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
        this.getFontRenderer().drawString(s1, l1, k, 553648127);
        this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);

        if (j == collection.size())
        {
            String s3 = objective.getDisplayName();
            drawRect(l1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736);
            drawRect(l1 - 2, k - 1, l, k, 1342177280);
            this.getFontRenderer().drawString(s3, l1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, k - this.getFontRenderer().FONT_HEIGHT, 553648127);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:58,代码来源:GuiIngame.java


注:本文中的net.minecraft.scoreboard.ScoreObjective.getDisplayName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。