diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 188308548..768f3312c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -10,16 +10,11 @@
-
-
-
+
-
-
-
-
-
-
+
+
+
@@ -42,50 +37,186 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -110,21 +241,25 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -185,28 +320,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -235,28 +348,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -351,6 +442,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -410,79 +527,25 @@
- $PROJECT_DIR$/.classpath
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/AbstractFlag.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/C.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/ConsoleColors.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Flag.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/LSetCube.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Lag.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Logger.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Metrics.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PWE.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Plot.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotHomePosition.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotId.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotSettings.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotWorld.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/RUtils.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/ReflectionUtils.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/SchematicHandler.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/SetBlockFast.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Settings.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/Title.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/WorldGenerator.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/XPopulator.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/api/PlotAPI.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Auto.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Camera.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Claim.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Clear.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Command.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/CommandPermission.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Debug.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Denied.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Help.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Helpers.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Home.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Info.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Inventory.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/MainCommand.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Reload.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Schematic.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/SetOwner.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/SubCommand.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/TP.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Visit.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/list.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/plugin.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/Database.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/MySQL.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/PlotMeConverter.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/database/SQLite.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerClaimPlotEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerEnterPlotEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerLeavePlotEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerPlotDeniedEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerPlotHelperEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlayerTeleportToPlotEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotDeleteEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotFlagAddEvent.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotFlagRemoveEvent.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/PlayerEvents.java
$PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/WorldEditListener.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/uuid/NameFetcher.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/uuid/UUIDFetcher.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualsites/web/IndexHandler.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualsites/web/PlotWeb.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualsites/web/ResourceHandler.java
- $PROJECT_DIR$/PlotSquared/src/com/intellectualsites/web/Test.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/listeners/WorldGuardListener.java
+ $PROJECT_DIR$/PlotSquared/src/plugin.yml
@@ -490,6 +553,12 @@
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Delete.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Merge.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/commands/Unlink.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotMergeEvent.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotUnlinkEvent.java
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/events/PlotUnmergeEvent.java
@@ -497,6 +566,7 @@
+ $PROJECT_DIR$/PlotSquared/src/com/intellectualcrafters/plot/PlotCollection.java
@@ -725,7 +795,9 @@
-
+
+
+
1411382351159
@@ -795,15 +867,27 @@
1411497477072
1411497477072
-
+
+ 1411583371076
+ 1411583371076
+
+
+ 1411584784611
+ 1411584784611
+
+
+ 1411632266961
+ 1411632266961
+
+
-
+
-
+
@@ -817,12 +901,12 @@
-
+
-
+
@@ -832,6 +916,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -874,42 +988,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -932,14 +1010,14 @@
-
-
-
+
+
+
@@ -969,13 +1047,6 @@
-
-
-
-
-
-
-
@@ -988,7 +1059,6 @@
-
@@ -1004,7 +1074,6 @@
-
@@ -1026,9 +1095,6 @@
-
-
-
@@ -1061,14 +1127,6 @@
-
-
-
-
-
-
-
-
@@ -1090,13 +1148,6 @@
-
-
-
-
-
-
-
@@ -1105,26 +1156,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1132,7 +1167,6 @@
-
@@ -1140,7 +1174,6 @@
-
@@ -1156,7 +1189,6 @@
-
@@ -1164,7 +1196,6 @@
-
@@ -1184,14 +1215,6 @@
-
-
-
-
-
-
-
-
@@ -1210,61 +1233,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1278,42 +1250,194 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/C.java b/PlotSquared/src/com/intellectualcrafters/plot/C.java
index 6639eece6..57ae16091 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/C.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/C.java
@@ -18,6 +18,16 @@ import org.bukkit.ChatColor;
*
*/
public enum C {
+ /*
+ * Setup Stuff
+ */
+ SETUP_INIT("&6PlotSquared Setup -> Setup a new plotworld"),
+ SETUP_STEP("&cStep &6%s&c: %s"),
+ SETUP_INVALID_ARG("&c%s is not a valid argument for step %s"),
+ SETUP_VALID_ARG("&cValue &6%s &cset for step %s"),
+ SETUP_FINISHED("&cFinished setup for world &c%s"),
+ SETUP_WORLD_TAKEN("&c%s is already a registered plotworld"),
+ SETUP_MISSING_WORLD("&cYou need to specify a world name (&6/p setup {world}&c)"),
/*
* Schematic Stuff
*/
@@ -53,7 +63,7 @@ public enum C {
/*
* Permission
*/
- NO_PERMISSION("&cYou don't have the permissions required to use this command."), NO_PLOT_PERMS("&cYou don't have the permissions to do that in this plot"), CANT_CLAIM_MORE_PLOTS("&cYou can't claim more plots."), YOU_BE_DENIED("&cYou are not allowed to enter this plot"),
+ NO_PERMISSION("&cYou don't have the permissions required to use this command."), NO_PLOT_PERMS("&cYou don't have the permissions to do that in this plot"), CANT_CLAIM_MORE_PLOTS("&cYou can't claim more plots."), YOU_BE_DENIED("&cYou are not allowed to enter this plot"),
NO_PERM_MERGE("&cYou are not the owner of the plot: &6%plot%"), UNLINK_REQUIRED("&cAn unlink is required to do this."), UNLINK_IMPOSSIBLE("&cYou can only unlink a mega-plot"),
NO_MERGE_TO_MEGA("&cMega plots cannot be merged into. Please merge from the desired mega plot."),
/*
@@ -181,7 +191,7 @@ public enum C {
/**
* Constructor
- *
+ *
* @param d
* default
*/
@@ -199,7 +209,7 @@ public enum C {
/**
* Get the default string
- *
+ *
* @return default
*/
@SuppressWarnings("unused")
@@ -209,7 +219,7 @@ public enum C {
/**
* Get translated if exists
- *
+ *
* @return translated if exists else default
*/
public String s() {
@@ -220,7 +230,7 @@ public enum C {
}
/**
- *
+ *
* @return translated and color decoded
*/
public String translated() {
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java b/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java
index fca7a122f..58937d892 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/FlagManager.java
@@ -32,7 +32,7 @@ public class FlagManager {
* Get an AbstractFlag by a string
* Returns null if flag does not exist
* @param string
- * @return AbstractFkag
+ * @return AbstractFlag
*/
public static AbstractFlag getFlag(String string) {
for (AbstractFlag flag : flags) {
@@ -54,6 +54,7 @@ public class FlagManager {
public static AbstractFlag getFlag(String string, boolean create) {
if ((getFlag(string) == null) && create) {
AbstractFlag flag = new AbstractFlag(string);
+ addFlag(flag);
return flag;
}
return getFlag(string);
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/XPopulator.java b/PlotSquared/src/com/intellectualcrafters/plot/XPopulator.java
index 95b35ce39..8e3f10ac6 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/XPopulator.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/XPopulator.java
@@ -1,11 +1,11 @@
package com.intellectualcrafters.plot;
-import java.util.Random;
-
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.generator.BlockPopulator;
+import java.util.Random;
+
/**
* TODO recode this class Fuck you PlotMe!
*
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Setup.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Setup.java
new file mode 100644
index 000000000..eaa4b8b0b
--- /dev/null
+++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Setup.java
@@ -0,0 +1,129 @@
+package com.intellectualcrafters.plot.commands;
+
+import com.intellectualcrafters.plot.C;
+import com.intellectualcrafters.plot.PlotMain;
+import com.intellectualcrafters.plot.PlotWorld;
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.AsyncPlayerChatEvent;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by Citymonstret on 2014-09-26.
+ */
+public class Setup extends SubCommand implements Listener {
+
+ public static Map setupMap = new HashMap<>();
+
+ /*
+ ROAD_HEIGHT
+ PLOT_HEIGHT
+ WALL_HEIGHT
+ PLOT_WIDTH
+ ROAD_WIDTH
+ PLOT_BIOME
+ MAIN_BLOCK
+ TOP_BLOCK
+ WALL_BLOCK
+ WALL_FILLING
+ ROAD_STRIPES
+ ROAD_STRIPES_ENABLED
+ ROAD_BLOCK
+ PLOT_CHAT
+ BLOCKS
+ SCHEMATIC_ON_CLAIM
+ SCHEMATIC_FILE
+ DEFAULT_FLAGS
+ */
+ private static class SetupStep {
+ private String constant;
+ private Object default_value;
+ private String description;
+ private Object value = 0;
+
+ public SetupStep(String constant, Object default_value, String description) {
+ this.constant = constant;
+ this.default_value = default_value;
+ this.description = description;
+ }
+
+ public boolean setValue(Object o) {
+
+ }
+
+ public Object getValue() {
+ return this.value;
+ }
+
+ public String getConstant() {
+ return this.constant;
+ }
+
+ public Object getDefaultValue() {
+ return this.default_value;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+ }
+
+ private static class SetupObject {
+ private String world;
+ private int current = 0;
+
+ private SetupStep[] step = new SetupStep[] {
+ new SetupStep("road_height", 64, "Height of road")
+ };
+
+ public SetupObject(String world) {
+ this.world = world;
+ PlotWorld p = new PlotWorld();
+ }
+
+ public SetupStep getNextStep() {
+ return this.step[current++];
+ }
+
+
+ public int getMax() {
+ return this.step.length;
+ }
+ }
+
+ public Setup() {
+ super("setup", "plots.admin", "Setup a PlotWorld", "/plot setup {world}", "setup", CommandCategory.ACTIONS);
+ }
+
+ @Override
+ public boolean execute(Player plr, String... args) {
+ if(args.length < 1) {
+ sendMessage(plr, C.SETUP_MISSING_WORLD);
+ return true;
+ }
+ String world = args[0];
+ if(PlotMain.isPlotWorld(Bukkit.getWorld(world))) {
+ sendMessage(plr, C.SETUP_WORLD_TAKEN, world);
+ return true;
+ }
+ setupMap.put(plr.getName(), new SetupObject(world));
+ sendMessage(plr, C.SETUP_INIT);
+ return true;
+ }
+
+ @EventHandler(priority = EventPriority.HIGHEST)
+ public void onChat(AsyncPlayerChatEvent event) {
+ Player player = event.getPlayer();
+ if(!setupMap.containsKey(player.getName())) {
+ return;
+ }
+ event.setCancelled(true);
+ SetupObject object = setupMap.get(player.getName());
+
+ }
+}
diff --git a/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java b/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java
index f5fd0fc68..021199e84 100644
--- a/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java
+++ b/PlotSquared/src/com/intellectualcrafters/plot/database/DBFunc.java
@@ -229,7 +229,7 @@ public class DBFunc {
rs = data.getColumns(null, null, "plot_settings", "merged");
if (!rs.next()) {
Statement statement = connection.createStatement();
- statement.addBatch("ALTER IGNORE TABLE `plot_settings` ADD `merged` int(11) DEFAULT NULL");
+ statement.addBatch("ALTER TABLE `plot_settings` ADD `merged` int(11) DEFAULT NULL");
statement.executeBatch();
statement.close();
}
@@ -267,9 +267,6 @@ public class DBFunc {
flags[i] = new Flag(FlagManager.getFlag(flags_string[i], true), "");
}
}
-
-
-
ArrayList helpers = plotHelpers(id);
ArrayList denied = plotDenied(id);
// boolean changeTime = ((Short) settings.get("custom_time") ==
@@ -281,7 +278,12 @@ public class DBFunc {
// boolean rain =
// Integer.parseInt(settings.get("rain").toString()) == 1 ? true
// : false;
- boolean rain = (int) settings.get("rain") == 1 ? true : false;
+ boolean rain;
+ try {
+ rain = (int) settings.get("rain") == 1 ? true : false;
+ } catch(Exception e) {
+ rain = false;
+ }
String alias = (String) settings.get("alias");
if ((alias == null) || alias.equalsIgnoreCase("NEW")) {
alias = "";