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


Java Score.decreaseScore方法代码示例

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


在下文中一共展示了Score.decreaseScore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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())});
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:CommandScoreboard.java

示例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())});
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:56,代码来源:CommandScoreboard.java

示例3: addPlayerScore

import net.minecraft.scoreboard.Score; //导入方法依赖的package包/类
protected void addPlayerScore(ICommandSender sender, String[] p_184918_2_, int p_184918_3_, MinecraftServer server) throws CommandException
{
    String s = p_184918_2_[p_184918_3_ - 1];
    int i = p_184918_3_;
    String s1 = getEntityName(server, sender, p_184918_2_[p_184918_3_++]);

    if (s1.length() > 40)
    {
        throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s1, Integer.valueOf(40)});
    }
    else
    {
        ScoreObjective scoreobjective = this.convertToObjective(p_184918_2_[p_184918_3_++], true, server);
        int j = "set".equalsIgnoreCase(s) ? parseInt(p_184918_2_[p_184918_3_++]) : parseInt(p_184918_2_[p_184918_3_++], 0);

        if (p_184918_2_.length > p_184918_3_)
        {
            Entity entity = getEntity(server, sender, p_184918_2_[i]);

            try
            {
                NBTTagCompound nbttagcompound = JsonToNBT.getTagFromJson(buildString(p_184918_2_, p_184918_3_));
                NBTTagCompound nbttagcompound1 = entityToNBT(entity);

                if (!NBTUtil.areNBTEquals(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(server);
        Score score = scoreboard.getOrCreateScore(s1, scoreobjective);

        if ("set".equalsIgnoreCase(s))
        {
            score.setScorePoints(j);
        }
        else if ("add".equalsIgnoreCase(s))
        {
            score.increaseScore(j);
        }
        else
        {
            score.decreaseScore(j);
        }

        notifyCommandListener(sender, this, "commands.scoreboard.players.set.success", new Object[] {scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints())});
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:55,代码来源:CommandScoreboard.java


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