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


Java ScoreObjective.getName方法代码示例

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


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

示例1: enablePlayerTrigger

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected void enablePlayerTrigger(ICommandSender sender, String[] p_184914_2_, int p_184914_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    String s = getPlayerName(server, sender, p_184914_2_[p_184914_3_++]);

    if (s.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.convertToObjective(p_184914_2_[p_184914_3_], false, server);

        if (scoreobjective.getCriteria() != IScoreCriteria.TRIGGER)
        {
            throw new CommandException("commands.scoreboard.players.enable.noTrigger", new Object[] {scoreobjective.getName()});
        }
        else
        {
            Score score = scoreboard.getOrCreateScore(s, scoreobjective);
            score.setLocked(false);
            notifyCommandListener(sender, this, "commands.scoreboard.players.enable.success", new Object[] {scoreobjective.getName(), s});
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:CommandScoreboard.java

示例2: func_175779_n

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected void func_175779_n(ICommandSender p_175779_1_, String[] p_175779_2_, int p_175779_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    String s = getPlayerName(p_175779_1_, p_175779_2_[p_175779_3_++]);

    if (s.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.getObjective(p_175779_2_[p_175779_3_], false);

        if (scoreobjective.getCriteria() != IScoreObjectiveCriteria.TRIGGER)
        {
            throw new CommandException("commands.scoreboard.players.enable.noTrigger", new Object[] {scoreobjective.getName()});
        }
        else
        {
            Score score = scoreboard.getValueFromObjective(s, scoreobjective);
            score.setLocked(false);
            notifyOperators(p_175779_1_, this, "commands.scoreboard.players.enable.success", new Object[] {scoreobjective.getName(), s});
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:CommandScoreboard.java

示例3: 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

示例4: S3CPacketUpdateScore

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public S3CPacketUpdateScore(String nameIn, ScoreObjective objectiveIn)
{
    this.name = nameIn;
    this.objective = objectiveIn.getName();
    this.value = 0;
    this.action = S3CPacketUpdateScore.Action.REMOVE;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:S3CPacketUpdateScore.java

示例5: func_175781_o

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected void func_175781_o(ICommandSender p_175781_1_, String[] p_175781_2_, int p_175781_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    String s = getEntityName(p_175781_1_, p_175781_2_[p_175781_3_++]);

    if (s.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.getObjective(p_175781_2_[p_175781_3_++], false);

        if (!scoreboard.entityHasObjective(s, scoreobjective))
        {
            throw new CommandException("commands.scoreboard.players.test.notFound", new Object[] {scoreobjective.getName(), s});
        }
        else
        {
            int i = p_175781_2_[p_175781_3_].equals("*") ? Integer.MIN_VALUE : parseInt(p_175781_2_[p_175781_3_]);
            ++p_175781_3_;
            int j = p_175781_3_ < p_175781_2_.length && !p_175781_2_[p_175781_3_].equals("*") ? parseInt(p_175781_2_[p_175781_3_], i) : Integer.MAX_VALUE;
            Score score = scoreboard.getValueFromObjective(s, scoreobjective);

            if (score.getScorePoints() >= i && score.getScorePoints() <= j)
            {
                notifyOperators(p_175781_1_, this, "commands.scoreboard.players.test.success", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)});
            }
            else
            {
                throw new CommandException("commands.scoreboard.players.test.failed", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)});
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:CommandScoreboard.java

示例6: testPlayerScore

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected void testPlayerScore(ICommandSender sender, String[] p_184907_2_, int p_184907_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    String s = getEntityName(server, sender, p_184907_2_[p_184907_3_++]);

    if (s.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.convertToObjective(p_184907_2_[p_184907_3_++], false, server);

        if (!scoreboard.entityHasObjective(s, scoreobjective))
        {
            throw new CommandException("commands.scoreboard.players.test.notFound", new Object[] {scoreobjective.getName(), s});
        }
        else
        {
            int i = p_184907_2_[p_184907_3_].equals("*") ? Integer.MIN_VALUE : parseInt(p_184907_2_[p_184907_3_]);
            ++p_184907_3_;
            int j = p_184907_3_ < p_184907_2_.length && !p_184907_2_[p_184907_3_].equals("*") ? parseInt(p_184907_2_[p_184907_3_], i) : Integer.MAX_VALUE;
            Score score = scoreboard.getOrCreateScore(s, scoreobjective);

            if (score.getScorePoints() >= i && score.getScorePoints() <= j)
            {
                notifyCommandListener(sender, this, "commands.scoreboard.players.test.success", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)});
            }
            else
            {
                throw new CommandException("commands.scoreboard.players.test.failed", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)});
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:36,代码来源:CommandScoreboard.java

示例7: S3DPacketDisplayScoreboard

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public S3DPacketDisplayScoreboard(int positionIn, ScoreObjective scoreIn)
{
    this.position = positionIn;

    if (scoreIn == null)
    {
        this.scoreName = "";
    }
    else
    {
        this.scoreName = scoreIn.getName();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:S3DPacketDisplayScoreboard.java

示例8: SPacketUpdateScore

import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public SPacketUpdateScore(String nameIn, ScoreObjective objectiveIn)
{
    this.name = nameIn;
    this.objective = objectiveIn.getName();
    this.value = 0;
    this.action = SPacketUpdateScore.Action.REMOVE;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:SPacketUpdateScore.java

示例9: 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:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:SPacketScoreboardObjective.java


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