gt:         final int j = parseIntWithDefault(p_179648_0_, "l", -1);
context: package net.minecraft.command;
  
  import com.google.common.base.Predicate;
  import com.google.common.base.Predicates;
  import com.google.common.collect.ComparisonChain;
  import com.google.common.collect.Lists;
  import com.google.common.collect.Maps;
  import com.google.common.collect.Sets;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
  import java.util.Map.Entry;
  import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.EntityList;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.entity.player.EntityPlayerMP;
  import net.minecraft.scoreboard.Score;
  import net.minecraft.scoreboard.ScoreObjective;
  import net.minecraft.scoreboard.Scoreboard;
  import net.minecraft.scoreboard.Team;
  import net.minecraft.server.MinecraftServer;
  import net.minecraft.util.AxisAlignedBB;
  import net.minecraft.util.BlockPos;
  import net.minecraft.util.ChatComponentTranslation;
  import net.minecraft.util.EntitySelectors;
  import net.minecraft.util.EnumChatFormatting;
  import net.minecraft.util.IChatComponent;
  import net.minecraft.util.MathHelper;
  import net.minecraft.world.World;
  import net.minecraft.world.WorldSettings;
  
  public class PlayerSelector
  {
      /** This matches the at-tokens introduced for command blocks, including their arguments, if any. */
      private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w\\.=,!-]*)\\])?$"); // FORGE: allow . in entity selectors
      /** This matches things like "-1,,4", and is used for getting x,y,z,range from the token's argument list. */
      private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)");
      /** This matches things like "rm=4,c=2" and is used for handling named token arguments. */
      private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w\\.-]*)(?:$|,)"); // FORGE: allow . in entity selectors
      private static final Set<String> WORLD_BINDING_ARGS = Sets.newHashSet(new String[] {"x", "y", "z", "dx", "dy", "dz", "rm", "r"});
  
      /**
       * Returns the one player that matches the given at-token.  Returns null if more than one player matches.
       */
      public static EntityPlayerMP matchOnePlayer(ICommandSender sender, String token)
      {
          return (EntityPlayerMP)matchOneEntity(sender, token, EntityPlayerMP.class);
      }
  
      public static <T extends Entity> T matchOneEntity(ICommandSender sender, String token, Class <? extends T > targetClass)
      {
          List<T> list = matchEntities(sender, token, targetClass);
          return (T)(list.size() == 1 ? (Entity)list.get(0) : null);
      }
  
      public static IChatComponent matchEntitiesToChatComponent(ICommandSender sender, String token)
      {
          List<Entity> list = matchEntities(sender, token, Entity.class);
  
          if (list.isEmpty())
          {
              return null;
          }
          else
          {
              List<IChatComponent> list1 = Lists.<IChatComponent>newArrayList();
  
              for (Entity entity : list)
              {
                  list1.add(entity.getDisplayName());
              }
  
              return CommandBase.join(list1);
          }
      }
  
      public static <T extends Entity> List<T> matchEntities(ICommandSender sender, String token, Class <? extends T > targetClass)
      {
          Matcher matcher = tokenPattern.matcher(token);
  
          if (matcher.matches() && sender.canCommandSenderUseCommand(1, "@"))
          {
              Map<String, String> map = getArgumentMap(matcher.group(2));
  
              if (!isEntityTypeValid(sender, map))
              {
                  return Collections.<T>emptyList();
              }
              else
              {
                  String s = matcher.group(1);
                  BlockPos blockpos = func_179664_b(map, sender.getPosition());
                  List<World> list = getWorlds(sender, map);
                  List<T> list1 = Lists.<T>newArrayList();
  
                  for (World world : list)
                  {
                      if (world != null)
                      {
                          List<Predicate<Entity>> list2 = Lists.<Predicate<Entity>>newArrayList();
                          list2.addAll(func_179663_a(map, s));
                          list2.addAll(func_179648_b(map));
                          list2.addAll(func_179649_c(map));
                          list2.addAll(func_179659_d(map));
                          list2.addAll(func_179657_e(map));
                          list2.addAll(func_179647_f(map));
                          list2.addAll(func_180698_a(map, blockpos));
                          list2.addAll(func_179662_g(map));
                          list1.addAll(filterResults(map, targetClass, list2, s, world, blockpos));
                      }
                  }
  
                  return func_179658_a(list1, map, sender, targetClass, s, blockpos);
              }
          }
          else
          {
              return Collections.<T>emptyList();
          }
      }
  
      private static List<World> getWorlds(ICommandSender sender, Map<String, String> argumentMap)
      {
          List<World> list = Lists.<World>newArrayList();
  
          if (func_179665_h(argumentMap))
          {
              list.add(sender.getEntityWorld());
          }
          else
          {
              Collections.addAll(list, MinecraftServer.getServer().worldServers);
          }
  
          return list;
      }
  
      private static <T extends Entity> boolean isEntityTypeValid(ICommandSender commandSender, Map<String, String> params)
      {
          String s = func_179651_b(params, "type");
          s = s != null && s.startsWith("!") ? s.substring(1) : s;
  
          if (s != null && !EntityList.isStringValidEntityName(s))
          {
              ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.entity.invalidType", new Object[] {s});
              chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED);
              commandSender.addChatMessage(chatcomponenttranslation);
              return false;
          }
          else
          {
              return true;
          }
      }
  
      private static List<Predicate<Entity>> func_179663_a(Map<String, String> p_179663_0_, String p_179663_1_)
      {
          List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
          String s = func_179651_b(p_179663_0_, "type");
          final boolean flag = s != null && s.startsWith("!");
  
          if (flag)
          {
              s = s.substring(1);
          }
  
          boolean flag1 = !p_179663_1_.equals("e");
          boolean flag2 = p_179663_1_.equals("r") && s != null;
  
          if ((s == null || !p_179663_1_.equals("e")) && !flag2)
          {
              if (flag1)
              {
                  list.add(new Predicate<Entity>()
                  {
                      public boolean apply(Entity p_apply_1_)
                      {
                          return p_apply_1_ instanceof EntityPlayer;
                      }
                  });
              }
          }
          else
          {
              final String s_f = s;
              list.add(new Predicate<Entity>()
              {
                  public boolean apply(Entity p_apply_1_)
                  {
                      return EntityList.isStringEntityName(p_apply_1_, s_f) != flag;
                  }
              });
          }
  
          return list;
      }
  
      private static List<Predicate<Entity>> func_179648_b(Map<String, String> p_179648_0_)
      {
          List<Predicate<Entity>> list = Lists.<Predicate<Entity>>newArrayList();
          final int i = parseIntWithDefault(p_179648_0_, "lm", -1);
  