public void playServerSound(World world) {
   world.makeSound(
       this,
       ((ItemGun) mod_ModernWarfare.itemGunFlamethrower).firingSound,
       ((ItemGun) mod_ModernWarfare.itemGunFlamethrower).soundRangeFactor,
       1.0F / (random.nextFloat() * 0.1F + 0.95F));
 }
  public boolean interactWith(
      ItemStack var1, EntityHuman var2, World var3, int var4, int var5, int var6, int var7) {
    if (EEProxy.isClient(var3)) return false;
    boolean var8 = true;
    if (chargeLevel(var1) > 0) {
      cleanDroplist(var1);
      var2.C_();
      var3.makeSound(var2, "flash", 0.8F, 1.5F);
      for (int var9 = -(chargeLevel(var1) * (var7 != 5 ? (byte) (var7 != 4 ? 1 : 0) : 2));
          var9 <= chargeLevel(var1) * (var7 != 5 ? var7 != 4 ? 1 : 2 : 0);
          var9++) {
        for (int var10 = -(chargeLevel(var1) * (var7 != 1 ? (byte) (var7 != 0 ? 1 : 0) : 2));
            var10 <= chargeLevel(var1) * (var7 != 1 ? var7 != 0 ? 1 : 2 : 0);
            var10++) {
          for (int var11 = -(chargeLevel(var1) * (var7 != 3 ? (byte) (var7 != 2 ? 1 : 0) : 2));
              var11 <= chargeLevel(var1) * (var7 != 3 ? var7 != 2 ? 1 : 2 : 0);
              var11++) {
            int var12 = var4 + var9;
            int var13 = var5 + var10;
            int var14 = var6 + var11;
            int var15 = var3.getTypeId(var12, var13, var14);
            int var16 = var3.getData(var12, var13, var14);
            if (canBreak(var15, var16) && attemptBreak(var2, var12, var13, var14)) {
              if (getFuelRemaining(var1) < 1) {
                ConsumeReagent(var1, var2, var8);
                var8 = false;
              }
              if (getFuelRemaining(var1) > 0) {
                ArrayList var17 =
                    Block.byId[var15].getBlockDropped(var3, var12, var13, var14, var16, 0);
                ItemStack var19;
                for (Iterator var18 = var17.iterator(); var18.hasNext(); addToDroplist(var1, var19))
                  var19 = (ItemStack) var18.next();

                var3.setTypeId(var12, var13, var14, 0);
                if (var3.random.nextInt(8) == 0)
                  var3.a("largesmoke", var12, var13, var14, 0.0D, 0.0D, 0.0D);
                if (var3.random.nextInt(8) == 0)
                  var3.a("explode", var12, var13, var14, 0.0D, 0.0D, 0.0D);
                setShort(var1, "fuelRemaining", getFuelRemaining(var1) - 1);
              }
            }
          }
        }
      }

      ejectDropList(var3, var1, var4, var5, var6);
    }
    return false;
  }
示例#3
0
  public void startSearch(
      World var1,
      EntityHuman var2,
      ItemStack var3,
      int var4,
      int var5,
      int var6,
      int var7,
      boolean var8) {
    var1.makeSound(var2, "flash", 0.8F, 1.5F);

    if (var8) {
      var2.C_();
    }

    doBreakShovel(var1, var2, var3, var4, var5, var6, var7);
  }
示例#4
0
  public boolean interactWithSpecial(
      ItemStack var1, EntityHuman var2, World var3, int var4, int var5, int var6, int var7) {
    if (EEProxy.isClient(var3)) {
      return false;
    }

    if (chargeLevel(var1) >= 1) {
      cleanDroplist(var1);
      int var8 = var3.getTypeId(var4, var5, var6);

      if (var8 == Block.GRAVEL.id) {
        startSearch(var3, var2, var1, var8, var4, var5, var6, false);
        return true;
      }
    }

    if (chargeLevel(var1) <= 0) {
      return false;
    }

    boolean var19 = true;
    cleanDroplist(var1);
    var2.C_();
    var3.makeSound(var2, "flash", 0.8F, 1.5F);

    for (int var9 = -chargeLevel(var1); var9 <= chargeLevel(var1); var9++) {
      for (int var10 = -chargeLevel(var1); var10 <= chargeLevel(var1); var10++) {
        int var11 = var4 + var9;
        int var13 = var6 + var10;

        if (var7 == 2) {
          var13 += chargeLevel(var1);
        } else if (var7 == 3) {
          var13 -= chargeLevel(var1);
        } else if (var7 == 4) {
          var11 += chargeLevel(var1);
        } else if (var7 == 5) {
          var11 -= chargeLevel(var1);
        }

        int var14 = var3.getTypeId(var11, var5, var13);
        int var15 = var3.getData(var11, var5, var13);

        if (!canBreak(var14, var15)) continue;

        ArrayList var16 = Block.byId[var14].getBlockDropped(var3, var11, var5, var13, var15, 0);
        Iterator var17 = var16.iterator();

        if (!breakBlock(null, var2, var3, var11, var5, var13, var14, var15)) continue;

        while (var17.hasNext()) {
          ItemStack var18 = (ItemStack) var17.next();
          addToDroplist(var1, var18);
        }

        if (var3.random.nextInt(8) == 0) {
          var3.a("largesmoke", var11, var5, var13, 0.0D, 0.0D, 0.0D);
        }

        if (var3.random.nextInt(8) != 0) continue;
        var3.a("explode", var11, var5, var13, 0.0D, 0.0D, 0.0D);
      }
    }

    ejectDropList(var3, var1, var4, var5, var6);
    return true;
  }