A switch is more nice here

This commit is contained in:
Tim Düsterhus 2011-08-14 13:06:35 +02:00
parent ae13d93da1
commit e9f56967cb

View File

@ -5,7 +5,6 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level; import java.util.logging.Level;
import org.bukkit.block.BlockFace;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import bukkit.tommytony.war.War; import bukkit.tommytony.war.War;
@ -273,14 +272,20 @@ public class WarMapper {
WarHub hub = War.war.getWarHub(); WarHub hub = War.war.getWarHub();
if (hub != null) { if (hub != null) {
String orientationStr = ""; String orientationStr = "";
if (BlockFace.SOUTH == hub.getOrientation()) { switch (hub.getOrientation()) {
case SOUTH:
orientationStr = "south"; orientationStr = "south";
} else if (BlockFace.EAST == hub.getOrientation()) { break;
case EAST:
orientationStr = "east"; orientationStr = "east";
} else if (BlockFace.NORTH == hub.getOrientation()) { break;
case NORTH:
orientationStr = "north"; orientationStr = "north";
} else { break;
case WEST:
default:
orientationStr = "west"; orientationStr = "west";
break;
} }
hubStr = hub.getLocation().getBlockX() + "," + hub.getLocation().getBlockY() + "," + hub.getLocation().getBlockZ() + "," hubStr = hub.getLocation().getBlockX() + "," + hub.getLocation().getBlockY() + "," + hub.getLocation().getBlockZ() + ","
+ hub.getLocation().getWorld().getName() + "," + orientationStr; + hub.getLocation().getWorld().getName() + "," + orientationStr;