コード例 #1
0
  @Override
  public void a(class_aco var1, class_ago var2, EntityLiving var3, int var4) {
    if (var3 instanceof class_yu) {
      class_yu var5 = (class_yu) var3;
      boolean var6 = var5.bI.d || (class_afl.a(class_afn.w, var1) > 0);
      int var7 = this.a(var5.bq);
      if (var6 || (var7 > -1)) {
        class_aco var8 = var7 > -1 ? var5.bq.a(var7) : null;
        if (var8 == null) {
          var8 = new class_aco(Items.g);
        }

        class_aax var9 = ((class_aax) (var8.b() instanceof class_aax ? var8.b() : Items.g));
        int var10 = this.e(var1) - var4;
        float var11 = b(var10);
        if (var11 >= 0.1D) {
          EntityArrow var12 = var9.a(var2, var8, var5);
          var12.a(var5.z, var5.y, 0.0F, var11 * 3.0F, 1.0F);
          if (var11 == 1.0F) {
            var12.a(true);
          }

          int var13 = class_afl.a(class_afn.t, var1);
          if (var13 > 0) {
            var12.b(var12.j() + (var13 * 0.5D) + 0.5D);
          }

          int var14 = class_afl.a(class_afn.u, var1);
          if (var14 > 0) {
            var12.a(var14);
          }

          if (class_afl.a(class_afn.v, var1) > 0) {
            var12.e(100);
          }

          var1.a(1, var5);
          var2.a(
              (Entity) var5,
              "random.bow",
              1.0F,
              (1.0F / ((h.nextFloat() * 0.4F) + 1.2F)) + (var11 * 0.5F));
          if (var6) {
            var12.c = 2;
          } else {
            var5.bq.a(var7, 1);
          }

          var5.b(StatisticList.c(Item.b(this)));
          if (!var2.D) {
            var2.a(var12);
          }
        }
      }
    }
  }
コード例 #2
0
  public Map a(String var1) {
    JsonElement var2 = (new JsonParser()).parse(var1);
    if (!var2.isJsonObject()) {
      return Maps.newHashMap();
    } else {
      JsonObject var3 = var2.getAsJsonObject();
      HashMap var4 = Maps.newHashMap();
      Iterator var5 = var3.entrySet().iterator();

      while (true) {
        while (var5.hasNext()) {
          Entry var6 = (Entry) var5.next();
          class_nd var7 = StatisticList.a((String) var6.getKey());
          if (var7 != null) {
            class_nf var8 = new class_nf();
            if (((JsonElement) var6.getValue()).isJsonPrimitive()
                && ((JsonElement) var6.getValue()).getAsJsonPrimitive().isNumber()) {
              var8.a(((JsonElement) var6.getValue()).getAsInt());
            } else if (((JsonElement) var6.getValue()).isJsonObject()) {
              JsonObject var9 = ((JsonElement) var6.getValue()).getAsJsonObject();
              if (var9.has("value")
                  && var9.get("value").isJsonPrimitive()
                  && var9.get("value").getAsJsonPrimitive().isNumber()) {
                var8.a(var9.getAsJsonPrimitive("value").getAsInt());
              }

              if (var9.has("progress") && (var7.l() != null)) {
                try {
                  Constructor var10 = var7.l().getConstructor(new Class[0]);
                  class_ng var11 = (class_ng) var10.newInstance(new Object[0]);
                  var11.a(var9.get("progress"));
                  var8.a(var11);
                } catch (Throwable var12) {
                  b.warn("Invalid statistic progress in " + d, var12);
                }
              }
            }

            var4.put(var7, var8);
          } else {
            b.warn(
                "Invalid statistic in "
                    + d
                    + ": Don\'t know what "
                    + (String) var6.getKey()
                    + " is");
          }
        }

        return var4;
      }
    }
  }
コード例 #3
0
  public static void main(final OptionSet options) { // CraftBukkit - replaces main(String args[])
    StatisticList.a();

    try {
      MinecraftServer minecraftserver =
          new MinecraftServer(options); // CraftBukkit - pass in the options

      // CraftBukkit - remove gui

      minecraftserver.primaryThread
          .start(); // CraftBukkit - let MinecraftServer construct the thread
    } catch (Exception exception) {
      log.log(Level.SEVERE, "Failed to start the minecraft server", exception);
    }
  }
コード例 #4
0
ファイル: MinecraftServer.java プロジェクト: Ketlark77/mc-dev
  public static void main(String[] astring) {
    StatisticList.a();

    try {
      MinecraftServer minecraftserver = new MinecraftServer();

      if (!GraphicsEnvironment.isHeadless()
          && (astring.length <= 0 || !astring[0].equals("nogui"))) {
        ServerGUI.a(minecraftserver);
      }

      (new ThreadServerApplication("Server thread", minecraftserver)).start();
    } catch (Exception exception) {
      log.log(Level.SEVERE, "Failed to start the minecraft server", exception);
    }
  }
コード例 #5
0
ファイル: Block.java プロジェクト: Resistance/mc-dev
  static {
    Item.byId[WOOL.id] = (new ItemCloth(WOOL.id - 256)).a("cloth");
    Item.byId[LOG.id] = (new ItemWithAuxData(LOG.id - 256, LOG)).a("log");
    Item.byId[SMOOTH_BRICK.id] =
        (new ItemWithAuxData(SMOOTH_BRICK.id - 256, SMOOTH_BRICK)).a("stonebricksmooth");
    Item.byId[STEP.id] = (new ItemStep(STEP.id - 256)).a("stoneSlab");
    Item.byId[SAPLING.id] = (new ItemSapling(SAPLING.id - 256)).a("sapling");
    Item.byId[LEAVES.id] = (new ItemLeaves(LEAVES.id - 256)).a("leaves");
    Item.byId[VINE.id] = new ItemColoredBlock(VINE.id - 256, false);
    Item.byId[LONG_GRASS.id] =
        (new ItemColoredBlock(LONG_GRASS.id - 256, true))
            .a(new String[] {"shrub", "grass", "fern"});
    Item.byId[WATER_LILY.id] = new ItemWaterLily(WATER_LILY.id - 256);
    Item.byId[PISTON.id] = new ItemPiston(PISTON.id - 256);
    Item.byId[PISTON_STICKY.id] = new ItemPiston(PISTON_STICKY.id - 256);

    for (int i = 0; i < 256; ++i) {
      if (byId[i] != null) {
        if (Item.byId[i] == null) {
          Item.byId[i] = new ItemBlock(i - 256);
          byId[i].j();
        }

        boolean flag = false;

        if (i > 0 && byId[i].c() == 10) {
          flag = true;
        }

        if (i > 0 && byId[i] instanceof BlockStep) {
          flag = true;
        }

        if (i == SOIL.id) {
          flag = true;
        }

        u[i] = flag;
      }
    }

    r[0] = true;
    StatisticList.b();
  }
コード例 #6
0
ファイル: Item.java プロジェクト: Resistance/mc-dev
 static {
   StatisticList.c();
 }