本文整理汇总了Java中net.minecraft.scoreboard.ScoreObjective.getCriteria方法的典型用法代码示例。如果您正苦于以下问题:Java ScoreObjective.getCriteria方法的具体用法?Java ScoreObjective.getCriteria怎么用?Java ScoreObjective.getCriteria使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.scoreboard.ScoreObjective
的用法示例。
在下文中一共展示了ScoreObjective.getCriteria方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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});
}
}
}
示例2: addTabCompletionOptions
import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
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;
}
}
示例3: 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});
}
}
}
示例4: getTabCompletionOptions
import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
if (args.length == 1)
{
Scoreboard scoreboard = server.worldServerForDimension(0).getScoreboard();
List<String> list = Lists.<String>newArrayList();
for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives())
{
if (scoreobjective.getCriteria() == IScoreCriteria.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"}): Collections.<String>emptyList();
}
}
示例5: getTabCompletionOptions
import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
if (args.length == 1)
{
Scoreboard scoreboard = server.worldServerForDimension(0).getScoreboard();
List<String> list = Lists.<String>newArrayList();
for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives())
{
if (scoreobjective.getCriteria() == IScoreCriteria.TRIGGER)
{
list.add(scoreobjective.getName());
}
}
/**
* Returns a List of strings (chosen from the given strings) which the last word in the given string array
* is a beginning-match for. (Tab completion).
*/
return getListOfStringsMatchingLastWord(args, (String[])list.toArray(new String[list.size()]));
}
else
{
return args.length == 2 ? getListOfStringsMatchingLastWord(args, new String[] {"add", "set"}): Collections.<String>emptyList();
}
}
示例6: func_175782_e
import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
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;
}
示例7: getTriggerNames
import net.minecraft.scoreboard.ScoreObjective; //导入方法依赖的package包/类
protected List<String> getTriggerNames(MinecraftServer server)
{
Collection<ScoreObjective> collection = this.getScoreboard(server).getScoreObjectives();
List<String> list = Lists.<String>newArrayList();
for (ScoreObjective scoreobjective : collection)
{
if (scoreobjective.getCriteria() == IScoreCriteria.TRIGGER)
{
list.add(scoreobjective.getName());
}
}
return list;
}