mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
ADDED default flags in settings.yml
This commit is contained in:
parent
d71ab93760
commit
c3e271b22b
@ -197,5 +197,12 @@ public class PlotWorld {
|
|||||||
* Default schematic file: 'null'
|
* Default schematic file: 'null'
|
||||||
*/
|
*/
|
||||||
public static String SCHEMATIC_FILE_DEFAULT = "null";
|
public static String SCHEMATIC_FILE_DEFAULT = "null";
|
||||||
|
/**
|
||||||
|
* default flags
|
||||||
|
*/
|
||||||
|
public Flag[] DEFAULT_FLAGS;
|
||||||
|
/**
|
||||||
|
* Default default flags
|
||||||
|
*/
|
||||||
|
public static String[] DEFAULT_FLAGS_DEFAULT = new String[] {};
|
||||||
}
|
}
|
||||||
|
@ -84,9 +84,9 @@ public class WorldGenerator extends ChunkGenerator {
|
|||||||
// options.put("worlds."+world+".road_stripes", ROAD_STRIPES_DEFAULT);
|
// options.put("worlds."+world+".road_stripes", ROAD_STRIPES_DEFAULT);
|
||||||
options.put("worlds."+world+".wall_filling", WALL_FILLING_DEFAULT);
|
options.put("worlds."+world+".wall_filling", WALL_FILLING_DEFAULT);
|
||||||
options.put("worlds."+world+".wall_height", WALL_HEIGHT_DEFAULT);
|
options.put("worlds."+world+".wall_height", WALL_HEIGHT_DEFAULT);
|
||||||
|
|
||||||
options.put("worlds."+world+".schematic_on_claim", SCHEMATIC_ON_CLAIM_DEFAULT);
|
options.put("worlds."+world+".schematic_on_claim", SCHEMATIC_ON_CLAIM_DEFAULT);
|
||||||
options.put("worlds."+world+".schematic_file", SCHEMATIC_FILE_DEFAULT);
|
options.put("worlds."+world+".schematic_file", SCHEMATIC_FILE_DEFAULT);
|
||||||
|
options.put("worlds."+world+".default_flags", DEFAULT_FLAGS_DEFAULT);
|
||||||
|
|
||||||
for (Entry<String, Object> node : options.entrySet()) {
|
for (Entry<String, Object> node : options.entrySet()) {
|
||||||
if (!config.contains(node.getKey())) {
|
if (!config.contains(node.getKey())) {
|
||||||
@ -111,9 +111,20 @@ public class WorldGenerator extends ChunkGenerator {
|
|||||||
plotworld.WALL_FILLING = config.getString("worlds."+world+".wall_filling");
|
plotworld.WALL_FILLING = config.getString("worlds."+world+".wall_filling");
|
||||||
plotworld.WALL_HEIGHT = config.getInt("worlds."+world+".wall_height");
|
plotworld.WALL_HEIGHT = config.getInt("worlds."+world+".wall_height");
|
||||||
plotworld.PLOT_CHAT = config.getBoolean("worlds."+world+".plot_chat");
|
plotworld.PLOT_CHAT = config.getBoolean("worlds."+world+".plot_chat");
|
||||||
|
|
||||||
plotworld.SCHEMATIC_ON_CLAIM = config.getBoolean("worlds."+world+".schematic_on_claim");
|
plotworld.SCHEMATIC_ON_CLAIM = config.getBoolean("worlds."+world+".schematic_on_claim");
|
||||||
plotworld.SCHEMATIC_FILE = config.getString("worlds."+world+".schematic_file");
|
plotworld.SCHEMATIC_FILE = config.getString("worlds."+world+".schematic_file");
|
||||||
|
|
||||||
|
String[] default_flags_string = config.getStringList("worlds."+world+".default_flags").toArray(new String[0]);
|
||||||
|
Flag[] default_flags = new Flag[default_flags_string.length];
|
||||||
|
for (int i = 0; i < default_flags.length; i++) {
|
||||||
|
String current = default_flags_string[i];
|
||||||
|
if (current.contains(","))
|
||||||
|
default_flags[i] = new Flag(current.split(",")[0], current.split(",")[1]);
|
||||||
|
else
|
||||||
|
default_flags[i] = new Flag(current, "");
|
||||||
|
}
|
||||||
|
plotworld.DEFAULT_FLAGS = default_flags;
|
||||||
|
|
||||||
PlotMain.addPlotWorld(world, plotworld);
|
PlotMain.addPlotWorld(world, plotworld);
|
||||||
|
|
||||||
plotsize = plotworld.PLOT_WIDTH;
|
plotsize = plotworld.PLOT_WIDTH;
|
||||||
|
@ -328,7 +328,7 @@ public class DBFunc {
|
|||||||
stmt.close();
|
stmt.close();
|
||||||
} catch(SQLException e) {
|
} catch(SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Logger.add(LogLevel.WARNING, "Could not set weather for plot " + plot.id);
|
Logger.add(LogLevel.WARNING, "Could not set flag for plot " + plot.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user