if (teamSpawn.getYaw() >= 0) {
yaw = (int) (teamSpawn.getYaw() % 360);
} else {
yaw = (int) (360 + (teamSpawn.getYaw() % 360));
}
Block signBlock = null;
BlockFace signDirection = null;
if (style.equals(TeamSpawnStyle.SMALL)) {
// SMALL style
if (yaw >= 0 && yaw < 90) {
signDirection = BlockFace.SOUTH_WEST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.NORTH()).getRelative(Direction.WEST());
} else if (yaw >= 90 && yaw <= 180) {
signDirection = BlockFace.NORTH_WEST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.NORTH()).getRelative(Direction.EAST());
} else if (yaw >= 180 && yaw < 270) {
signDirection = BlockFace.NORTH_EAST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.SOUTH()).getRelative(Direction.EAST());
} else if (yaw >= 270 && yaw <= 360) {
signDirection = BlockFace.SOUTH_EAST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.SOUTH()).getRelative(Direction.WEST());
}
} else if (!style.equals(TeamSpawnStyle.INVISIBLE)) {
// outer ring (FLAT or BIG)
this.setBlock(x + 2, y - 1, z + 2, this.kind);
this.setBlock(x + 2, y - 1, z + 1, this.kind);
this.setBlock(x + 2, y - 1, z, this.kind);
this.setBlock(x + 2, y - 1, z - 1, this.kind);
this.setBlock(x + 2, y - 1, z - 2, this.kind);
this.setBlock(x - 1, y - 1, z + 2, this.kind);
this.setBlock(x - 1, y - 1, z - 2, this.kind);
this.setBlock(x, y - 1, z + 2, this.kind);
this.setBlock(x, y - 1, z - 2, this.kind);
this.setBlock(x + 1, y - 1, z + 2, this.kind);
this.setBlock(x + 1, y - 1, z - 2, this.kind);
this.setBlock(x - 2, y - 1, z + 2, this.kind);
this.setBlock(x - 2, y - 1, z + 1, this.kind);
this.setBlock(x - 2, y - 1, z, this.kind);
this.setBlock(x - 2, y - 1, z - 1, this.kind);
this.setBlock(x - 2, y - 1, z - 2, this.kind);
if (yaw >= 0 && yaw < 90) {
signDirection = BlockFace.SOUTH_WEST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.NORTH(), 2).getRelative(Direction.WEST(), 2);
if (style.equals(TeamSpawnStyle.BIG)) {
// rim
this.setBlock(x - 2, y, z - 1, this.kind);
this.setBlock(x - 2, y, z - 2, this.kind);
this.setBlock(x - 1, y, z - 2, this.kind);
this.setBlock(x, y, z - 2, this.kind);
this.setBlock(x + 1, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 1, this.kind);
this.setBlock(x + 2, y, z, this.kind);
this.setBlock(x + 2, y, z + 1, this.kind);
this.setBlock(x + 2, y, z + 2, this.kind);
this.setBlock(x + 1, y, z + 2, this.kind);
// tower
this.setBlock(x, y + 1, z - 2, this.kind);
this.setBlock(x + 1, y + 1, z - 2, this.kind);
this.setBlock(x + 2, y + 1, z - 2, this.kind);
this.setBlock(x + 2, y + 1, z - 1, this.kind);
this.setBlock(x + 2, y + 1, z, this.kind);
this.setBlock(x + 1, y + 2, z - 2, this.kind);
this.setBlock(x + 2, y + 2, z - 2, this.kind);
this.setBlock(x + 2, y + 2, z - 1, this.kind);
this.setBlock(x + 2, y + 3, z - 2, this.kind);
}
} else if (yaw >= 90 && yaw <= 180) {
signDirection = BlockFace.NORTH_WEST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.NORTH(), 2).getRelative(Direction.EAST(), 2);
if (style.equals(TeamSpawnStyle.BIG)) {
// rim
this.setBlock(x + 1, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 1, this.kind);
this.setBlock(x + 2, y, z, this.kind);
this.setBlock(x + 2, y, z + 1, this.kind);
this.setBlock(x + 2, y, z + 2, this.kind);
this.setBlock(x + 1, y, z + 2, this.kind);
this.setBlock(x, y, z + 2, this.kind);
this.setBlock(x - 1, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 1, this.kind);
// tower
this.setBlock(x + 2, y + 1, z, this.kind);
this.setBlock(x + 2, y + 1, z + 1, this.kind);
this.setBlock(x + 2, y + 1, z + 2, this.kind);
this.setBlock(x + 1, y + 1, z + 2, this.kind);
this.setBlock(x, y + 1, z + 2, this.kind);
this.setBlock(x + 2, y + 2, z + 1, this.kind);
this.setBlock(x + 2, y + 2, z + 2, this.kind);
this.setBlock(x + 1, y + 2, z + 2, this.kind);
this.setBlock(x + 2, y + 3, z + 2, this.kind);
}
} else if (yaw >= 180 && yaw < 270) {
signDirection = BlockFace.NORTH_EAST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.SOUTH(), 2).getRelative(Direction.EAST(), 2);
if (style.equals(TeamSpawnStyle.BIG)) {
// rim
this.setBlock(x + 2, y, z + 1, this.kind);
this.setBlock(x + 2, y, z + 2, this.kind);
this.setBlock(x + 1, y, z + 2, this.kind);
this.setBlock(x, y, z + 2, this.kind);
this.setBlock(x - 1, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 1, this.kind);
this.setBlock(x - 2, y, z, this.kind);
this.setBlock(x - 2, y, z - 1, this.kind);
this.setBlock(x - 2, y, z - 2, this.kind);
this.setBlock(x - 1, y, z - 2, this.kind);
// tower
this.setBlock(x, y + 1, z + 2, this.kind);
this.setBlock(x - 1, y + 1, z + 2, this.kind);
this.setBlock(x - 2, y + 1, z + 2, this.kind);
this.setBlock(x - 2, y + 1, z + 1, this.kind);
this.setBlock(x - 2, y + 1, z, this.kind);
this.setBlock(x - 1, y + 2, z + 2, this.kind);
this.setBlock(x - 2, y + 2, z + 2, this.kind);
this.setBlock(x - 2, y + 2, z + 1, this.kind);
this.setBlock(x - 2, y + 3, z + 2, this.kind);
}
} else if (yaw >= 270 && yaw <= 360) {
signDirection = BlockFace.SOUTH_EAST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.SOUTH(), 2).getRelative(Direction.WEST(), 2);
if (style.equals(TeamSpawnStyle.BIG)) {
// rim
this.setBlock(x - 1, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 2, this.kind);
this.setBlock(x - 2, y, z + 1, this.kind);
this.setBlock(x - 2, y, z, this.kind);
this.setBlock(x - 2, y, z - 1, this.kind);
this.setBlock(x - 2, y, z - 2, this.kind);
this.setBlock(x - 1, y, z - 2, this.kind);
this.setBlock(x, y, z - 2, this.kind);
this.setBlock(x + 1, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 2, this.kind);
this.setBlock(x + 2, y, z - 1, this.kind);
// tower
this.setBlock(x - 2, y + 1, z, this.kind);
this.setBlock(x - 2, y + 1, z - 1, this.kind);
this.setBlock(x - 2, y + 1, z - 2, this.kind);
this.setBlock(x - 1, y + 1, z - 2, this.kind);
this.setBlock(x, y + 1, z - 2, this.kind);
this.setBlock(x - 2, y + 2, z - 1, this.kind);
this.setBlock(x - 2, y + 2, z - 2, this.kind);
this.setBlock(x - 1, y + 2, z - 2, this.kind);
this.setBlock(x - 2, y + 3, z - 2, this.kind);
}
}
}
if (signBlock != null) {
String[] lines;
if (this.getTeamConfig().resolveInt(TeamConfig.LIFEPOOL) == -1) {
lines = MessageFormat
.format(War.war.getString("sign.team.unlimited"),
this.name,
this.players.size(),
this.getTeamConfig().resolveInt(
TeamConfig.TEAMSIZE),
this.points,
this.getTeamConfig().resolveInt(
TeamConfig.MAXSCORE)).split("\n");
} else {
lines = MessageFormat
.format(War.war.getString("sign.team.limited"),
this.name,
this.players.size(),
this.getTeamConfig().resolveInt(
TeamConfig.TEAMSIZE),
this.points,
this.getTeamConfig().resolveInt(
TeamConfig.MAXSCORE),
this.remainingLives,
this.getTeamConfig().resolveInt(
TeamConfig.LIFEPOOL)).split("\n");
}
signBlock.setType(Material.SIGN_POST);
org.bukkit.block.Sign block = (org.bukkit.block.Sign) signBlock
.getState();
org.bukkit.material.Sign data = (Sign) block.getData();
data.setFacingDirection(signDirection);
block.setData(data);
for (int i = 0; i < 4; i++) {