Example #1
0
  private boolean c(int i, int j, int k) {
    MinecartTrackLogic minecarttracklogic = a(new ChunkPosition(i, j, k));

    if (minecarttracklogic == null) {
      return false;
    } else {
      minecarttracklogic.b();
      return minecarttracklogic.c(this);
    }
  }
Example #2
0
  private void b() {
    for (int i = 0; i < g.size(); i++) {
      MinecartTrackLogic minecarttracklogic = a((ChunkPosition) g.get(i));

      if (minecarttracklogic == null || !minecarttracklogic.b(this)) {
        g.remove(i--);
      } else {
        g.set(
            i,
            ((new ChunkPosition(
                minecarttracklogic.c, minecarttracklogic.d, minecarttracklogic.e))));
      }
    }
  }
Example #3
0
 static int a(MinecartTrackLogic minecarttracklogic) {
   return minecarttracklogic.c();
 }
Example #4
0
  public void a(boolean flag) {
    boolean flag1 = c(c, d, e - 1);
    boolean flag2 = c(c, d, e + 1);
    boolean flag3 = c(c - 1, d, e);
    boolean flag4 = c(c + 1, d, e);
    int i = -1;

    if ((flag1 || flag2) && !flag3 && !flag4) {
      i = 0;
    }
    if ((flag3 || flag4) && !flag1 && !flag2) {
      i = 1;
    }
    if (flag2 && flag4 && !flag1 && !flag3) {
      i = 6;
    }
    if (flag2 && flag3 && !flag1 && !flag4) {
      i = 7;
    }
    if (flag1 && flag3 && !flag2 && !flag4) {
      i = 8;
    }
    if (flag1 && flag4 && !flag2 && !flag3) {
      i = 9;
    }
    if (i == -1) {
      if (flag1 || flag2) {
        i = 0;
      }
      if (flag3 || flag4) {
        i = 1;
      }
      if (flag) {
        if (flag2 && flag4) {
          i = 6;
        }
        if (flag3 && flag2) {
          i = 7;
        }
        if (flag4 && flag1) {
          i = 9;
        }
        if (flag1 && flag3) {
          i = 8;
        }
      } else {
        if (flag1 && flag3) {
          i = 8;
        }
        if (flag4 && flag1) {
          i = 9;
        }
        if (flag3 && flag2) {
          i = 7;
        }
        if (flag2 && flag4) {
          i = 6;
        }
      }
    }
    if (i == 0) {
      if (b.a(c, d + 1, e - 1) == a.bi) {
        i = 4;
      }
      if (b.a(c, d + 1, e + 1) == a.bi) {
        i = 5;
      }
    }
    if (i == 1) {
      if (b.a(c + 1, d + 1, e) == a.bi) {
        i = 2;
      }
      if (b.a(c - 1, d + 1, e) == a.bi) {
        i = 3;
      }
    }
    if (i < 0) {
      i = 0;
    }
    f = i;
    a();
    b.c(c, d, e, i);
    for (int j = 0; j < g.size(); j++) {
      MinecartTrackLogic minecarttracklogic = a((ChunkPosition) g.get(j));

      if (minecarttracklogic == null) {
        continue;
      }
      minecarttracklogic.b();
      if (minecarttracklogic.c(this)) {
        minecarttracklogic.d(this);
      }
    }
  }