Esempio n. 1
0
  public Location getExit(Location traveller) {
    Location loc = null;
    // Check if the gate has an exit block
    if (gate.getExit() != null) {
      Blox exit = getBlockAt(gate.getExit());
      int back = (isBackwards()) ? -1 : 1;
      loc =
          exit.modRelativeLoc(
              0D, 0D, 1D, traveller.getYaw(), traveller.getPitch(), modX * back, 1, modZ * back);
    } else {
      Stargate.log.log(
          Level.WARNING,
          "[Stargate] Missing destination point in .gate file " + gate.getFilename());
    }
    if (loc != null) {

      if (getWorld().getBlockTypeIdAt(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())
          == Material.STEP.getId()) {
        loc.setY(loc.getY() + 0.5);
      }

      loc.setPitch(traveller.getPitch());
      return loc;
    }
    return traveller;
  }