mirror of
https://github.com/taoneill/war.git
synced 2024-11-13 05:54:31 +01:00
Changed all gate signs to be wall signs instead of sign posts.
- Also, now highlighting active warzones with a redstone torch on its warhub gate
This commit is contained in:
parent
b17e38cfd2
commit
0e481bb5d5
@ -297,6 +297,8 @@ public class WarPlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
latestLocations.put(player.getName(), playerLoc);
|
||||
|
||||
// Signs can automatically teleport you to specific or random warzones
|
||||
if (playerLoc.getBlock().getType() == Material.SIGN_POST) {
|
||||
Sign sign = (Sign) playerLoc.getBlock().getState();
|
||||
if (sign.getLine(0).equals("[zone]")) {
|
||||
@ -319,6 +321,7 @@ public class WarPlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Warzone locZone = Warzone.getZoneByLocation(playerLoc);
|
||||
ZoneLobby locLobby = ZoneLobby.getLobbyByLocation(playerLoc);
|
||||
|
||||
|
@ -258,8 +258,8 @@ public class WarHub {
|
||||
|
||||
Block zoneGate = this.zoneGateBlocks.get(zone.getName());
|
||||
if (zoneGate != null) {
|
||||
zoneGate.getRelative(left).getRelative(back, 1).setType(Material.SIGN_POST);
|
||||
org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneGate.getRelative(left).getRelative(back, 1).getState();
|
||||
zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).setType(Material.WALL_SIGN);
|
||||
org.bukkit.block.Sign block = (org.bukkit.block.Sign) zoneGate.getRelative(BlockFace.UP, 2).getRelative(back, 1).getState();
|
||||
org.bukkit.material.Sign data = (Sign) block.getData();
|
||||
data.setFacingDirection(this.getOrientation().getOppositeFace());
|
||||
block.setData(data);
|
||||
@ -277,6 +277,11 @@ public class WarHub {
|
||||
block.setLine(i, lines[i]);
|
||||
}
|
||||
block.update(true);
|
||||
|
||||
if (zonePlayers > 0) {
|
||||
// add redstone torch to gate if there are players in it (to highlight active zones)
|
||||
zoneGate.getRelative(BlockFace.UP, 1).getRelative(left).getRelative(back, 1).setType(Material.REDSTONE_TORCH_ON);
|
||||
}
|
||||
} else {
|
||||
War.war.log("Failed to find warhub gate for " + zone.getName() + " warzone.", Level.WARNING);
|
||||
}
|
||||
|
@ -760,17 +760,18 @@ public class ZoneLobby {
|
||||
} else if (this.wall == Direction.WEST()) {
|
||||
direction = Direction.EAST();
|
||||
}
|
||||
|
||||
if (this.wall == Direction.NORTH()) {
|
||||
block = gate.getRelative(direction).getRelative(Direction.EAST());
|
||||
block = gate.getRelative(direction).getRelative(BlockFace.UP, 2);
|
||||
} else if (this.wall == Direction.EAST()) {
|
||||
block = gate.getRelative(direction).getRelative(Direction.SOUTH());
|
||||
block = gate.getRelative(direction).getRelative(BlockFace.UP, 2);
|
||||
} else if (this.wall == Direction.SOUTH()) {
|
||||
block = gate.getRelative(direction).getRelative(Direction.WEST());
|
||||
block = gate.getRelative(direction).getRelative(BlockFace.UP, 2);
|
||||
} else if (this.wall == Direction.WEST()) {
|
||||
block = gate.getRelative(direction).getRelative(Direction.NORTH());
|
||||
block = gate.getRelative(direction).getRelative(BlockFace.UP, 2);
|
||||
}
|
||||
|
||||
block.setType(Material.SIGN_POST);
|
||||
block.setType(Material.WALL_SIGN);
|
||||
org.bukkit.block.Sign state = (org.bukkit.block.Sign) block.getState();
|
||||
org.bukkit.material.Sign data = (Sign) state.getData();
|
||||
data.setFacingDirection(direction);
|
||||
|
Loading…
Reference in New Issue
Block a user