Example #1
0
  public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
    float f;
    float f1;

    if (iblockaccess.getTypeId(i - 1, j, k) != this.id
        && iblockaccess.getTypeId(i + 1, j, k) != this.id) {
      f = 0.125F;
      f1 = 0.5F;
      this.a(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
    } else {
      f = 0.5F;
      f1 = 0.125F;
      this.a(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
    }
  }
  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)]);
  }
  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 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];
    }
  }
Example #5
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);
  }