예제 #1
0
  public void a(IBlockAccess iblockaccess, int i, int j, int k) {
    if (!this.b) {
      int l = iblockaccess.getData(i, j, k);
      float f = 0.28125F;
      float f1 = 0.78125F;
      float f2 = 0.0F;
      float f3 = 1.0F;
      float f4 = 0.125F;

      this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
      if (l == 2) {
        this.a(f2, f, 1.0F - f4, f3, f1, 1.0F);
      }

      if (l == 3) {
        this.a(f2, f, 0.0F, f3, f1, f4);
      }

      if (l == 4) {
        this.a(1.0F - f4, f, f2, 1.0F, f1, f3);
      }

      if (l == 5) {
        this.a(0.0F, f, f2, f4, f1, f3);
      }
    }
  }
예제 #2
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    int l = iblockaccess.getData(i, j, k) & 3;

    if (l != 3 && l != 1) {
      this.a(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F);
    } else {
      this.a(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F);
    }
  }
예제 #3
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    boolean flag = iblockaccess.getData(i, j, k) == 1;
    float f = 0.0625F;

    if (flag) {
      this.a(f, 0.0F, f, 1.0F - f, 0.03125F, 1.0F - f);
    } else {
      this.a(f, 0.0F, f, 1.0F - f, 0.0625F, 1.0F - f);
    }
  }
예제 #4
0
  public static boolean e(IBlockAccess iblockaccess, int i, int j, int k, int l) {
    int i1 = iblockaccess.getTypeId(i, j, k);

    if (i1 == Block.REDSTONE_WIRE.id) return true;
    if (i1 == 0) return false;
    if ((i1 != Block.DIODE_OFF.id) && (i1 != Block.DIODE_ON.id)) {
      return (Block.byId[i1].isPowerSource()) && (l != -1);
    }
    int j1 = iblockaccess.getData(i, j, k);

    return (l == (j1 & 0x3)) || (l == Direction.e[(j1 & 0x3)]);
  }
예제 #5
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    int l = iblockaccess.getData(i, j, k);
    boolean flag = (l & 4) == 4;
    boolean flag1 = (l & 2) == 2;

    if (!flag1) {
      this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F);
    } else if (!flag) {
      this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
    } else {
      this.a(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F);
    }
  }
예제 #6
0
  public static boolean f(IBlockAccess iblockaccess, int i, int j, int k, int l) {
    if (e(iblockaccess, i, j, k, l)) {
      return true;
    }
    int i1 = iblockaccess.getTypeId(i, j, k);

    if (i1 == Block.DIODE_ON.id) {
      int j1 = iblockaccess.getData(i, j, k);

      return l == (j1 & 0x3);
    }
    return false;
  }
  public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
    if (!this.a) {
      return false;
    } else if (iblockaccess.getData(i, j, k) == 0) {
      return false;
    } else if (l == 1) {
      return true;
    } else {
      boolean flag =
          g(iblockaccess, i - 1, j, k, 1)
              || !iblockaccess.t(i - 1, j, k) && g(iblockaccess, i - 1, j - 1, k, -1);
      boolean flag1 =
          g(iblockaccess, i + 1, j, k, 3)
              || !iblockaccess.t(i + 1, j, k) && g(iblockaccess, i + 1, j - 1, k, -1);
      boolean flag2 =
          g(iblockaccess, i, j, k - 1, 2)
              || !iblockaccess.t(i, j, k - 1) && g(iblockaccess, i, j - 1, k - 1, -1);
      boolean flag3 =
          g(iblockaccess, i, j, k + 1, 0)
              || !iblockaccess.t(i, j, k + 1) && g(iblockaccess, i, j - 1, k + 1, -1);

      if (!iblockaccess.t(i, j + 1, k)) {
        if (iblockaccess.t(i - 1, j, k) && g(iblockaccess, i - 1, j + 1, k, -1)) {
          flag = true;
        }

        if (iblockaccess.t(i + 1, j, k) && g(iblockaccess, i + 1, j + 1, k, -1)) {
          flag1 = true;
        }

        if (iblockaccess.t(i, j, k - 1) && g(iblockaccess, i, j + 1, k - 1, -1)) {
          flag2 = true;
        }

        if (iblockaccess.t(i, j, k + 1) && g(iblockaccess, i, j + 1, k + 1, -1)) {
          flag3 = true;
        }
      }

      return !flag2 && !flag1 && !flag && !flag3 && l >= 2 && l <= 5
          ? true
          : (l == 2 && flag2 && !flag && !flag1
              ? true
              : (l == 3 && flag3 && !flag && !flag1
                  ? true
                  : (l == 4 && flag && !flag2 && !flag3
                      ? true
                      : l == 5 && flag1 && !flag2 && !flag3)));
    }
  }
  public static boolean f(IBlockAccess iblockaccess, int i, int j, int k, int l) {
    int i1 = iblockaccess.getTypeId(i, j, k);

    if (i1 == Block.REDSTONE_WIRE.id) {
      return true;
    } else if (i1 == 0) {
      return false;
    } else if (i1 != Block.DIODE_OFF.id && i1 != Block.DIODE_ON.id) {
      return Block.byId[i1].isPowerSource() && l != -1;
    } else {
      int j1 = iblockaccess.getData(i, j, k);

      return l == (j1 & 3) || l == Direction.f[j1 & 3];
    }
  }
