Examples of Volume


Examples of com.tommytony.war.volume.Volume

  }

  private void createVolumeOrReset(World lobbyWorld) {
    if (this.volume == null) {
      // no previous wall
      this.volume = new Volume("lobby", lobbyWorld);
    } else if (this.volume.isSaved()) {
      this.volume.resetBlocks();
      this.volume.setWorld(lobbyWorld)// set world for the case where where are changing lobby location between worlds 
    }
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

        leftSide = Direction.NORTH();
        rightSide = Direction.SOUTH();
      }
     
      Block clearedPathStartBlock = this.lobbyMiddleWallBlock.getBlock().getRelative(this.wall, 2);
      Volume warzoneTeleportAir = new Volume("warzoneTeleport", clearedPathStartBlock.getWorld());
      warzoneTeleportAir.setCornerOne(clearedPathStartBlock.getRelative(leftSide));
      warzoneTeleportAir.setCornerTwo(clearedPathStartBlock.getRelative(rightSide).getRelative(front, 4).getRelative(BlockFace.UP));
      warzoneTeleportAir.setToMaterial(Material.AIR);
     
      clearedPathStartBlock.setType(Material.AIR);
      clearedPathStartBlock.getRelative(BlockFace.UP).setType(Material.AIR);
      clearedPathStartBlock.getRelative(this.wall).setType(Material.AIR);
      clearedPathStartBlock.getRelative(this.wall).getRelative(BlockFace.UP).setType(Material.AIR);
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    return false;
  }

  private boolean leaving(Location location, Block gate, BlockFace inside, BlockFace left, BlockFace right) {
    // 3x4x1 deep
    Volume gateExitVolume = new Volume("tempGateExit", location.getWorld());
    Block out = gate.getRelative(inside);
    gateExitVolume.setCornerOne(out.getRelative(left).getRelative(BlockFace.DOWN));
    gateExitVolume.setCornerTwo(gate.getRelative(right, 1).getRelative(BlockFace.UP, 2));

    if (gateExitVolume.contains(location)) {
      return true;
    }

    return false;
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    return false;
  }
 
  private void clearGatePath(Block gateBlock, BlockFace awayFromGate, BlockFace left, BlockFace right, boolean clearPathForPlayer) {
    Volume gateAirVolume = new Volume("gateAir", gateBlock.getWorld());
    gateAirVolume.setCornerOne(gateBlock.getRelative(right));
    gateAirVolume.setCornerTwo(gateBlock.getRelative(left).getRelative(awayFromGate, 2).getRelative(BlockFace.UP, 2));
    gateAirVolume.setToMaterial(Material.AIR);
   
    if (clearPathForPlayer) {
      gateBlock.getRelative(awayFromGate, 2).getRelative(right, 2).setType(Material.AIR);
      gateBlock.getRelative(awayFromGate, 2).getRelative(right, 2).getRelative(BlockFace.UP).setType(Material.AIR);
      gateBlock.getRelative(awayFromGate, 2).getRelative(right, 2).getRelative(BlockFace.UP, 2).setType(Material.AIR);
View Full Code Here

Examples of com.tommytony.war.volume.Volume

  public Bomb(String name, Warzone warzone, Location location) {
    this.name = name;
    this.location = location;
    this.warzone = warzone;
    this.volume = new Volume("bomb-" + name, warzone.getWorld());
    this.setLocation(location);
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    this.setLocation(location);
  }

  public void addBombBlocks() {
    // make air (old two-high above floor)
    Volume airGap = new Volume(new Location(this.volume.getWorld(),
        this.volume.getCornerOne().getX(), this.volume.getCornerOne()
            .getY() + 1, this.volume.getCornerOne().getZ()),
        new Location(this.volume.getWorld(), this.volume.getCornerTwo()
            .getX(), this.volume.getCornerOne().getY() + 3,
            this.volume.getCornerTwo().getZ()));
    airGap.setToMaterial(Material.AIR);

    int x = this.location.getBlockX();
    int y = this.location.getBlockY();
    int z = this.location.getBlockZ();
   
View Full Code Here

Examples of com.tommytony.war.volume.Volume

              lobbyWorld = strWorld;
            }
          }
         
          // create the lobby
          Volume lobbyVolume = null;
          try {
            lobbyVolume = VolumeMapper.loadVolume("lobby", warzone.getName(), lobbyWorld);
          } catch (SQLException e) {
            // if the zone is this old is there any reason the lobby should be nimitz format
            War.war.getLogger().log(Level.WARNING, "Failed to load lobby for a really old warzone", e);
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    this.inventories = new InventoryBag(warzone)// important constructors for cascading configs
    this.setName(name);
    this.teamSpawns = new ArrayList<Location>(teamSpawn);
    this.spawnVolumes = new HashMap<Location, Volume>();
    for (Location spawn : teamSpawn) {
      this.setSpawnVolume(spawn, new Volume(name + teamSpawns.indexOf(spawn), warzone.getWorld()));
    }
    this.kind = kind;
    this.setFlagVolume(null); // no flag at the start
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

  public TeamKind getKind() {
    return this.kind;
  }

  private void createSpawnVolume(Location teamSpawn) {
    Volume spawnVolume = this.spawnVolumes.get(teamSpawn);
    if (spawnVolume.isSaved()) {
      spawnVolume.resetBlocks();
    }
    int x = teamSpawn.getBlockX();
    int y = teamSpawn.getBlockY();
    int z = teamSpawn.getBlockZ();

    TeamSpawnStyle style = this.getTeamConfig().resolveSpawnStyle();
    if (style.equals(TeamSpawnStyle.INVISIBLE)) {
      spawnVolume.setCornerOne(this.warzone.getWorld().getBlockAt(x, y - 1, z));
      spawnVolume.setCornerTwo(this.warzone.getWorld().getBlockAt(x, y + 3, z));
    } else if (style.equals(TeamSpawnStyle.SMALL)) {
      spawnVolume.setCornerOne(this.warzone.getWorld().getBlockAt(x - 1, y - 1, z - 1));
      spawnVolume.setCornerTwo(this.warzone.getWorld().getBlockAt(x + 1, y + 3, z + 1));
    } else {
      // flat or big
      spawnVolume.setCornerOne(this.warzone.getWorld().getBlockAt(x - 2, y - 1, z - 2));
      spawnVolume.setCornerTwo(this.warzone.getWorld().getBlockAt(x + 2, y + 3, z + 2));
    }
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

  public void addTeamSpawn(Location teamSpawn) {
    if (!this.teamSpawns.contains(teamSpawn)) {
      this.teamSpawns.add(teamSpawn);
    }
    // this resets the block to old state
    this.setSpawnVolume(teamSpawn, new Volume(name + teamSpawns.indexOf(teamSpawn), warzone.getWorld()));
    this.createSpawnVolume(teamSpawn);
    this.spawnVolumes.get(teamSpawn).saveBlocks();

    this.initializeTeamSpawn(teamSpawn);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.