示例#1
0
  public void onPlace(World world, int i, int j, int k) {
    if (world.suppressPhysics) return;
    super.onPlace(world, i, j, k);
    if (!world.isStatic) {
      l(world, i, j, k);
      world.applyPhysics(i, j + 1, k, this.id);
      world.applyPhysics(i, j - 1, k, this.id);
      n(world, i - 1, j, k);
      n(world, i + 1, j, k);
      n(world, i, j, k - 1);
      n(world, i, j, k + 1);
      if (world.s(i - 1, j, k)) n(world, i - 1, j + 1, k);
      else {
        n(world, i - 1, j - 1, k);
      }

      if (world.s(i + 1, j, k)) n(world, i + 1, j + 1, k);
      else {
        n(world, i + 1, j - 1, k);
      }

      if (world.s(i, j, k - 1)) n(world, i, j + 1, k - 1);
      else {
        n(world, i, j - 1, k - 1);
      }

      if (world.s(i, j, k + 1)) n(world, i, j + 1, k + 1);
      else n(world, i, j - 1, k + 1);
    }
  }
示例#2
0
 @Override
 public void onPlace(World world, int i, int j, int k) {
   super.onPlace(world, i, j, k);
   if (world.isBlockIndirectlyPowered(i, j, k)) {
     postBreak(world, i, j, k, 1);
     world.setAir(i, j, k);
   }
 }
  public void onPlace(World world, int i, int j, int k) {
    if (world.suppressPhysics) return; // CraftBukkit
    super.onPlace(world, i, j, k);
    if (!world.isStatic) {
      this.l(world, i, j, k);
      world.applyPhysics(i, j + 1, k, this.id);
      world.applyPhysics(i, j - 1, k, this.id);
      this.n(world, i - 1, j, k);
      this.n(world, i + 1, j, k);
      this.n(world, i, j, k - 1);
      this.n(world, i, j, k + 1);
      if (world.t(i - 1, j, k)) {
        this.n(world, i - 1, j + 1, k);
      } else {
        this.n(world, i - 1, j - 1, k);
      }

      if (world.t(i + 1, j, k)) {
        this.n(world, i + 1, j + 1, k);
      } else {
        this.n(world, i + 1, j - 1, k);
      }

      if (world.t(i, j, k - 1)) {
        this.n(world, i, j + 1, k - 1);
      } else {
        this.n(world, i, j - 1, k - 1);
      }

      if (world.t(i, j, k + 1)) {
        this.n(world, i, j + 1, k + 1);
      } else {
        this.n(world, i, j - 1, k + 1);
      }
    }
  }