mirror of
https://github.com/taoneill/war.git
synced 2024-11-24 03:05:54 +01:00
Found that damn gates bug oh yeah.
This commit is contained in:
parent
c9680d7556
commit
8bafd9f372
@ -600,7 +600,7 @@ public class WarPlayerListener extends PlayerListener {
|
||||
}
|
||||
}
|
||||
|
||||
Warzone playerWarzone = war.getPlayerWarzone(player.getName());
|
||||
Warzone playerWarzone = war.getPlayerWarzone(player.getName()); // this uses the teams, so it asks: get the player's team's warzone, to be clearer
|
||||
if(playerWarzone != null) {
|
||||
Team team = war.getPlayerTeam(player.getName());
|
||||
|
||||
@ -632,7 +632,7 @@ public class WarPlayerListener extends PlayerListener {
|
||||
}
|
||||
}
|
||||
synchronized(player) {
|
||||
if(!roundOver && war.warzone(player.getLocation()) == null) { // only respawn him if he isnt back at zone yet
|
||||
if(!roundOver && !war.inAnyWarzone(player.getLocation())) { // only respawn him if he isnt back at zone yet
|
||||
playerWarzone.respawnPlayer(event, team, player);
|
||||
player.sendMessage(war.str("You died!"));
|
||||
team.resetSign();
|
||||
@ -651,6 +651,10 @@ public class WarPlayerListener extends PlayerListener {
|
||||
player.setHealth(20);
|
||||
player.sendMessage(war.str("Your dance pleases the monument's voodoo. You gain full health!"));
|
||||
}
|
||||
} else if (war.inAnyWarzone(player.getLocation())) { // player is not in any team, but inside warzone boundaries, get him out
|
||||
Warzone zone = war.warzone(player.getLocation());
|
||||
event.setTo(zone.getTeleport());
|
||||
player.sendMessage(war.str("You can't be inside a warzone without a team."));
|
||||
}
|
||||
|
||||
if(to != null) {
|
||||
|
@ -649,14 +649,14 @@ public class Warzone {
|
||||
if(guard.getPlayer().getName().equals(player.getName())){
|
||||
playerGuards.add(guard);
|
||||
int reset = volume.resetWallBlocks(guard.getWall()); // this should restore old blocks
|
||||
if(drawZoneOutline) {
|
||||
addZoneOutline(guard.getWall());
|
||||
}
|
||||
if(lobby != null) {
|
||||
lobby.getVolume().resetBlocks(); // always reset the lobby even if the guard is on another wall
|
||||
// because player can go around corner
|
||||
lobby.initialize();
|
||||
}
|
||||
if(drawZoneOutline) {
|
||||
addZoneOutline(guard.getWall());
|
||||
}
|
||||
war.getLogger().info("Reset " + reset + " blocks in " + guard.getWall() + "wall of warzone " + name);
|
||||
}
|
||||
}
|
||||
|
@ -370,6 +370,7 @@ public class ZoneLobby {
|
||||
}
|
||||
|
||||
private boolean isPartOfGate(Block gateBlock, Block block) {
|
||||
if(gateBlock != null) {
|
||||
BlockFace leftSide = null; // look at the zone
|
||||
BlockFace rightSide = null;
|
||||
if(wall == BlockFace.North) {
|
||||
@ -421,6 +422,8 @@ public class ZoneLobby {
|
||||
&& block.getY() == gateBlock.getFace(rightSide).getY()
|
||||
&& block.getZ() == gateBlock.getFace(rightSide).getZ());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Warzone getZone() {
|
||||
return this.warzone;
|
||||
|
@ -39,9 +39,9 @@ public class ZoneWallGuard {
|
||||
|
||||
// add wall guard blocks
|
||||
for(Block block : nearestWallBlocks) {
|
||||
block.setType(Material.GLASS);
|
||||
block.getFace(BlockFace.Up).setType(Material.GLASS);
|
||||
block.getFace(BlockFace.Down).setType(Material.GLASS);
|
||||
toGlass(block, wall);
|
||||
toGlass(block.getFace(BlockFace.Up), wall);
|
||||
toGlass(block.getFace(BlockFace.Down), wall);
|
||||
if(this.wall == BlockFace.North && warzone.getVolume().isNorthWallBlock(block)) {
|
||||
toGlass(block.getFace(BlockFace.East), BlockFace.North);
|
||||
toGlass(block.getFace(BlockFace.East).getFace(BlockFace.Up), BlockFace.North);
|
||||
|
Loading…
Reference in New Issue
Block a user