Add first pass of Factions support
This commit is contained in:
parent
cfc758fe7d
commit
f4de63e85e
5 changed files with 364 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import org.dynmap.web.Json;
|
|||
public class RegionsComponent extends ClientComponent {
|
||||
|
||||
private TownyConfigHandler towny;
|
||||
private FactionsConfigHandler factions;
|
||||
private String regiontype;
|
||||
|
||||
public RegionsComponent(final DynmapPlugin plugin, final ConfigurationNode configuration) {
|
||||
|
|
@ -37,6 +38,11 @@ public class RegionsComponent extends ClientComponent {
|
|||
towny = new TownyConfigHandler(configuration);
|
||||
plugin.webServer.handlers.put("/standalone/towny_*", new RegionHandler(configuration));
|
||||
}
|
||||
/* Load special handler for Factions */
|
||||
else if(regiontype.equals("Factions")) {
|
||||
factions = new FactionsConfigHandler(configuration);
|
||||
plugin.webServer.handlers.put("/standalone/factions_*", new RegionHandler(configuration));
|
||||
}
|
||||
else {
|
||||
plugin.webServer.handlers.put("/standalone/" + fname.substring(0, fname.lastIndexOf('.')) + "_*", new RegionHandler(configuration));
|
||||
|
||||
|
|
@ -75,6 +81,11 @@ public class RegionsComponent extends ClientComponent {
|
|||
outputFileName = "towny_" + wname + ".json";
|
||||
webWorldPath = new File(plugin.getWebPath()+"/standalone/", outputFileName);
|
||||
}
|
||||
else if(regiontype.equals("Factions")) {
|
||||
regionData = factions.getRegionData(wname);
|
||||
outputFileName = "factions_" + wname + ".json";
|
||||
webWorldPath = new File(plugin.getWebPath()+"/standalone/", outputFileName);
|
||||
}
|
||||
else {
|
||||
if(configuration.getBoolean("useworldpath", false))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue