From e2c49a6e2142104b021bf3bb6121bba8bee6c93f Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Tue, 23 Sep 2014 12:03:25 +0200 Subject: [PATCH 1/2] I like pretty configs. --- .../plot/WorldGenerator.java | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java b/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java index e1bab94d2..1e562e550 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java @@ -1,21 +1,15 @@ package com.intellectualcrafters.plot; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Biome; -import org.bukkit.command.defaults.SaveCommand; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; +import java.util.*; import java.util.Map.Entry; import static com.intellectualcrafters.plot.PlotWorld.*; @@ -77,15 +71,15 @@ public class WorldGenerator extends ChunkGenerator { options.put("worlds."+world+".plot_biome", PLOT_BIOME_DEFAULT); options.put("worlds."+world+".plot_filling", Arrays.asList(MAIN_BLOCK_DEFAULT)); options.put("worlds."+world+".top_floor", Arrays.asList(TOP_BLOCK_DEFAULT)); - options.put("worlds."+world+".wall_block", WALL_BLOCK_DEFAULT); - options.put("worlds."+world+".road_width", ROAD_WIDTH_DEFAULT); - options.put("worlds."+world+".road_height", ROAD_HEIGHT_DEFAULT); - options.put("worlds."+world+".road_block", ROAD_BLOCK_DEFAULT); + options.put("worlds."+world+".wall.block", WALL_BLOCK_DEFAULT); + options.put("worlds."+world+".road.width", ROAD_WIDTH_DEFAULT); + options.put("worlds."+world+".road.height", ROAD_HEIGHT_DEFAULT); + options.put("worlds."+world+".road.block", ROAD_BLOCK_DEFAULT); // options.put("worlds."+world+".road_stripes", ROAD_STRIPES_DEFAULT); - options.put("worlds."+world+".wall_filling", WALL_FILLING_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_file", SCHEMATIC_FILE_DEFAULT); + options.put("worlds."+world+".wall.filling", WALL_FILLING_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.file", SCHEMATIC_FILE_DEFAULT); options.put("worlds."+world+".default_flags", DEFAULT_FLAGS_DEFAULT); for (Entry node : options.entrySet()) { @@ -103,16 +97,16 @@ public class WorldGenerator extends ChunkGenerator { plotworld.PLOT_BIOME = config.getString("worlds."+world+".plot_biome"); plotworld.MAIN_BLOCK = config.getStringList("worlds."+world+".plot_filling").toArray(new String[0]); plotworld.TOP_BLOCK = config.getStringList("worlds."+world+".top_floor").toArray(new String[0]); - plotworld.WALL_BLOCK = config.getString("worlds."+world+".wall_block"); - plotworld.ROAD_WIDTH = config.getInt("worlds."+world+".road_width"); - plotworld.ROAD_HEIGHT = config.getInt("worlds."+world+".road_height"); - plotworld.ROAD_BLOCK = config.getString("worlds."+world+".road_block"); + plotworld.WALL_BLOCK = config.getString("worlds."+world+".wall.block"); + plotworld.ROAD_WIDTH = config.getInt("worlds."+world+".road.width"); + plotworld.ROAD_HEIGHT = config.getInt("worlds."+world+".road.height"); + plotworld.ROAD_BLOCK = config.getString("worlds."+world+".road.block"); // plotworld.ROAD_STRIPES = config.getInt("worlds."+world+".road_stripes"); - plotworld.WALL_FILLING = config.getString("worlds."+world+".wall_filling"); - plotworld.WALL_HEIGHT = config.getInt("worlds."+world+".wall_height"); + plotworld.WALL_FILLING = config.getString("worlds."+world+".wall.filling"); + plotworld.WALL_HEIGHT = config.getInt("worlds."+world+".wall.height"); plotworld.PLOT_CHAT = config.getBoolean("worlds."+world+".plot_chat"); - plotworld.SCHEMATIC_ON_CLAIM = config.getBoolean("worlds."+world+".schematic_on_claim"); - plotworld.SCHEMATIC_FILE = config.getString("worlds."+world+".schematic_file"); + plotworld.SCHEMATIC_ON_CLAIM = config.getBoolean("worlds."+world+".schematic.on_claim"); + 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]; From ba54016720b011eaf1938e3581feca6398084182 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Tue, 23 Sep 2014 12:44:57 +0200 Subject: [PATCH 2/2] Attempt to fix db, might not always work. We got to add a warning to spigot. --- .idea/workspace.xml | 546 +++++++++++++----- PlotSquared/PlotSquared.iml | 18 - .../plot/database/DBFunc.java | 42 +- 3 files changed, 444 insertions(+), 162 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fe8d50679..aca2d4b7a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -12,12 +12,9 @@ - + + - - - - @@ -41,31 +38,11 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - + + @@ -74,28 +51,20 @@ - - - + + + + + - - + + - - - - - - - - - - - - + + @@ -104,8 +73,8 @@ - - + + @@ -114,20 +83,73 @@ - - + + - + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -136,7 +158,7 @@ - + @@ -166,11 +188,12 @@ @@ -212,6 +235,7 @@ + @@ -284,6 +308,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -323,7 +424,7 @@ - + @@ -351,6 +452,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -493,7 +713,9 @@ - + + + 1411382351159 @@ -539,17 +761,28 @@ 1411413674578 1411413674578 - - - @@ -561,7 +794,7 @@ - + @@ -569,12 +802,13 @@ + + - @@ -600,39 +834,21 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -654,7 +870,9 @@ - + + + @@ -670,7 +888,6 @@ - @@ -686,7 +903,6 @@ - @@ -734,7 +950,9 @@ - + + + @@ -764,7 +982,6 @@ - @@ -885,13 +1102,6 @@ - - - - - - - @@ -907,13 +1117,6 @@ - - - - - - - @@ -925,7 +1128,6 @@ - @@ -933,7 +1135,6 @@ - @@ -945,14 +1146,6 @@ - - - - - - - - @@ -961,18 +1154,10 @@ - - - - - - - - - - + + @@ -985,24 +1170,105 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1022,7 +1288,7 @@ - Obfuscation (PlotSquared)|Obfuscation + No facets are configured - Obfuscation|PlotSquared + PlotSquared