Examples of Volume


Examples of com.tommytony.war.volume.Volume

    this.setLocation(location);
  }

  public void addCakeBlocks() {
    // 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() + 2,
            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

  public boolean isOpponentSpawnPeripheryBlock(Team team, Block block) {
    for (Team maybeOpponent : this.getTeams()) {
      if (maybeOpponent != team) {
        for (Volume teamSpawnVolume : maybeOpponent.getSpawnVolumes().values()) {
          Volume periphery = new Volume(new Location(
              teamSpawnVolume.getWorld(),
              teamSpawnVolume.getMinX() - 1,
              teamSpawnVolume.getMinY() - 1,
              teamSpawnVolume.getMinZ() - 1), new Location(
              teamSpawnVolume.getWorld(),
              teamSpawnVolume.getMaxX() + 1,
              teamSpawnVolume.getMaxY() + 1,
              teamSpawnVolume.getMaxZ() + 1));
          if (periphery.contains(block)) {
            return true;
          }
        }
      }
    }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

  public Volume loadStructure(String volName, Connection zoneConnection) throws SQLException {
    return loadStructure(volName, world, zoneConnection);
  }

  public Volume loadStructure(String volName, World world, Connection zoneConnection) throws SQLException {
    Volume volume = new Volume(volName, world);
    if (!containsTable(String.format("structure_%d_corners", volName.hashCode() & Integer.MAX_VALUE), zoneConnection)) {
      volume = VolumeMapper.loadVolume(volName, name, world);
      ZoneVolumeMapper.saveStructure(volume, zoneConnection);
      War.war.getLogger().log(Level.INFO, "Stuffed structure {0} into database for warzone {1}", new Object[] {volName, name});
      return volume;
View Full Code Here

Examples of com.tommytony.war.volume.Volume

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

Examples of com.tommytony.war.volume.Volume

    this.setLocation(location);
  }

  public void addMonumentBlocks() {
    // make air (old three-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);

    this.ownerTeam = null;
    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

    World world = War.war.getServer().getWorld(worldName);
    if (world != null) {
      Location hubLocation = new Location(world, hubX, hubY, hubZ);
      WarHub hub = new WarHub(hubLocation, hubOrientation);
      War.war.setWarHub(hub);
      Volume vol;
      try {
        vol = VolumeMapper.loadVolume("warhub", "", world);
      } catch (SQLException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    }
    if (world != null) {
      Location hubLocation = new Location(world, hubX, hubY, hubZ);
      WarHub hub = new WarHub(hubLocation, hubOrientation);
      War.war.setWarHub(hub);
      Volume vol;
      try {
        vol = VolumeMapper.loadVolume("warhub", "", world);
      } catch (SQLException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

    this.location = new Location(location.getWorld(),
                location.getX(),
                location.getY(),
                location.getZ(),
                yaw, 0);
    this.volume = new Volume("warhub", location.getWorld());
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

  }

  // Use when creating from player location (with yaw)
  public WarHub(Location location) {
    this.location = location;
    this.volume = new Volume("warhub", location.getWorld());

    this.setLocation(location);
  }
View Full Code Here

Examples of com.tommytony.war.volume.Volume

        // If air, leave original blocks.
        this.volume.setFloorOutline(War.war.getWarhubMaterials().getOutlineBlock());
      }
     
      // clear minimal path around warhub tp
      Volume warhubTpVolume = new Volume("warhubtp", this.location.getWorld());
      warhubTpVolume.setCornerOne(locationBlock.getRelative(back).getRelative(left));
      warhubTpVolume.setCornerTwo(locationBlock.getRelative(front, 2).getRelative(right).getRelative(BlockFace.UP));
      warhubTpVolume.setToMaterial(Material.AIR);
   
      // draw gates
      Block currentGateBlock = this.volume.getCornerOne().getBlock().getRelative(BlockFace.UP).getRelative(front, hubDepth).getRelative(right, 2);

      for (Warzone zone : War.war.getWarzones()) { // gonna use the index to find it again
        if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED)) {
          this.zoneGateBlocks.put(zone.getName(), currentGateBlock);
         
          // minimal air path
          Volume gateAirVolume = new Volume("gateAir", currentGateBlock.getWorld());
          gateAirVolume.setCornerOne(currentGateBlock.getRelative(right));
          gateAirVolume.setCornerTwo(currentGateBlock.getRelative(left).getRelative(back, 2).getRelative(BlockFace.UP, 2));
          gateAirVolume.setToMaterial(Material.AIR);
         
          currentGateBlock.getRelative(back, 2).getRelative(right, 2).setType(Material.AIR);
          currentGateBlock.getRelative(back, 2).getRelative(right, 2).getRelative(BlockFace.UP).setType(Material.AIR);
          currentGateBlock.getRelative(back, 2).getRelative(right, 2).getRelative(BlockFace.UP, 2).setType(Material.AIR);
          currentGateBlock.getRelative(back, 2).getRelative(left, 2).setType(Material.AIR);
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.