// whitelisted commands during a game
warInfoSection.set("commandwhitelist", War.war.getCommandWhitelist());
// warhub
WarHub hub = War.war.getWarHub();
if (hub != null) {
String orientationStr = "";
switch (hub.getOrientation()) {
case SOUTH:
if (Direction.isLegacy) orientationStr = "south";
else orientationStr = "west"; // temp fix for rotating warhub
break;
case EAST:
if (Direction.isLegacy) orientationStr = "east";
else orientationStr = "south";
break;
case NORTH:
if (Direction.isLegacy) orientationStr = "north";
else orientationStr = "east";
break;
case WEST:
default:
if (Direction.isLegacy) orientationStr = "west";
else orientationStr = "north";
break;
}
ConfigurationSection hubConfigSection = warInfoSection.createSection("warhub");
hubConfigSection.set("x", hub.getLocation().getBlockX());
hubConfigSection.set("y", hub.getLocation().getBlockY());
hubConfigSection.set("z", hub.getLocation().getBlockZ());
hubConfigSection.set("world", hub.getLocation().getWorld().getName());
hubConfigSection.set("orientation", orientationStr);
hubConfigSection.set("materials.floor", War.war.getWarhubMaterials().getFloorBlock());
hubConfigSection.set("materials.outline", War.war.getWarhubMaterials().getOutlineBlock());
hubConfigSection.set("materials.gate", War.war.getWarhubMaterials().getGateBlock());
hubConfigSection.set("materials.light", War.war.getWarhubMaterials().getLightBlock());
try {
VolumeMapper.save(hub.getVolume(), "");
} catch (SQLException e) {
// who really even cares
War.war.getLogger().log(Level.WARNING, "Failed to save warhub volume blocks", e);
}
}