Merge pull request #995 from manuelgu/master

Cleanup
This commit is contained in:
Matt 2016-03-22 14:36:41 -04:00
commit e18e1d4816
46 changed files with 477 additions and 341 deletions

View File

@ -31,7 +31,6 @@ import org.bukkit.material.Step;
import org.bukkit.material.Tree; import org.bukkit.material.Tree;
import org.bukkit.material.WoodenStep; import org.bukkit.material.WoodenStep;
import org.bukkit.material.Wool; import org.bukkit.material.Wool;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -33,10 +33,10 @@ import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration( @CommandDeclaration(
command = "setalias", command = "setalias",
permission = "plots.set.alias", permission = "plots.set.alias",
description = "Set the plot name", description = "Set the plot name",
usage = "/plot alias <alias>", usage = "/plot alias <alias>",
aliases = { "alias", "sa", "name", "rename", "setname", "seta" }, aliases = { "alias", "sa", "name", "rename", "setname", "seta" },
category = CommandCategory.SETTINGS, category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class Alias extends SetCommand { public class Alias extends SetCommand {

View File

@ -26,14 +26,18 @@ import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
@CommandDeclaration(command = "area", permission = "plots.area", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE, @CommandDeclaration(command = "area",
description = "Create a new PlotArea", aliases = "world", usage = "/plot area <create|info|list|tp|regen>") permission = "plots.area",
category = CommandCategory.ADMINISTRATION,
requiredType = RequiredType.NONE,
description = "Create a new PlotArea",
aliases = "world",
usage = "/plot area <create|info|list|tp|regen>")
public class Area extends SubCommand { public class Area extends SubCommand {
@Override @Override

View File

@ -32,8 +32,13 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "auto", permission = "plots.auto", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, @CommandDeclaration(command = "auto",
description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]") permission = "plots.auto",
category = CommandCategory.CLAIMING,
requiredType = RequiredType.NONE,
description = "Claim the nearest plot",
aliases = "a",
usage = "/plot auto [length,width]")
public class Auto extends SubCommand { public class Auto extends SubCommand {
public static PlotId getNextPlotId(final PlotId id, final int step) { public static PlotId getNextPlotId(final PlotId id, final int step) {

View File

@ -29,7 +29,12 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "bo3", aliases = { "bo2" }, description = "Mark a plot as done", permission = "plots.bo3", category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE) @CommandDeclaration(command = "bo3",
aliases = { "bo2" },
description = "Mark a plot as done",
permission = "plots.bo3",
category = CommandCategory.SCHEMATIC,
requiredType = RequiredType.NONE)
public class BO3 extends SubCommand { public class BO3 extends SubCommand {
public void noArgs(final PlotPlayer plr) { public void noArgs(final PlotPlayer plr) {

View File

@ -31,8 +31,12 @@ import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, @CommandDeclaration(command = "claim",
requiredType = RequiredType.NONE, permission = "plots.claim", usage = "/plot claim") aliases = "c",
description = "Claim the current plot you're standing on",
category = CommandCategory.CLAIMING,
requiredType = RequiredType.PLAYER,
permission = "plots.claim", usage = "/plot claim")
public class Claim extends SubCommand { public class Claim extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String... args) { public boolean onCommand(final PlotPlayer plr, final String... args) {

View File

@ -20,8 +20,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.Set;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.FlagManager; import com.intellectualcrafters.plot.flag.FlagManager;
@ -34,9 +32,14 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.SetQueue; import com.intellectualcrafters.plot.util.SetQueue;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.Set;
@CommandDeclaration(command = "clear", description = "Clear a plot", permission = "plots.clear", category = CommandCategory.APPEARANCE, @CommandDeclaration(command = "clear",
usage = "/plot clear [id]", aliases = "reset") description = "Clear a plot",
permission = "plots.clear",
category = CommandCategory.APPEARANCE,
usage = "/plot clear [id]",
aliases = "reset")
public class Clear extends SubCommand { public class Clear extends SubCommand {
@Override @Override

View File

@ -35,14 +35,17 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "cluster", aliases = "clusters", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE, @CommandDeclaration(command = "cluster",
permission = "plots.cluster", description = "Manage a plot cluster") aliases = "clusters",
category = CommandCategory.ADMINISTRATION,
requiredType = RequiredType.NONE,
permission = "plots.cluster",
description = "Manage a plot cluster")
public class Cluster extends SubCommand { public class Cluster extends SubCommand {
@Override @Override

View File

@ -20,9 +20,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.Arrays;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
@ -35,8 +32,15 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.Arrays;
import java.util.Map.Entry;
@CommandDeclaration(command = "comment", aliases = { "msg" }, description = "Comment on a plot", category = CommandCategory.CHAT, requiredType = RequiredType.NONE, permission = "plots.comment") @CommandDeclaration(command = "comment",
aliases = { "msg" },
description = "Comment on a plot",
category = CommandCategory.CHAT,
requiredType = RequiredType.NONE,
permission = "plots.comment")
public class Comment extends SubCommand { public class Comment extends SubCommand {
@Override @Override

View File

@ -30,7 +30,6 @@ import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -39,7 +38,11 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
@CommandDeclaration(command = "condense", permission = "plots.admin", description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE) @CommandDeclaration(command = "condense",
permission = "plots.admin",
description = "Condense a plotworld",
category = CommandCategory.ADMINISTRATION,
requiredType = RequiredType.CONSOLE)
public class Condense extends SubCommand { public class Condense extends SubCommand {
public static boolean TASK = false; public static boolean TASK = false;

View File

@ -28,7 +28,10 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "confirm", permission = "plots.use", description = "Confirm an action", category = CommandCategory.INFO) @CommandDeclaration(command = "confirm",
permission = "plots.use",
description = "Confirm an action",
category = CommandCategory.INFO)
public class Confirm extends SubCommand { public class Confirm extends SubCommand {
@Override @Override

View File

@ -12,7 +12,6 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.io.File; import java.io.File;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
@ -27,9 +26,7 @@ category = CommandCategory.ADMINISTRATION,
permission = "plots.database", permission = "plots.database",
description = "Convert/Backup Storage", description = "Convert/Backup Storage",
requiredType = RequiredType.CONSOLE, requiredType = RequiredType.CONSOLE,
usage = "/plots database [area] <sqlite|mysql|import>" usage = "/plots database [area] <sqlite|mysql|import>")
)
public class Database extends SubCommand { public class Database extends SubCommand {
public static void insertPlots(final SQLManager manager, final ArrayList<Plot> plots, final PlotPlayer player) { public static void insertPlots(final SQLManager manager, final ArrayList<Plot> plots, final PlotPlayer player) {

View File

@ -28,7 +28,11 @@ import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "debug", category = CommandCategory.DEBUG, description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin") @CommandDeclaration(command = "debug",
category = CommandCategory.DEBUG,
description = "Show debug information",
usage = "/plot debug [msg]",
permission = "plots.admin")
public class Debug extends SubCommand { public class Debug extends SubCommand {
@Override @Override

View File

@ -27,23 +27,54 @@ import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.flag.FlagManager; import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.generator.HybridUtils; import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.*; import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.util.*; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotAnalysis;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.AbstractTitle;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.SetQueue;
import com.intellectualcrafters.plot.util.SetupUtils;
import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.Command;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import com.plotsquared.listener.WEManager; import com.plotsquared.listener.WEManager;
import javax.script.*;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.*; import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.UUID;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
@CommandDeclaration(command = "debugexec", permission = "plots.admin", description = "Mutli-purpose debug command", aliases = "exec", @CommandDeclaration(command = "debugexec",
category = CommandCategory.DEBUG) permission = "plots.admin",
description = "Mutli-purpose debug command",
aliases = "exec",
category = CommandCategory.DEBUG)
public class DebugExec extends SubCommand { public class DebugExec extends SubCommand {
private ScriptEngine engine; private ScriptEngine engine;
private Bindings scope; private Bindings scope;
@ -129,7 +160,7 @@ public class DebugExec extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer player, final String... args) { public boolean onCommand(final PlotPlayer player, final String... args) {
final List<String> allowed_params = Arrays.asList("calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "show-expired", "update-expired", "seen"); final java.util.List<String> allowed_params = Arrays.asList("calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "show-expired", "update-expired", "seen");
if (args.length > 0) { if (args.length > 0) {
final String arg = args[0].toLowerCase(); final String arg = args[0].toLowerCase();
String script; String script;
@ -152,7 +183,7 @@ public class DebugExec extends SubCommand {
HybridUtils.manager.analyzePlot(plot, new RunnableVal<PlotAnalysis>() { HybridUtils.manager.analyzePlot(plot, new RunnableVal<PlotAnalysis>() {
@Override @Override
public void run(PlotAnalysis value) { public void run(PlotAnalysis value) {
MainUtil.sendMessage(player, "$1Done: $2use $3/plot debugexec analyze$2 for more information"); MainUtil.sendMessage(player, "$1Done: $2Use $3/plot debugexec analyze$2 for more information");
} }
}); });
return true; return true;
@ -219,11 +250,11 @@ public class DebugExec extends SubCommand {
} }
case "stop-rgar": case "stop-rgar":
if (!HybridUtils.UPDATE) { if (!HybridUtils.UPDATE) {
MainUtil.sendMessage(player, "&cTASK NOT RUNNING!"); MainUtil.sendMessage(player, "&cTask not running!");
return false; return false;
} }
HybridUtils.UPDATE = false; HybridUtils.UPDATE = false;
MainUtil.sendMessage(player, "&cCancelling task... (please wait)"); MainUtil.sendMessage(player, "&cCancelling task... (Please wait)");
return true; return true;
case "start-expire": case "start-expire":
if (ExpireManager.IMP == null) { if (ExpireManager.IMP == null) {
@ -246,11 +277,11 @@ public class DebugExec extends SubCommand {
} }
final UUID uuid = UUIDHandler.getUUID(args[1], null); final UUID uuid = UUIDHandler.getUUID(args[1], null);
if (uuid == null) { if (uuid == null) {
return MainUtil.sendMessage(player, "player not found: " + args[1]); return MainUtil.sendMessage(player, "Player not found: " + args[1]);
} }
final OfflinePlotPlayer op = UUIDHandler.getUUIDWrapper().getOfflinePlayer(uuid); final OfflinePlotPlayer op = UUIDHandler.getUUIDWrapper().getOfflinePlayer(uuid);
if (op == null || op.getLastPlayed() == 0) { if (op == null || op.getLastPlayed() == 0) {
return MainUtil.sendMessage(player, "player hasn't connected before: " + args[1]); return MainUtil.sendMessage(player, "Player hasn't connected before: " + args[1]);
} }
final Timestamp stamp = new Timestamp(op.getLastPlayed()); final Timestamp stamp = new Timestamp(op.getLastPlayed());
final Date date = new Date(stamp.getTime()); final Date date = new Date(stamp.getTime());
@ -269,8 +300,7 @@ public class DebugExec extends SubCommand {
case "addcmd": case "addcmd":
try { try {
final String cmd = StringMan.join(Files final String cmd = StringMan.join(Files
.readLines(MainUtil.getFile(new File(PS.get().IMP.getDirectory() + File.separator + "scripts"), args[1]), .readLines(MainUtil.getFile(new File(PS.get().IMP.getDirectory() + File.separator + "scripts"), args[1]), StandardCharsets.UTF_8),
StandardCharsets.UTF_8),
System.getProperty("line.separator")); System.getProperty("line.separator"));
final Command<PlotPlayer> subcommand = new Command<PlotPlayer>(args[1].split("\\.")[0]) { final Command<PlotPlayer> subcommand = new Command<PlotPlayer>(args[1].split("\\.")[0]) {
@Override @Override

View File

@ -9,12 +9,14 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste", description = "Upload settings.yml & latest.log to HasteBin", @CommandDeclaration(command = "debugpaste",
permission = "plots.debugpaste", category = CommandCategory.DEBUG) aliases = "dp", usage = "/plot debugpaste",
description = "Upload settings.yml & latest.log to HasteBin",
permission = "plots.debugpaste",
category = CommandCategory.DEBUG)
public class DebugPaste extends SubCommand { public class DebugPaste extends SubCommand {
@Override @Override

View File

@ -33,10 +33,14 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.Argument; import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "deny", aliases = { "d", "ban" }, description = "Deny a user from a plot", usage = "/plot deny <player>", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE) @CommandDeclaration(command = "deny",
aliases = { "d", "ban" },
description = "Deny a user from a plot",
usage = "/plot deny <player>",
category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE)
public class Deny extends SubCommand { public class Deny extends SubCommand {
public Deny() { public Deny() {

View File

@ -34,7 +34,7 @@ permission = "plots.set.desc",
description = "Set the plot description", description = "Set the plot description",
usage = "/plot desc <description>", usage = "/plot desc <description>",
aliases = { "desc", "setdesc", "setd", "description" }, aliases = { "desc", "setdesc", "setd", "description" },
category = CommandCategory.SETTINGS, category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class Desc extends SetCommand { public class Desc extends SetCommand {

View File

@ -34,7 +34,12 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "done", aliases = { "submit" }, description = "Mark a plot as done", permission = "plots.done", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE) @CommandDeclaration(command = "done",
aliases = { "submit" },
description = "Mark a plot as done",
permission = "plots.done",
category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE)
public class Done extends SubCommand { public class Done extends SubCommand {
@Override @Override

View File

@ -17,7 +17,13 @@ import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.net.URL; import java.net.URL;
@CommandDeclaration(usage = "/plot download [schematic|bo3|world]", command = "download", aliases = { "dl" }, category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE, description = "Download your plot", permission = "plots.download") @CommandDeclaration(usage = "/plot download [schematic|bo3|world]",
command = "download",
aliases = { "dl" },
category = CommandCategory.SCHEMATIC,
requiredType = RequiredType.NONE,
description = "Download your plot",
permission = "plots.download")
public class Download extends SubCommand { public class Download extends SubCommand {
@Override @Override

View File

@ -4,7 +4,6 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.Command;
import java.io.File; import java.io.File;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
@ -47,10 +46,10 @@ public class GenerateDocs {
final String name = command.getCommand(); final String name = command.getCommand();
// Header // Header
final String source = "https://github.com/IntellectualSites/PlotSquared/tree/master/src/main/java/com/intellectualcrafters/plot/commands/" + clazz + ".java"; final String source = "https://github.com/IntellectualSites/PlotSquared/tree/master/Core/src/main/java/com/intellectualcrafters/plot/commands/" + clazz + ".java";
log("## [" + name.toUpperCase() + "](" + source + ") "); log("## [" + name.toUpperCase() + "](" + source + ") ");
final File file = new File("src/main/java/com/intellectualcrafters/plot/commands/" + clazz + ".java"); final File file = new File("Core/src/main/java/com/intellectualcrafters/plot/commands/" + clazz + ".java");
final List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8); final List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
final List<String> perms = getPerms(name, lines); final List<String> perms = getPerms(name, lines);
final List<String> usages = getUsage(name, lines); final List<String> usages = getUsage(name, lines);

View File

@ -1,7 +1,5 @@
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.UUID;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
@ -11,14 +9,14 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.UUID;
@CommandDeclaration( @CommandDeclaration(
command = "grant", command = "grant",
category = CommandCategory.CLAIMING, category = CommandCategory.CLAIMING,
usage = "/plot grant <check|add> [player]", usage = "/plot grant <check|add> [player]",
permission = "plots.grant", permission = "plots.grant",
requiredType = RequiredType.NONE requiredType = RequiredType.NONE)
)
public class Grant extends SubCommand { public class Grant extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {

View File

@ -3,7 +3,10 @@ package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "help", description = "Get this help menu", aliases = { "he" }, category = CommandCategory.INFO) @CommandDeclaration(command = "help",
description = "Get this help menu",
aliases = { "he" },
category = CommandCategory.INFO)
public class Help extends SubCommand { public class Help extends SubCommand {
@Override @Override

View File

@ -23,8 +23,12 @@ package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "home", aliases = { "h" }, description = "Go to your plot", usage = "/plot home [id|alias]", @CommandDeclaration(command = "home",
category = CommandCategory.TELEPORT, requiredType = RequiredType.NONE) aliases = { "h" },
description = "Go to your plot",
usage = "/plot home [id|alias]",
category = CommandCategory.TELEPORT,
requiredType = RequiredType.NONE)
public class Home extends SubCommand { public class Home extends SubCommand {
@Override @Override

View File

@ -29,10 +29,13 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "info", aliases = "i", description = "Display plot info", usage = "/plot info <id>", category = CommandCategory.INFO) @CommandDeclaration(command = "info",
aliases = "i",
description = "Display plot info",
usage = "/plot info <id>",
category = CommandCategory.INFO)
public class Info extends SubCommand { public class Info extends SubCommand {
@Override @Override

View File

@ -30,7 +30,12 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "kick", aliases = { "k" }, description = "Kick a player from your plot", permission = "plots.kick", category = CommandCategory.TELEPORT, requiredType = RequiredType.NONE) @CommandDeclaration(command = "kick",
aliases = { "k" },
description = "Kick a player from your plot",
permission = "plots.kick",
category = CommandCategory.TELEPORT,
requiredType = RequiredType.NONE)
public class Kick extends SubCommand { public class Kick extends SubCommand {
@Override @Override

View File

@ -37,7 +37,6 @@ import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.Command;
import com.plotsquared.general.commands.CommandHandlingOutput; import com.plotsquared.general.commands.CommandHandlingOutput;
import com.plotsquared.general.commands.CommandManager; import com.plotsquared.general.commands.CommandManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
@ -50,7 +49,6 @@ import java.util.List;
*/ */
public class MainCommand extends CommandManager<PlotPlayer> { public class MainCommand extends CommandManager<PlotPlayer> {
private static MainCommand instance; private static MainCommand instance;
private MainCommand() { private MainCommand() {
@ -86,11 +84,11 @@ public class MainCommand extends CommandManager<PlotPlayer> {
createCommand(new Remove()); createCommand(new Remove());
createCommand(new Undeny()); createCommand(new Undeny());
createCommand(new Info()); createCommand(new Info());
createCommand(new list()); createCommand(new com.intellectualcrafters.plot.commands.List());
createCommand(new Help()); createCommand(new Help());
createCommand(new Debug()); createCommand(new Debug());
createCommand(new SchematicCmd()); createCommand(new SchematicCmd());
createCommand(new plugin()); createCommand(new Plugin());
createCommand(new Purge()); createCommand(new Purge());
createCommand(new Reload()); createCommand(new Reload());
createCommand(new Merge()); createCommand(new Merge());
@ -103,7 +101,7 @@ public class MainCommand extends CommandManager<PlotPlayer> {
createCommand(new Comment()); createCommand(new Comment());
createCommand(new Database()); createCommand(new Database());
createCommand(new Swap()); createCommand(new Swap());
createCommand(new MusicSubcommand()); createCommand(new Music());
createCommand(new DebugRoadRegen()); createCommand(new DebugRoadRegen());
createCommand(new Trust()); createCommand(new Trust());
createCommand(new DebugExec()); createCommand(new DebugExec());

View File

@ -36,9 +36,12 @@ import com.plotsquared.general.commands.CommandDeclaration;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "merge", aliases = "m", description = "Merge the plot you are standing on, with another plot", @CommandDeclaration(command = "merge",
permission = "plots.merge", usage = "/plot merge <all|n|e|s|w> [removeroads]", category = CommandCategory.SETTINGS, aliases = "m",
requiredType = RequiredType.NONE) description = "Merge the plot you are standing on, with another plot",
permission = "plots.merge", usage = "/plot merge <all|n|e|s|w> [removeroads]",
category = CommandCategory.SETTINGS,
requiredType = RequiredType.NONE)
public class Merge extends SubCommand { public class Merge extends SubCommand {
public final static String[] values = new String[] { "north", "east", "south", "west", "auto" }; public final static String[] values = new String[] { "north", "east", "south", "west", "auto" };
public final static String[] aliases = new String[] { "n", "e", "s", "w", "all" }; public final static String[] aliases = new String[] { "n", "e", "s", "w", "all" };

View File

@ -12,13 +12,12 @@ import com.plotsquared.general.commands.CommandDeclaration;
* @author manuelgu, altered by Citymonstret * @author manuelgu, altered by Citymonstret
*/ */
@CommandDeclaration( @CommandDeclaration(
command = "middle", command = "middle",
aliases = { "center" }, aliases = { "center" },
description = "Teleports you to the center of the current plot", description = "Teleports you to the center of the current plot",
usage = "/plot middle", usage = "/plot middle",
category = CommandCategory.TELEPORT, category = CommandCategory.TELEPORT,
requiredType = RequiredType.PLAYER requiredType = RequiredType.PLAYER)
)
public class Middle extends SubCommand { public class Middle extends SubCommand {
@Override @Override

View File

@ -39,7 +39,7 @@ description = "Player music in a plot",
usage = "/plot music", usage = "/plot music",
category = CommandCategory.APPEARANCE, category = CommandCategory.APPEARANCE,
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class MusicSubcommand extends SubCommand { public class Music extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer player, final String[] args) { public boolean onCommand(final PlotPlayer player, final String[] args) {

View File

@ -36,7 +36,6 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.Command; import com.plotsquared.general.commands.Command;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
@ -44,8 +43,13 @@ import java.util.HashMap;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "rate", permission = "plots.rate", description = "Rate the plot", usage = "/plot rate [#|next]", aliases = "rt", @CommandDeclaration(command = "rate",
category = CommandCategory.INFO, requiredType = RequiredType.NONE) permission = "plots.rate",
description = "Rate the plot",
usage = "/plot rate [#|next]",
aliases = "rt",
category = CommandCategory.INFO,
requiredType = RequiredType.NONE)
public class Rate extends SubCommand { public class Rate extends SubCommand {
@Override @Override

View File

@ -20,8 +20,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.Objects;
import com.intellectualcrafters.configuration.ConfigurationSection; import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.configuration.MemorySection; import com.intellectualcrafters.configuration.MemorySection;
import com.intellectualcrafters.configuration.file.YamlConfiguration; import com.intellectualcrafters.configuration.file.YamlConfiguration;
@ -32,8 +30,13 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.Objects;
@CommandDeclaration(command = "reload", permission = "plots.admin.command.reload", description = "Reload configurations", usage = "/plot reload", category = CommandCategory.ADMINISTRATION) @CommandDeclaration(command = "reload",
permission = "plots.admin.command.reload",
description = "Reload configurations",
usage = "/plot reload",
category = CommandCategory.ADMINISTRATION)
public class Reload extends SubCommand { public class Reload extends SubCommand {
@Override @Override

View File

@ -14,12 +14,16 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.SchematicHandler; import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@CommandDeclaration(command = "save", aliases = { "backup" }, description = "Save your plot", category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE, permission = "plots.save") @CommandDeclaration(command = "save",
aliases = { "backup" },
description = "Save your plot",
category = CommandCategory.SCHEMATIC,
requiredType = RequiredType.NONE,
permission = "plots.save")
public class Save extends SubCommand { public class Save extends SubCommand {
@Override @Override

View File

@ -23,14 +23,18 @@ package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.*; import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.SchematicHandler; import com.intellectualcrafters.plot.util.SchematicHandler;
import com.intellectualcrafters.plot.util.SchematicHandler.Schematic; import com.intellectualcrafters.plot.util.SchematicHandler.Schematic;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -44,7 +48,6 @@ aliases = { "sch" },
category = CommandCategory.SCHEMATIC, category = CommandCategory.SCHEMATIC,
usage = "/plot schematic <arg...>") usage = "/plot schematic <arg...>")
public class SchematicCmd extends SubCommand { public class SchematicCmd extends SubCommand {
private boolean running = false; private boolean running = false;
@Override @Override
@ -54,8 +57,6 @@ public class SchematicCmd extends SubCommand {
return true; return true;
} }
final String arg = args[0].toLowerCase(); final String arg = args[0].toLowerCase();
final String file;
final Schematic schematic;
switch (arg) { switch (arg) {
case "paste": { case "paste": {
if (!Permissions.hasPermission(plr, "plots.schematic.paste")) { if (!Permissions.hasPermission(plr, "plots.schematic.paste")) {

View File

@ -28,7 +28,12 @@ import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(usage = "/plot swap <X;Z>", command = "swap", description = "Swap two plots", aliases = { "switch" }, category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE) @CommandDeclaration(usage = "/plot swap <X;Z>",
command = "swap",
description = "Swap two plots",
aliases = { "switch" },
category = CommandCategory.CLAIMING,
requiredType = RequiredType.NONE)
public class Swap extends SubCommand { public class Swap extends SubCommand {
@Override @Override

View File

@ -41,7 +41,7 @@ public class Target extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {
final Location ploc = plr.getLocation(); final Location ploc = plr.getLocation();
if (!PS.get().hasPlotArea(ploc.getWorld())) { if (!ploc.isPlotArea()) {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT_WORLD); MainUtil.sendMessage(plr, C.NOT_IN_PLOT_WORLD);
return false; return false;
} }
@ -56,7 +56,7 @@ public class Target extends SubCommand {
} }
} }
if (target == null) { if (target == null) {
C.FOUND_NO_PLOTS.send(plr); MainUtil.sendMessage(plr, C.FOUND_NO_PLOTS);
return false; return false;
} }
} else if ((target = MainUtil.getPlotFromString(plr, args[0], true)) == null) { } else if ((target = MainUtil.getPlotFromString(plr, args[0], true)) == null) {

View File

@ -32,7 +32,12 @@ import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "unlink", aliases = { "u", "unmerge" }, description = "Unlink a mega-plot", usage = "/plot unlink", requiredType = RequiredType.NONE, category = CommandCategory.SETTINGS) @CommandDeclaration(command = "unlink",
aliases = { "u", "unmerge" },
description = "Unlink a mega-plot",
usage = "/plot unlink",
requiredType = RequiredType.NONE,
category = CommandCategory.SETTINGS)
public class Unlink extends SubCommand { public class Unlink extends SubCommand {
@Override @Override

View File

@ -25,7 +25,6 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
@ -39,8 +38,6 @@ aliases = { "updateplugin" },
category = CommandCategory.ADMINISTRATION) category = CommandCategory.ADMINISTRATION)
public class Update extends SubCommand { public class Update extends SubCommand {
public static String version;
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {
URL url; URL url;
@ -50,7 +47,7 @@ public class Update extends SubCommand {
try { try {
url = new URL(args[0]); url = new URL(args[0]);
} catch (final MalformedURLException e) { } catch (final MalformedURLException e) {
MainUtil.sendMessage(plr, "&cInvalid url: " + args[0]); MainUtil.sendMessage(plr, "&cInvalid URL: " + args[0]);
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot update [url]"); MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot update [url]");
return false; return false;
} }

View File

@ -40,13 +40,11 @@ import com.intellectualcrafters.plot.util.StringComparison;
import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.StringMan;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID; import java.util.UUID;
@ -57,10 +55,10 @@ description = "List plots",
permission = "plots.list", permission = "plots.list",
category = CommandCategory.INFO, category = CommandCategory.INFO,
usage = "/plot list <forsale|mine|shared|world|top|all|unowned|unknown|player|world|done|fuzzy <search...>> [#]") usage = "/plot list <forsale|mine|shared|world|top|all|unowned|unknown|player|world|done|fuzzy <search...>> [#]")
public class list extends SubCommand { public class List extends SubCommand {
private String[] getArgumentList(final PlotPlayer player) { private String[] getArgumentList(final PlotPlayer player) {
final List<String> args = new ArrayList<>(); final java.util.List<String> args = new ArrayList<>();
if ((EconHandler.manager != null) && Permissions.hasPermission(player, "plots.list.forsale")) { if ((EconHandler.manager != null) && Permissions.hasPermission(player, "plots.list.forsale")) {
args.add("forsale"); args.add("forsale");
} }
@ -126,7 +124,7 @@ public class list extends SubCommand {
} }
} }
List<Plot> plots = null; java.util.List<Plot> plots = null;
final String world = plr.getLocation().getWorld(); final String world = plr.getLocation().getWorld();
final PlotArea area = plr.getApplicablePlotArea(); final PlotArea area = plr.getApplicablePlotArea();
@ -367,7 +365,7 @@ public class list extends SubCommand {
return true; return true;
} }
public void displayPlots(final PlotPlayer player, List<Plot> plots, final int pageSize, int page, final PlotArea area, final String[] args, final boolean sort) { public void displayPlots(final PlotPlayer player, java.util.List<Plot> plots, final int pageSize, int page, final PlotArea area, final String[] args, final boolean sort) {
// Header // Header
Iterator<Plot> iter = plots.iterator(); Iterator<Plot> iter = plots.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {

View File

@ -25,9 +25,12 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(command = "plugin", permission = "plots.use", description = "Show plugin information", aliases = "version", @CommandDeclaration(command = "plugin",
category = CommandCategory.INFO) permission = "plots.use",
public class plugin extends SubCommand { description = "Show plugin information",
aliases = "version",
category = CommandCategory.INFO)
public class Plugin extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer plr, final String[] args) { public boolean onCommand(final PlotPlayer plr, final String[] args) {

View File

@ -40,7 +40,6 @@ import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
import com.intellectualcrafters.plot.util.WorldUtil; import com.intellectualcrafters.plot.util.WorldUtil;
import com.plotsquared.listener.PlotListener; import com.plotsquared.listener.PlotListener;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.geom.Area; import java.awt.geom.Area;
import java.awt.geom.PathIterator; import java.awt.geom.PathIterator;
@ -70,7 +69,6 @@ import java.util.concurrent.atomic.AtomicInteger;
*/ */
@SuppressWarnings("javadoc") @SuppressWarnings("javadoc")
public class Plot { public class Plot {
/** /**
* @deprecated raw access is deprecated * @deprecated raw access is deprecated
*/ */

View File

@ -4,10 +4,18 @@ import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.commands.RequiredType; import com.intellectualcrafters.plot.commands.RequiredType;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.util.*; import com.intellectualcrafters.plot.util.EventUtil;
import com.intellectualcrafters.plot.util.ExpireManager;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.PlotGamemode;
import com.intellectualcrafters.plot.util.PlotWeather;
import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.CommandCaller; import com.plotsquared.general.commands.CommandCaller;
import java.util.HashMap;
import java.util.*; import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -16,7 +24,6 @@ import java.util.concurrent.atomic.AtomicInteger;
* - Can cast to: BukkitPlayer / SpongePlayer, which are the current implementations<br> * - Can cast to: BukkitPlayer / SpongePlayer, which are the current implementations<br>
*/ */
public abstract class PlotPlayer implements CommandCaller { public abstract class PlotPlayer implements CommandCaller {
private Map<String, byte[]> metaMap = new HashMap<>(); private Map<String, byte[]> metaMap = new HashMap<>();
/** /**
@ -389,6 +396,11 @@ public abstract class PlotPlayer implements CommandCaller {
PS.get().IMP.unregister(this); PS.get().IMP.unregister(this);
} }
/**
* Get the amount of clusters a player owns in the specific world
* @param world
* @return
*/
public int getPlayerClusterCount(final String world) { public int getPlayerClusterCount(final String world) {
final UUID uuid = getUUID(); final UUID uuid = getUUID();
int count = 0; int count = 0;
@ -400,6 +412,10 @@ public abstract class PlotPlayer implements CommandCaller {
return count; return count;
} }
/**
* Get the amount of clusters a player owns
* @return
*/
public int getPlayerClusterCount() { public int getPlayerClusterCount() {
final AtomicInteger count = new AtomicInteger(); final AtomicInteger count = new AtomicInteger();
PS.get().foreachPlotArea(new RunnableVal<PlotArea>() { PS.get().foreachPlotArea(new RunnableVal<PlotArea>() {
@ -411,6 +427,11 @@ public abstract class PlotPlayer implements CommandCaller {
return count.get(); return count.get();
} }
/**
* Return a Set of all plots a player owns
* @param world
* @return
*/
public Set<Plot> getPlots(String world) { public Set<Plot> getPlots(String world) {
UUID uuid = getUUID(); UUID uuid = getUUID();
HashSet<Plot> plots = new HashSet<>(); HashSet<Plot> plots = new HashSet<>();

View File

@ -1,14 +1,12 @@
package com.intellectualcrafters.plot.object; package com.intellectualcrafters.plot.object;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
public class Rating { public class Rating {
/** /**
* This is a map of the rating category to the rating value * This is a map of the rating category to the rating value
*/ */
@ -79,5 +77,4 @@ public class Rating {
} }
} }
} }

View File

@ -5,9 +5,16 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.flag.Flag; import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.FlagManager; import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.*; import com.intellectualcrafters.plot.object.LazyBlock;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.Rating;
import com.plotsquared.listener.PlayerBlockEventType; import com.plotsquared.listener.PlayerBlockEventType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;

View File

@ -554,7 +554,7 @@ public class MainUtil {
} }
/** /**
* Set a cubioid asynchronously to a set of blocks * Set a cuboid asynchronously to a set of blocks
* @param world * @param world
* @param pos1 * @param pos1
* @param pos2 * @param pos2
@ -595,7 +595,7 @@ public class MainUtil {
} }
/** /**
* Set a cuboic asynchronously to a block * Set a cuboid asynchronously to a block
* @param world * @param world
* @param pos1 * @param pos1
* @param pos2 * @param pos2
@ -626,7 +626,7 @@ public class MainUtil {
} }
/** /**
* Get the heighest block at a location * Get the highest block at a location
* @param world * @param world
* @param x * @param x
* @param z * @param z
@ -643,7 +643,7 @@ public class MainUtil {
/** /**
* Send a message to the player * Send a message to the player
* *
* @param plr Player to recieve message * @param plr Player to receive message
* @param msg Message to send * @param msg Message to send
* *
* @return true Can be used in things such as commands (return PlayerFunctions.sendMessage(...)) * @return true Can be used in things such as commands (return PlayerFunctions.sendMessage(...))
@ -786,7 +786,7 @@ public class MainUtil {
} }
final boolean build = plot.isAdded(player.getUUID()); final boolean build = plot.isAdded(player.getUUID());
final String owner = plot.owner == null ? "unowned" : getPlayerList(plot.getOwners()); final String owner = plot.getOwners().isEmpty() ? "unowned" : getPlayerList(plot.getOwners());
info = info.replaceAll("%id%", plot.getId().toString()); info = info.replaceAll("%id%", plot.getId().toString());
info = info.replaceAll("%alias%", alias); info = info.replaceAll("%alias%", alias);

Binary file not shown.