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