Esempio n. 1
0
  private void digAroundDiamonds() {
    for (double z = this.herobrine.getZ() + 1.0D; z < this.herobrine.getZ() + 3.0D; z += 1.0D) {
      for (double x = this.herobrine.getX(); x >= this.herobrine.getX() - 4.0D; x -= 1.0D) {
        if (herobrine
                .getWorld()
                .getBlockIdAt(
                    (int) Math.floor(x),
                    (int) Math.floor(this.herobrine.getY()),
                    (int) Math.floor(z))
            != 56) {
          digBlock(x, this.herobrine.getY(), z);
        }
        if (herobrine
                .getWorld()
                .getBlockIdAt(
                    (int) Math.floor(x),
                    (int) Math.floor(this.herobrine.getY() + 1.0D),
                    (int) Math.floor(z))
            == 56) {
          continue;
        }
        digBlock(x, this.herobrine.getY() + 1.0D, z);
      }
    }

    this.herobrine.teleportTo(
        this.herobrine.getX() - 4.0D,
        Math.floor(this.herobrine.getY()),
        this.herobrine.getZ() + 2.0D,
        this.herobrine.getRotation(),
        this.herobrine.getPitch());

    this.waiting = true;
  }
Esempio n. 2
0
 private void digBlock(double x, double y, double z) {
   this.blocks.offer(
       herobrine
           .getWorld()
           .getBlockAt((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z)));
   herobrine
       .getWorld()
       .setBlockAt(0, (int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
 }
Esempio n. 3
0
 private void digBlocksWithLadder(double x, double y, double z) {
   this.blocks.offer(
       herobrine
           .getWorld()
           .getBlockAt((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z)));
   herobrine
       .getWorld()
       .setBlockAt(0, (int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
   placeLadderAndTorch((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
 }
Esempio n. 4
0
 private void placeLadderAndTorch(int x, int y, int z) {
   if (this.placeables.contains(Integer.valueOf(herobrine.getWorld().getBlockIdAt(x - 1, y, z)))) {
     if (this.ladder) {
       Block ladder = new Block(65, x, y, z, 5);
       herobrine.getWorld().setBlock(ladder);
     } else {
       if (this.torch) {
         Block torch = new Block(76, x, y, z, 1);
         herobrine.getWorld().setBlock(torch);
       }
       this.torch = !this.torch;
     }
     this.ladder = !this.ladder;
   }
 }
Esempio n. 5
0
  public void moveHerobrine() {
    double x = this.herobrine.getX();
    double z = this.herobrine.getZ();
    double y = this.herobrine.getY() - 1.0D;

    while (iLoveYou.blockIsAboveAir(herobrine.getWorld(), x, y, z)) {
      placeLadderAndTorch((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
      y -= 1.0D;
    }

    if (Math.floor(y) <= this.yDiamonds) {
      digAroundDiamonds();
      return;
    }

    digBlocksWithLadder(x, y, z);

    double d1 = x - this.player.getX();
    double d2 = z - this.player.getZ();
    double d3 = Math.toDegrees(Math.atan(Math.abs(d1 / d2)));
    double d4 =
        Math.asin(
                (y - this.player.getY())
                    / iLoveYou.distance(this.player.getLocation(), new Location(x, y, z)))
            * 45.0D;
    if (d1 >= 0.0D) {
      if (d2 >= 0.0D) {
        d3 = 180.0D - d3;
      }
    } else if (d2 >= 0.0D) {
      d3 += 180.0D;
    } else {
      d3 = 360.0D - d3;
    }
    d3 += 180.0D;

    this.herobrine.teleportTo(x, y, z, (float) d3, (float) d4);
  }
Esempio n. 6
0
 public void restoreBlocks() {
   while (this.blocks.size() > 0) {
     Block block = this.blocks.removeFirst();
     herobrine.getWorld().setBlock(block);
   }
 }