本文整理汇总了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});
}
}
}
示例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});
}
}
}
示例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_;
}
示例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;
}
示例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)});
}
}
}
}
示例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)});
}
}
}
}
示例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();
}
}
示例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;
}
示例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;
}