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


Java Scoreboard.removePlayerFromTeams方法代码示例

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


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

示例1: leaveTeam

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void leaveTeam(ICommandSender p_147199_1_, String[] p_147199_2_, int p_147199_3_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    Set<String> set = Sets.<String>newHashSet();
    Set<String> set1 = Sets.<String>newHashSet();

    if (p_147199_1_ instanceof EntityPlayer && p_147199_3_ == p_147199_2_.length)
    {
        String s3 = getCommandSenderAsPlayer(p_147199_1_).getName();

        if (scoreboard.removePlayerFromTeams(s3))
        {
            set.add(s3);
        }
        else
        {
            set1.add(s3);
        }
    }
    else
    {
        while (p_147199_3_ < p_147199_2_.length)
        {
            String s = p_147199_2_[p_147199_3_++];

            if (s.startsWith("@"))
            {
                for (Entity entity : func_175763_c(p_147199_1_, s))
                {
                    String s2 = getEntityName(p_147199_1_, entity.getUniqueID().toString());

                    if (scoreboard.removePlayerFromTeams(s2))
                    {
                        set.add(s2);
                    }
                    else
                    {
                        set1.add(s2);
                    }
                }
            }
            else
            {
                String s1 = getEntityName(p_147199_1_, s);

                if (scoreboard.removePlayerFromTeams(s1))
                {
                    set.add(s1);
                }
                else
                {
                    set1.add(s1);
                }
            }
        }
    }

    if (!set.isEmpty())
    {
        p_147199_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, set.size());
        notifyOperators(p_147199_1_, this, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(set.size()), joinNiceString(set.toArray(new String[set.size()]))});
    }

    if (!set1.isEmpty())
    {
        throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(set1.size()), joinNiceString(set1.toArray(new String[set1.size()]))});
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:69,代码来源:CommandScoreboard.java

示例2: leaveTeam

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void leaveTeam(ICommandSender sender, String[] p_184911_2_, int p_184911_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    Set<String> set = Sets.<String>newHashSet();
    Set<String> set1 = Sets.<String>newHashSet();

    if (sender instanceof EntityPlayer && p_184911_3_ == p_184911_2_.length)
    {
        String s3 = getCommandSenderAsPlayer(sender).getName();

        if (scoreboard.removePlayerFromTeams(s3))
        {
            set.add(s3);
        }
        else
        {
            set1.add(s3);
        }
    }
    else
    {
        while (p_184911_3_ < p_184911_2_.length)
        {
            String s = p_184911_2_[p_184911_3_++];

            if (EntitySelector.hasArguments(s))
            {
                for (Entity entity : getEntityList(server, sender, s))
                {
                    String s2 = getEntityName(server, sender, entity.getCachedUniqueIdString());

                    if (scoreboard.removePlayerFromTeams(s2))
                    {
                        set.add(s2);
                    }
                    else
                    {
                        set1.add(s2);
                    }
                }
            }
            else
            {
                String s1 = getEntityName(server, sender, s);

                if (scoreboard.removePlayerFromTeams(s1))
                {
                    set.add(s1);
                }
                else
                {
                    set1.add(s1);
                }
            }
        }
    }

    if (!set.isEmpty())
    {
        sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, set.size());
        notifyCommandListener(sender, this, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(set.size()), joinNiceString(set.toArray(new String[set.size()]))});
    }

    if (!set1.isEmpty())
    {
        throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(set1.size()), joinNiceString(set1.toArray(new String[set1.size()]))});
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:69,代码来源:CommandScoreboard.java

示例3: leaveTeam

import net.minecraft.scoreboard.Scoreboard; //导入方法依赖的package包/类
protected void leaveTeam(ICommandSender sender, String[] p_184911_2_, int p_184911_3_, MinecraftServer server) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard(server);
    Set<String> set = Sets.<String>newHashSet();
    Set<String> set1 = Sets.<String>newHashSet();

    if (sender instanceof EntityPlayer && p_184911_3_ == p_184911_2_.length)
    {
        String s3 = getCommandSenderAsPlayer(sender).getName();

        if (scoreboard.removePlayerFromTeams(s3))
        {
            set.add(s3);
        }
        else
        {
            set1.add(s3);
        }
    }
    else
    {
        while (p_184911_3_ < p_184911_2_.length)
        {
            String s = p_184911_2_[p_184911_3_++];

            if (s.startsWith("@"))
            {
                for (Entity entity : getEntityList(server, sender, s))
                {
                    String s2 = getEntityName(server, sender, entity.getCachedUniqueIdString());

                    if (scoreboard.removePlayerFromTeams(s2))
                    {
                        set.add(s2);
                    }
                    else
                    {
                        set1.add(s2);
                    }
                }
            }
            else
            {
                String s1 = getEntityName(server, sender, s);

                if (scoreboard.removePlayerFromTeams(s1))
                {
                    set.add(s1);
                }
                else
                {
                    set1.add(s1);
                }
            }
        }
    }

    if (!set.isEmpty())
    {
        sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, set.size());
        notifyCommandListener(sender, this, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(set.size()), joinNiceString(set.toArray(new String[set.size()]))});
    }

    if (!set1.isEmpty())
    {
        throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(set1.size()), joinNiceString(set1.toArray(new String[set1.size()]))});
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:69,代码来源:CommandScoreboard.java


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