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


Java IScoreObjectiveCriteria.TRIGGER属性代码示例

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


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

示例1: func_175779_n

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,代码行数:25,代码来源:CommandScoreboard.java

示例2: addTabCompletionOptions

public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos)
{
    if (args.length == 1)
    {
        Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard();
        List<String> list = Lists.<String>newArrayList();

        for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives())
        {
            if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER)
            {
                list.add(scoreobjective.getName());
            }
        }

        return getListOfStringsMatchingLastWord(args, (String[])list.toArray(new String[list.size()]));
    }
    else
    {
        return args.length == 2 ? getListOfStringsMatchingLastWord(args, new String[] {"add", "set"}): null;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:CommandTrigger.java

示例3: func_175782_e

protected List<String> func_175782_e()
{
    Collection<ScoreObjective> collection = this.getScoreboard().getScoreObjectives();
    List<String> list = Lists.<String>newArrayList();

    for (ScoreObjective scoreobjective : collection)
    {
        if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER)
        {
            list.add(scoreobjective.getName());
        }
    }

    return list;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:CommandScoreboard.java


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