Working on UUID mode conversion

This commit is contained in:
boy0001 2015-04-26 21:38:29 +10:00
parent 34772527e2
commit e8b5edf50b
3 changed files with 108 additions and 23 deletions

View File

@ -19,10 +19,60 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import com.intellectualcrafters.plot.commands.Auto;
import com.intellectualcrafters.plot.commands.BukkitCommand;
import com.intellectualcrafters.plot.commands.Buy;
import com.intellectualcrafters.plot.commands.Claim;
import com.intellectualcrafters.plot.commands.Clear;
import com.intellectualcrafters.plot.commands.Comment;
import com.intellectualcrafters.plot.commands.Condense;
import com.intellectualcrafters.plot.commands.Confirm;
import com.intellectualcrafters.plot.commands.Copy;
import com.intellectualcrafters.plot.commands.CreateRoadSchematic;
import com.intellectualcrafters.plot.commands.Database;
import com.intellectualcrafters.plot.commands.Debug;
import com.intellectualcrafters.plot.commands.DebugClaimTest;
import com.intellectualcrafters.plot.commands.DebugClear;
import com.intellectualcrafters.plot.commands.DebugExec;
import com.intellectualcrafters.plot.commands.DebugFixFlags;
import com.intellectualcrafters.plot.commands.DebugLoadTest;
import com.intellectualcrafters.plot.commands.DebugRoadRegen;
import com.intellectualcrafters.plot.commands.DebugSaveTest;
import com.intellectualcrafters.plot.commands.DebugUUID;
import com.intellectualcrafters.plot.commands.Delete;
import com.intellectualcrafters.plot.commands.Denied;
import com.intellectualcrafters.plot.commands.FlagCmd;
import com.intellectualcrafters.plot.commands.Help;
import com.intellectualcrafters.plot.commands.Helpers;
import com.intellectualcrafters.plot.commands.Home;
import com.intellectualcrafters.plot.commands.Inbox;
import com.intellectualcrafters.plot.commands.Info;
import com.intellectualcrafters.plot.commands.Inventory;
import com.intellectualcrafters.plot.commands.Kick;
import com.intellectualcrafters.plot.commands.MainCommand;
import com.intellectualcrafters.plot.commands.Merge;
import com.intellectualcrafters.plot.commands.Move;
import com.intellectualcrafters.plot.commands.MusicSubcommand;
import com.intellectualcrafters.plot.commands.Purge;
import com.intellectualcrafters.plot.commands.Rate;
import com.intellectualcrafters.plot.commands.RegenAllRoads;
import com.intellectualcrafters.plot.commands.Reload;
import com.intellectualcrafters.plot.commands.SchematicCmd;
import com.intellectualcrafters.plot.commands.Set;
import com.intellectualcrafters.plot.commands.SetOwner;
import com.intellectualcrafters.plot.commands.Setup;
import com.intellectualcrafters.plot.commands.Swap;
import com.intellectualcrafters.plot.commands.TP;
import com.intellectualcrafters.plot.commands.Target;
import com.intellectualcrafters.plot.commands.Template;
import com.intellectualcrafters.plot.commands.Trim;
import com.intellectualcrafters.plot.commands.Trusted;
import com.intellectualcrafters.plot.commands.Unclaim;
import com.intellectualcrafters.plot.commands.Unlink;
import com.intellectualcrafters.plot.commands.Visit;
import com.intellectualcrafters.plot.commands.WE_Anywhere;
import com.intellectualcrafters.plot.commands.list;
import com.intellectualcrafters.plot.commands.plugin;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.PlotMeConverter;
@ -156,6 +206,56 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public void registerCommands() {
new MainCommand();
MainCommand.subCommands.add(new Template());
MainCommand.subCommands.add(new Setup());
MainCommand.subCommands.add(new DebugUUID());
MainCommand.subCommands.add(new DebugSaveTest());
MainCommand.subCommands.add(new DebugLoadTest());
MainCommand.subCommands.add(new CreateRoadSchematic());
MainCommand.subCommands.add(new RegenAllRoads());
MainCommand.subCommands.add(new DebugClear());
MainCommand.subCommands.add(new Claim());
MainCommand.subCommands.add(new Auto());
MainCommand.subCommands.add(new Home());
MainCommand.subCommands.add(new Visit());
MainCommand.subCommands.add(new TP());
MainCommand.subCommands.add(new Set());
MainCommand.subCommands.add(new Clear());
MainCommand.subCommands.add(new Delete());
MainCommand.subCommands.add(new SetOwner());
MainCommand.subCommands.add(new Denied());
MainCommand.subCommands.add(new Helpers());
MainCommand.subCommands.add(new Trusted());
MainCommand.subCommands.add(new Info());
MainCommand.subCommands.add(new list());
MainCommand.subCommands.add(new Help());
MainCommand.subCommands.add(new Debug());
MainCommand.subCommands.add(new SchematicCmd());
MainCommand.subCommands.add(new plugin());
MainCommand.subCommands.add(new Inventory());
MainCommand.subCommands.add(new Purge());
MainCommand.subCommands.add(new Reload());
MainCommand.subCommands.add(new Merge());
MainCommand.subCommands.add(new Unlink());
MainCommand.subCommands.add(new Kick());
MainCommand.subCommands.add(new Rate());
MainCommand.subCommands.add(new DebugClaimTest());
MainCommand.subCommands.add(new Inbox());
MainCommand.subCommands.add(new Comment());
MainCommand.subCommands.add(new Database());
MainCommand.subCommands.add(new Unclaim());
MainCommand.subCommands.add(new Swap());
MainCommand.subCommands.add(new MusicSubcommand());
MainCommand.subCommands.add(new DebugRoadRegen());
MainCommand.subCommands.add(new Trim());
MainCommand.subCommands.add(new DebugExec());
MainCommand.subCommands.add(new FlagCmd());
MainCommand.subCommands.add(new Target());
MainCommand.subCommands.add(new DebugFixFlags());
MainCommand.subCommands.add(new Move());
MainCommand.subCommands.add(new Condense());
MainCommand.subCommands.add(new Confirm());
MainCommand.subCommands.add(new Copy());
final BukkitCommand bcmd = new BukkitCommand();
final PluginCommand plotCommand = getCommand("plots");
plotCommand.setExecutor(bcmd);

View File

@ -20,37 +20,22 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.BlockManager;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
public class DebugUUID extends SubCommand {
public DebugUUID() {
super("debugexec", "plots.admin", "Multi-purpose debug command", "debugexec", "exec", CommandCategory.DEBUG, false);
super("debuguuid", "plots.admin", "Debug uuid conversion", "debuguuid", "uuidconvert", CommandCategory.DEBUG, false);
}
@Override
public boolean execute(final PlotPlayer player, final String... args) {
if (player != null) {
MainUtil.sendMessage(player, C.NOT_CONSOLE);
return false;
}
return true;
}
}

View File

@ -40,7 +40,7 @@ public class MainCommand {
/**
* Main Permission Node
*/
private final static SubCommand[] _subCommands = new SubCommand[] { new Template(), new Setup(), new DebugSaveTest(), new DebugLoadTest(), new CreateRoadSchematic(), new RegenAllRoads(), new DebugClear(), new Claim(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new SchematicCmd(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Rate(), new DebugClaimTest(), new Inbox(), new Comment(), new Database(), new Unclaim(), new Swap(), new MusicSubcommand(), new DebugRoadRegen(), new Trim(), new DebugExec(), new FlagCmd(), new Target(), new DebugFixFlags(), new Move(), new Condense(), new Confirm(), new Copy(), new WE_Anywhere() };
private final static SubCommand[] _subCommands = new SubCommand[] { };
public final static ArrayList<SubCommand> subCommands = new ArrayList<SubCommand>() {
{
addAll(Arrays.asList(_subCommands));