예제 #9
0
  public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) {
    if (!this.a) return false;
    if (iblockaccess.getData(i, j, k) == 0) return false;
    if (l == 1) {
      return true;
    }
    boolean flag =
        (f(iblockaccess, i - 1, j, k, 1))
            || ((!iblockaccess.s(i - 1, j, k)) && (f(iblockaccess, i - 1, j - 1, k, -1)));
    boolean flag1 =
        (f(iblockaccess, i + 1, j, k, 3))
            || ((!iblockaccess.s(i + 1, j, k)) && (f(iblockaccess, i + 1, j - 1, k, -1)));
    boolean flag2 =
        (f(iblockaccess, i, j, k - 1, 2))
            || ((!iblockaccess.s(i, j, k - 1)) && (f(iblockaccess, i, j - 1, k - 1, -1)));
    boolean flag3 =
        (f(iblockaccess, i, j, k + 1, 0))
            || ((!iblockaccess.s(i, j, k + 1)) && (f(iblockaccess, i, j - 1, k + 1, -1)));

    if (!iblockaccess.s(i, j + 1, k)) {
      if ((iblockaccess.s(i - 1, j, k)) && (f(iblockaccess, i - 1, j + 1, k, -1))) {
        flag = true;
      }

      if ((iblockaccess.s(i + 1, j, k)) && (f(iblockaccess, i + 1, j + 1, k, -1))) {
        flag1 = true;
      }

      if ((iblockaccess.s(i, j, k - 1)) && (f(iblockaccess, i, j + 1, k - 1, -1))) {
        flag2 = true;
      }

      if ((iblockaccess.s(i, j, k + 1)) && (f(iblockaccess, i, j + 1, k + 1, -1))) {
        flag3 = true;
      }
    }

    return (!flag2) && (!flag1) && (!flag) && (!flag3) && (l >= 2) && (l <= 5);
  }
예제 #10
0
 public boolean a(IBlockAccess iblockaccess, int i, int j, int k, int l) {
   return iblockaccess.getData(i, j, k) > 0;
 }
예제 #11
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    this.maxY = (double) ((float) (iblockaccess.getData(i, j, k) * 2 + 2) / 16.0F);
    float f = 0.125F;

    this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, (float) this.maxY, 0.5F + f);
  }
예제 #12
0
 /** Updates the blocks bounds based on its current state. Args: world, x, y, z */
 public void updateShape(IBlockAccess var1, int var2, int var3, int var4) {
   this.maxY = (double) ((float) (var1.getData(var2, var3, var4) * 2 + 2) / 16.0F);
   float var5 = 0.125F;
   this.a(0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, (float) this.maxY, 0.5F + var5);
 }
예제 #13
0
 public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
   this.b(iblockaccess.getData(i, j, k));
 }
예제 #14
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    int l = iblockaccess.getData(i, j, k) & 7;
    float f = (float) (2 * (1 + l)) / 16.0F;

    this.a(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
  }
예제 #15
0
  public void a(IBlockAccess iblockaccess, int i, int j, int k) {
    int l = iblockaccess.getData(i, j, k);
    float f = 1.0F;
    float f1 = 1.0F;
    float f2 = 1.0F;
    float f3 = 0.0F;
    float f4 = 0.0F;
    float f5 = 0.0F;
    boolean flag = l > 0;

    if ((l & 2) != 0) {
      f3 = Math.max(f3, 0.0625F);
      f = 0.0F;
      f1 = 0.0F;
      f4 = 1.0F;
      f2 = 0.0F;
      f5 = 1.0F;
      flag = true;
    }

    if ((l & 8) != 0) {
      f = Math.min(f, 0.9375F);
      f3 = 1.0F;
      f1 = 0.0F;
      f4 = 1.0F;
      f2 = 0.0F;
      f5 = 1.0F;
      flag = true;
    }

    if ((l & 4) != 0) {
      f5 = Math.max(f5, 0.0625F);
      f2 = 0.0F;
      f = 0.0F;
      f3 = 1.0F;
      f1 = 0.0F;
      f4 = 1.0F;
      flag = true;
    }

    if ((l & 1) != 0) {
      f2 = Math.min(f2, 0.9375F);
      f5 = 1.0F;
      f = 0.0F;
      f3 = 1.0F;
      f1 = 0.0F;
      f4 = 1.0F;
      flag = true;
    }

    if (!flag && this.c(iblockaccess.getTypeId(i, j + 1, k))) {
      f1 = Math.min(f1, 0.9375F);
      f4 = 1.0F;
      f = 0.0F;
      f3 = 1.0F;
      f2 = 0.0F;
      f5 = 1.0F;
    }

    this.a(f, f1, f2, f3, f4, f5);
  }
예제 #16
0
 public void a(IBlockAccess iblockaccess, int i, int j, int k) {
   this.c(this.d(iblockaccess.getData(i, j, k)));
 }