diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index 36b44c56e..b1abea64e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1009,8 +1009,8 @@ import java.util.concurrent.TimeUnit; private static void setupStorage() { storage.set("version", storage_ver); final Map options = new HashMap<>(); - options.put("mysql.use", true); - options.put("sqlite.use", false); + options.put("mysql.use", false); + options.put("sqlite.use", true); options.put("sqlite.db", "storage"); options.put("mysql.host", "localhost"); options.put("mysql.port", "3306"); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java index 770dbff2f..7631d6cb0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Purge.java @@ -21,11 +21,15 @@ package com.intellectualcrafters.plot.commands; +import java.util.UUID; + import com.intellectualcrafters.plot.PlotMain; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.util.PlayerFunctions; +import com.intellectualcrafters.plot.util.UUIDHandler; + import org.bukkit.entity.Player; @SuppressWarnings({"unused", "deprecated", "javadoc"}) public class Purge extends SubCommand { @@ -34,12 +38,51 @@ import org.bukkit.entity.Player; super("purge", "plots.admin", "Purge all plots for a world", "purge", "", CommandCategory.DEBUG, false); } + public PlotId getId(String id) { + try { + String[] split = id.split(";"); + return new PlotId(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } + catch (Exception e) { + return null; + } + } + @Override public boolean execute(final Player plr, final String... args) { if (plr != null) { PlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE)); return false; } + + if (args.length == 1) { + String arg = args[0].toLowerCase(); + PlotId id = getId(arg); + if (id != null || arg.equals("plotid")) { + PlayerFunctions.sendMessage(plr, "/plot x;z &l"); + return false; + } + UUID uuid = UUIDHandler.getUUID(args[0]); + if (uuid != null) { + PlayerFunctions.sendMessage(plr, "/plot "+args[0]+" &l"); + return false; + } + if (arg.equals("player")) { + PlayerFunctions.sendMessage(plr, "/plot &l "); + return false; + } + if (arg.equals("unowned")) { + PlayerFunctions.sendMessage(plr, "/plot unowned &l"); + return false; + } + if (arg.equals("unknown")) { + PlayerFunctions.sendMessage(plr, "/plot unknown &l"); + return false; + } + PlayerFunctions.sendMessage(plr, "Use /plot "); + return false; + } + if (args.length != 2) { if (args.length == 1) { try { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java index b9c01e745..cdc59283e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java @@ -77,6 +77,12 @@ import java.util.Set; } return newflags; } + + // FIXME get resultant flags for a plot (with DB change) + + // remove a flag + + // add a flag /** * Get a list of registered AbstractFlag objects