mirror of
https://github.com/taoneill/war.git
synced 2024-11-24 03:05:54 +01:00
Added warzone signs. Tryign to line up lobby teleport but ohwell.
This commit is contained in:
parent
d24709bbd6
commit
ccedb36138
@ -172,7 +172,44 @@ public class ZoneLobby {
|
|||||||
|
|
||||||
// set zone tp
|
// set zone tp
|
||||||
zoneTeleportBlock = lobbyMiddleWallBlock.getFace(wall, 6);
|
zoneTeleportBlock = lobbyMiddleWallBlock.getFace(wall, 6);
|
||||||
warzone.setTeleport(new Location(warzone.getWorld(), zoneTeleportBlock.getX(), zoneTeleportBlock.getY(), zoneTeleportBlock.getZ()));
|
int yaw = 0;
|
||||||
|
if(wall == BlockFace.WEST) {
|
||||||
|
yaw = 180;
|
||||||
|
} else if (wall == BlockFace.SOUTH) {
|
||||||
|
yaw = 90;
|
||||||
|
} else if (wall == BlockFace.EAST) {
|
||||||
|
yaw = 0;
|
||||||
|
} else if (wall == BlockFace.NORTH) {
|
||||||
|
yaw = 270;
|
||||||
|
}
|
||||||
|
warzone.setTeleport(new Location(warzone.getWorld(), zoneTeleportBlock.getX(), zoneTeleportBlock.getY(), zoneTeleportBlock.getZ(), yaw, 0));
|
||||||
|
|
||||||
|
// set zone sign
|
||||||
|
Block zoneSignBlock = lobbyMiddleWallBlock.getFace(wall, 4);
|
||||||
|
zoneSignBlock.setType(Material.SIGN_POST);
|
||||||
|
if(wall == BlockFace.NORTH) {
|
||||||
|
zoneSignBlock.setData((byte)4);
|
||||||
|
} else if(wall == BlockFace.EAST) {
|
||||||
|
zoneSignBlock.setData((byte)8);
|
||||||
|
} else if(wall == BlockFace.SOUTH) {
|
||||||
|
zoneSignBlock.setData((byte)12);
|
||||||
|
} else if(wall == BlockFace.WEST) {
|
||||||
|
zoneSignBlock.setData((byte)0);
|
||||||
|
}
|
||||||
|
BlockState state = zoneSignBlock.getState();
|
||||||
|
if(state instanceof Sign) {
|
||||||
|
Sign sign = (Sign) state;
|
||||||
|
sign.setLine(0, "Warzone");
|
||||||
|
sign.setLine(1, warzone.getName());
|
||||||
|
if(autoAssignGate != null) {
|
||||||
|
sign.setLine(2, "Walk in the");
|
||||||
|
sign.setLine(3, "auto-assign gate.");
|
||||||
|
} else {
|
||||||
|
sign.setLine(2, "");
|
||||||
|
sign.setLine(3, "Pick your team.");
|
||||||
|
}
|
||||||
|
state.update(true);
|
||||||
|
}
|
||||||
|
|
||||||
// lets get some light in here
|
// lets get some light in here
|
||||||
if(wall == BlockFace.NORTH || wall == BlockFace.SOUTH) {
|
if(wall == BlockFace.NORTH || wall == BlockFace.SOUTH) {
|
||||||
@ -209,6 +246,7 @@ public class ZoneLobby {
|
|||||||
ironGate = null;
|
ironGate = null;
|
||||||
goldGate = null;
|
goldGate = null;
|
||||||
} else if(warzone.getTeams().size() == 1) {
|
} else if(warzone.getTeams().size() == 1) {
|
||||||
|
autoAssignGate = null;
|
||||||
if(warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND) != null) {
|
if(warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND) != null) {
|
||||||
diamondGate = lobbyMiddleWallBlock;
|
diamondGate = lobbyMiddleWallBlock;
|
||||||
ironGate = null;
|
ironGate = null;
|
||||||
@ -223,6 +261,7 @@ public class ZoneLobby {
|
|||||||
ironGate = null;
|
ironGate = null;
|
||||||
}
|
}
|
||||||
} else if(warzone.getTeams().size() == 2) {
|
} else if(warzone.getTeams().size() == 2) {
|
||||||
|
autoAssignGate = null;
|
||||||
if(warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND) != null
|
if(warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND) != null
|
||||||
&& warzone.getTeamByMaterial(TeamMaterials.TEAMIRON) != null) {
|
&& warzone.getTeamByMaterial(TeamMaterials.TEAMIRON) != null) {
|
||||||
diamondGate = lobbyMiddleWallBlock.getFace(leftSide, 2);
|
diamondGate = lobbyMiddleWallBlock.getFace(leftSide, 2);
|
||||||
@ -241,6 +280,7 @@ public class ZoneLobby {
|
|||||||
ironGate = null;
|
ironGate = null;
|
||||||
}
|
}
|
||||||
} else if(warzone.getTeams().size() == 3) {
|
} else if(warzone.getTeams().size() == 3) {
|
||||||
|
autoAssignGate = null;
|
||||||
diamondGate = lobbyMiddleWallBlock.getFace(leftSide, 4);
|
diamondGate = lobbyMiddleWallBlock.getFace(leftSide, 4);
|
||||||
ironGate = lobbyMiddleWallBlock;
|
ironGate = lobbyMiddleWallBlock;
|
||||||
goldGate = lobbyMiddleWallBlock.getFace(rightSide, 4);
|
goldGate = lobbyMiddleWallBlock.getFace(rightSide, 4);
|
||||||
@ -300,6 +340,7 @@ public class ZoneLobby {
|
|||||||
Team diamondTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND);
|
Team diamondTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMDIAMOND);
|
||||||
Team ironTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMIRON);
|
Team ironTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMIRON);
|
||||||
Team goldTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMGOLD);
|
Team goldTeam = warzone.getTeamByMaterial(TeamMaterials.TEAMGOLD);
|
||||||
|
autoAssignGate.getFace(BlockFace.DOWN).setType(Material.GLOWSTONE);
|
||||||
autoAssignGate.setType(Material.PORTAL);
|
autoAssignGate.setType(Material.PORTAL);
|
||||||
autoAssignGate.getFace(BlockFace.UP).setType(Material.PORTAL);
|
autoAssignGate.getFace(BlockFace.UP).setType(Material.PORTAL);
|
||||||
if(diamondTeam != null && ironTeam != null && goldTeam != null) {
|
if(diamondTeam != null && ironTeam != null && goldTeam != null) {
|
||||||
|
@ -87,7 +87,8 @@ public class WarzoneMapper {
|
|||||||
int teleX = Integer.parseInt(teleportSplit[0]);
|
int teleX = Integer.parseInt(teleportSplit[0]);
|
||||||
int teleY = Integer.parseInt(teleportSplit[1]);
|
int teleY = Integer.parseInt(teleportSplit[1]);
|
||||||
int teleZ = Integer.parseInt(teleportSplit[2]);
|
int teleZ = Integer.parseInt(teleportSplit[2]);
|
||||||
warzone.setTeleport(new Location(world, teleX, teleY, teleZ));
|
int yaw = Integer.parseInt(teleportSplit[3]);
|
||||||
|
warzone.setTeleport(new Location(world, teleX, teleY, teleZ, yaw, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// teams
|
// teams
|
||||||
@ -237,7 +238,7 @@ public class WarzoneMapper {
|
|||||||
String teleportStr = "";
|
String teleportStr = "";
|
||||||
Location tele = warzone.getTeleport();
|
Location tele = warzone.getTeleport();
|
||||||
if(tele != null) {
|
if(tele != null) {
|
||||||
teleportStr = tele.getBlockX() + "," + tele.getBlockY() + "," + tele.getBlockZ();
|
teleportStr = tele.getBlockX() + "," + tele.getBlockY() + "," + tele.getBlockZ() + "," + (int)tele.getYaw();
|
||||||
}
|
}
|
||||||
warzoneConfig.setString("teleport", teleportStr);
|
warzoneConfig.setString("teleport", teleportStr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user