本文整理汇总了Java中net.minecraft.scoreboard.Score.increseScore方法的典型用法代码示例。如果您正苦于以下问题:Java Score.increseScore方法的具体用法?Java Score.increseScore怎么用?Java Score.increseScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.scoreboard.Score
的用法示例。
在下文中一共展示了Score.increseScore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_147197_m
import net.minecraft.scoreboard.Score; //导入方法依赖的package包/类
protected void func_147197_m(ICommandSender p_147197_1_, String[] p_147197_2_, int p_147197_3_)
{
String s = p_147197_2_[p_147197_3_ - 1];
String s1 = func_96332_d(p_147197_1_, p_147197_2_[p_147197_3_++]);
ScoreObjective scoreobjective = this.func_147189_a(p_147197_2_[p_147197_3_++], true);
int j = s.equalsIgnoreCase("set") ? parseInt(p_147197_1_, p_147197_2_[p_147197_3_++]) : parseIntWithMin(p_147197_1_, p_147197_2_[p_147197_3_++], 1);
Scoreboard scoreboard = this.func_147192_d();
Score score = scoreboard.func_96529_a(s1, scoreobjective);
if (s.equalsIgnoreCase("set"))
{
score.setScorePoints(j);
}
else if (s.equalsIgnoreCase("add"))
{
score.increseScore(j);
}
else
{
score.decreaseScore(j);
}
func_152373_a(p_147197_1_, this, "commands.scoreboard.players.set.success", new Object[] {scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints())});
}
示例2: setPlayer
import net.minecraft.scoreboard.Score; //导入方法依赖的package包/类
protected void setPlayer(ICommandSender p_147197_1_, String[] p_147197_2_, int p_147197_3_) throws CommandException
{
String s = p_147197_2_[p_147197_3_ - 1];
int i = p_147197_3_;
String s1 = getEntityName(p_147197_1_, p_147197_2_[p_147197_3_++]);
if (s1.length() > 40)
{
throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s1, Integer.valueOf(40)});
}
else
{
ScoreObjective scoreobjective = this.getObjective(p_147197_2_[p_147197_3_++], true);
int j = s.equalsIgnoreCase("set") ? parseInt(p_147197_2_[p_147197_3_++]) : parseInt(p_147197_2_[p_147197_3_++], 0);
if (p_147197_2_.length > p_147197_3_)
{
Entity entity = func_175768_b(p_147197_1_, p_147197_2_[i]);
try
{
NBTTagCompound nbttagcompound = JsonToNBT.getTagFromJson(buildString(p_147197_2_, p_147197_3_));
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
entity.writeToNBT(nbttagcompound1);
if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true))
{
throw new CommandException("commands.scoreboard.players.set.tagMismatch", new Object[] {s1});
}
}
catch (NBTException nbtexception)
{
throw new CommandException("commands.scoreboard.players.set.tagError", new Object[] {nbtexception.getMessage()});
}
}
Scoreboard scoreboard = this.getScoreboard();
Score score = scoreboard.getValueFromObjective(s1, scoreobjective);
if (s.equalsIgnoreCase("set"))
{
score.setScorePoints(j);
}
else if (s.equalsIgnoreCase("add"))
{
score.increseScore(j);
}
else
{
score.decreaseScore(j);
}
notifyOperators(p_147197_1_, this, "commands.scoreboard.players.set.success", new Object[] {scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints())});
}
}