Fixed rotating warhub at restart after /warcfg.

Stops the warhub from rotating upon restart after a call to /warcfg -
sorry for the mess.  Still have to convert config files and fix
commands.
This commit is contained in:
taoneill 2013-01-10 22:29:26 -05:00
parent 0245476130
commit bff034a299
2 changed files with 10 additions and 5 deletions

View File

@ -17,6 +17,7 @@ import com.tommytony.war.Warzone;
import com.tommytony.war.job.RestoreYmlWarhubJob; import com.tommytony.war.job.RestoreYmlWarhubJob;
import com.tommytony.war.job.RestoreYmlWarzonesJob; import com.tommytony.war.job.RestoreYmlWarzonesJob;
import com.tommytony.war.structure.WarHub; import com.tommytony.war.structure.WarHub;
import com.tommytony.war.utility.Direction;
public class WarYmlMapper { public class WarYmlMapper {
@ -147,17 +148,21 @@ public class WarYmlMapper {
String orientationStr = ""; String orientationStr = "";
switch (hub.getOrientation()) { switch (hub.getOrientation()) {
case SOUTH: case SOUTH:
orientationStr = "south"; if (Direction.isLegacy) orientationStr = "south";
else orientationStr = "west"; // temp fix for rotating warhub
break; break;
case EAST: case EAST:
orientationStr = "east"; if (Direction.isLegacy) orientationStr = "east";
else orientationStr = "south";
break; break;
case NORTH: case NORTH:
orientationStr = "north"; if (Direction.isLegacy) orientationStr = "north";
else orientationStr = "east";
break; break;
case WEST: case WEST:
default: default:
orientationStr = "west"; if (Direction.isLegacy) orientationStr = "west";
else orientationStr = "north";
break; break;
} }

View File

@ -4,7 +4,7 @@ import org.bukkit.block.BlockFace;
public class Direction { public class Direction {
private static boolean isLegacy = BlockFace.NORTH.getModX() == -1; public final static boolean isLegacy = BlockFace.NORTH.getModX() == -1;
public static BlockFace NORTH() { public static BlockFace NORTH() {
if (!isLegacy) { if (!isLegacy) {