예제 #1
0
  public void func_71515_b(ICommandSender p_71515_1_, String[] p_71515_2_) {
    if (p_71515_2_.length > 0 && p_71515_2_[0].length() > 1) {
      EntityPlayerMP var3 =
          MinecraftServer.func_71276_C().func_71203_ab().func_72361_f(p_71515_2_[0]);
      String var4 = "Kicked by an operator.";
      boolean var5 = false;
      if (var3 == null) {
        throw new PlayerNotFoundException();
      } else {
        if (p_71515_2_.length >= 2) {
          var4 = func_82360_a(p_71515_1_, p_71515_2_, 1);
          var5 = true;
        }

        var3.field_71135_a.func_72565_c(var4);
        if (var5) {
          func_71522_a(
              p_71515_1_,
              "commands.kick.success.reason",
              new Object[] {var3.func_70023_ak(), var4});
        } else {
          func_71522_a(p_71515_1_, "commands.kick.success", new Object[] {var3.func_70023_ak()});
        }
      }
    } else {
      throw new WrongUsageException("commands.kick.usage", new Object[0]);
    }
  }
예제 #2
0
  public void func_71515_b(ICommandSender p_71515_1_, String[] p_71515_2_) {
    if (p_71515_2_.length >= 2) {
      EntityPlayerMP var3 = func_82359_c(p_71515_1_, p_71515_2_[0]);
      int var4 = func_71528_a(p_71515_1_, p_71515_2_[1], 1);
      int var5 = 600;
      int var6 = 30;
      int var7 = 0;
      if (var4 >= 0 && var4 < Potion.field_76425_a.length && Potion.field_76425_a[var4] != null) {
        if (p_71515_2_.length >= 3) {
          var6 = func_71532_a(p_71515_1_, p_71515_2_[2], 0, 1000000);
          if (Potion.field_76425_a[var4].func_76403_b()) {
            var5 = var6;
          } else {
            var5 = var6 * 20;
          }
        } else if (Potion.field_76425_a[var4].func_76403_b()) {
          var5 = 1;
        }

        if (p_71515_2_.length >= 4) {
          var7 = func_71532_a(p_71515_1_, p_71515_2_[3], 0, 255);
        }

        if (var6 == 0) {
          if (!var3.func_82165_m(var4)) {
            throw new CommandException(
                "commands.effect.failure.notActive",
                new Object[] {
                  StatCollector.func_74838_a(Potion.field_76425_a[var4].func_76393_a()),
                  var3.func_70023_ak()
                });
          }

          var3.func_82170_o(var4);
          func_71522_a(
              p_71515_1_,
              "commands.effect.success.removed",
              new Object[] {
                StatCollector.func_74838_a(Potion.field_76425_a[var4].func_76393_a()),
                var3.func_70023_ak()
              });
        } else {
          PotionEffect var8 = new PotionEffect(var4, var5, var7);
          var3.func_70690_d(var8);
          func_71522_a(
              p_71515_1_,
              "commands.effect.success",
              new Object[] {
                StatCollector.func_74838_a(var8.func_76453_d()),
                Integer.valueOf(var4),
                Integer.valueOf(var7),
                var3.func_70023_ak(),
                Integer.valueOf(var6)
              });
        }

      } else {
        throw new NumberInvalidException(
            "commands.effect.notFound", new Object[] {Integer.valueOf(var4)});
      }
    } else {
      throw new WrongUsageException("commands.effect.usage", new Object[0]);
    }
  }