This commit is contained in:
boy0001 2015-02-21 18:30:55 +11:00
parent e3f7db4906
commit 83f7aa544d
57 changed files with 59 additions and 58 deletions

View File

@ -76,7 +76,7 @@ public class Auto extends SubCommand {
// TODO auto claim a mega plot with schematic
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
World world;
int size_x = 1;
int size_z = 1;

View File

@ -17,7 +17,7 @@ public class Ban extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return BukkitPlayerFunctions.sendMessage(plr, "&cUsage: &c" + this.usage);
}

View File

@ -46,7 +46,7 @@ public class Buy extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!PlotSquared.useEconomy) {
return sendMessage(plr, C.ECON_DISABLED);
}

View File

@ -83,7 +83,7 @@ public class Claim extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
String schematic = "";
if (args.length >= 1) {
schematic = args[0];

View File

@ -38,7 +38,7 @@ public class Clear extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
// Is console
if (args.length < 2) {

View File

@ -32,7 +32,7 @@ public class Clipboard extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!currentSelection.containsKey(plr.getName())) {
return sendMessage(plr, C.NO_CLIPBOARD);
}

View File

@ -51,7 +51,7 @@ public class Cluster extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
// list, create, delete, resize, invite, kick, leave, helpers, tp, sethome
if (args.length == 0) {
// return arguments

View File

@ -39,7 +39,7 @@ public class Comment extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT);
}

View File

@ -46,7 +46,7 @@ public class Condense extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr != null) {
BukkitPlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
return false;

View File

@ -35,7 +35,7 @@ public class Copy extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
return false;

View File

@ -36,7 +36,7 @@ public class CreateRoadSchematic extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(player)) {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT);
return false;

View File

@ -17,7 +17,7 @@ public class DEOP extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return BukkitPlayerFunctions.sendMessage(plr, "&cUsage: &c" + this.usage);
}

View File

@ -71,7 +71,7 @@ public class Database extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return sendMessage(plr, "/plot database [sqlite/mysql]");
}

View File

@ -37,7 +37,7 @@ public class Debug extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
final StringBuilder msg = new StringBuilder();
for (final C c : C.values()) {

View File

@ -73,7 +73,7 @@ public class DebugClaimTest extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
if (args.length < 3) {
return !BukkitPlayerFunctions.sendMessage(null, "If you accidentally delete your database, this command will attempt to restore all plots based on the data from the plot signs. \n\n&cMissing world arg /plot debugclaimtest {world} {PlotId min} {PlotId max}");

View File

@ -42,7 +42,7 @@ public class DebugClear extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
// Is console
if (args.length < 2) {

View File

@ -50,7 +50,7 @@ public class DebugExec extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
final List<String> allowed_params = Arrays.asList(new String[] { "stop-expire", "start-expire", "show-expired", "update-expired", "seen", "trim-check" });
if (args.length > 0) {
final String arg = args[0].toLowerCase();

View File

@ -42,7 +42,7 @@ public class DebugFixFlags extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr != null) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_CONSOLE);
return false;

View File

@ -37,7 +37,7 @@ public class DebugLoadTest extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
try {
final Field fPlots = PlotSquared.class.getDeclaredField("plots");

View File

@ -38,7 +38,7 @@ public class DebugRoadRegen extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) {
return sendMessage(player, C.NOT_IN_PLOT_WORLD);
}

View File

@ -38,7 +38,7 @@ public class DebugSaveTest extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
final ArrayList<Plot> plots = new ArrayList<Plot>();
plots.addAll(PlotSquared.getPlots());

View File

@ -39,7 +39,7 @@ public class Delete extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
return !sendMessage(plr, C.NOT_IN_PLOT);
}

View File

@ -40,7 +40,7 @@ public class Denied extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 2) {
BukkitPlayerFunctions.sendMessage(plr, C.DENIED_NEED_ARGUMENT);
return true;

View File

@ -44,7 +44,7 @@ public class FlagCmd extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
/*
* plot flag set fly true
* plot flag remove fly

View File

@ -15,7 +15,7 @@ public class Help extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
return false;
}
}

View File

@ -39,7 +39,7 @@ public class Helpers extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 2) {
BukkitPlayerFunctions.sendMessage(plr, C.HELPER_NEED_ARGUMENT);
return true;

View File

@ -46,7 +46,7 @@ public class Home extends SubCommand {
}
@Override
public boolean execute(final Player plr, String... args) {
public boolean execute(final PlotPlayer plr, String... args) {
final Plot[] plots = PlotSquared.getPlots(plr).toArray(new Plot[0]);
if (plots.length == 1) {
PlotSquared.teleportPlayer(plr, plr.getLocation(), plots[0]);

View File

@ -43,7 +43,7 @@ public class Inbox extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
boolean report = false;
if (args.length == 1) {
if (args[0].equalsIgnoreCase("reports")) {

View File

@ -52,7 +52,7 @@ public class Info extends SubCommand {
}
@Override
public boolean execute(final Player player, String... args) {
public boolean execute(final PlotPlayer player, String... args) {
World world;
Plot plot;
if (player != null) {

View File

@ -35,7 +35,7 @@ public class Inventory extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
final ArrayList<SubCommand> cmds = new ArrayList<>();
for (final SubCommand cmd : MainCommand.subCommands) {
if (cmd.permission.hasPermission(plr)) {

View File

@ -36,7 +36,7 @@ public class Kick extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
BukkitPlayerFunctions.sendMessage(plr, "You're not in a plot.");
return false;

View File

@ -74,7 +74,7 @@ public class Merge extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
return true;

View File

@ -38,7 +38,7 @@ public class Move extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr == null) {
BukkitPlayerFunctions.sendMessage(plr, "MUST BE EXECUTED BY PLAYER");
}

View File

@ -39,7 +39,7 @@ public class MusicSubcommand extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(player)) {
sendMessage(player, C.NOT_IN_PLOT);
return true;

View File

@ -17,7 +17,7 @@ public class OP extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return BukkitPlayerFunctions.sendMessage(plr, "&cUsage: &c" + this.usage);
}

View File

@ -35,7 +35,7 @@ public class Paste extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
return false;

View File

@ -53,7 +53,7 @@ public class Purge extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr != null) {
BukkitPlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
return false;

View File

@ -39,7 +39,7 @@ public class Rate extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
sendMessage(plr, C.RATING_NOT_VALID);
return true;

View File

@ -39,7 +39,7 @@ public class RegenAllRoads extends SubCommand {
}
@Override
public boolean execute(final Player player, final String... args) {
public boolean execute(final PlotPlayer player, final String... args) {
if (player != null) {
sendMessage(player, C.NOT_CONSOLE);
return false;

View File

@ -34,7 +34,7 @@ public class Reload extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
try {
// The following won't affect world generation, as that has to be
// loaded during startup unfortunately.

View File

@ -55,7 +55,7 @@ public class Schematic extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
sendMessage(plr, C.SCHEMATIC_MISSING_ARG);
return true;

View File

@ -64,7 +64,7 @@ public class Set extends SubCommand {
@SuppressWarnings("deprecation")
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);
return false;

View File

@ -51,7 +51,7 @@ public class SetOwner extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr);
if ((plot == null) || (plot.owner == null)) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT);

View File

@ -84,7 +84,7 @@ public class Setup extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
// going through setup
final String name = plr.getName();
if (!setupMap.containsKey(name)) {

View File

@ -44,7 +44,7 @@ public class Swap extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
BukkitPlayerFunctions.sendMessage(plr, C.NEED_PLOT_ID);
BukkitPlayerFunctions.sendMessage(plr, C.SWAP_SYNTAX);

View File

@ -41,7 +41,7 @@ public class TP extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
BukkitPlayerFunctions.sendMessage(plr, C.NEED_PLOT_ID);
return false;

View File

@ -35,7 +35,7 @@ public class Target extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!PlotSquared.isPlotWorld(plr.getWorld())) {
BukkitPlayerFunctions.sendMessage(plr, C.NOT_IN_PLOT_WORLD);
return false;

View File

@ -40,7 +40,7 @@ public class Template extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length != 2) {
BukkitPlayerFunctions.sendMessage(plr, C.COMMAND_SYNTAX, "/plot template <import|export> <world>");
return false;

View File

@ -61,7 +61,7 @@ public class Trim extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (plr != null) {
BukkitPlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
return false;

View File

@ -40,7 +40,7 @@ public class Trusted extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 2) {
BukkitPlayerFunctions.sendMessage(plr, C.TRUSTED_NEED_ARGUMENT);
return true;

View File

@ -17,7 +17,7 @@ public class Unban extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return BukkitPlayerFunctions.sendMessage(plr, "&cUsage: &c" + this.usage);
}

View File

@ -40,7 +40,7 @@ public class Unclaim extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
return !sendMessage(plr, C.NOT_IN_PLOT);
}

View File

@ -50,7 +50,7 @@ public class Unlink extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT);
}
@ -69,7 +69,7 @@ public class Unlink extends SubCommand {
try {
MainUtil.update(plr.getLocation());
} catch (final Exception e) {
// execute(final Player plr, final String... args) {
// execute(final PlotPlayer plr, final String... args) {
try {
PlotSquared.log("Error on: " + getClass().getMethod("execute", Player.class, String[].class).toGenericString() + ":119, when trying to use \"SetBlockFast#update\"");
} catch (final Exception ex) {

View File

@ -47,7 +47,7 @@ public class Visit extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return sendMessage(plr, C.NEED_USER);
}

View File

@ -24,6 +24,7 @@ import org.bukkit.entity.Player;
import com.intellectualcrafters.plot.BukkitMain;
import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.bukkit.BukkitPlayerFunctions;
import com.intellectualcrafters.plot.util.bukkit.PWE;
@ -33,7 +34,7 @@ public class WE_Anywhere extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (PlotSquared.worldEdit == null) {
BukkitPlayerFunctions.sendMessage(plr, "&cWorldEdit is not enabled on this server");
return false;

View File

@ -56,7 +56,7 @@ public class list extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
final StringBuilder builder = new StringBuilder();
builder.append(C.SUBCOMMAND_SET_OPTIONS_HEADER.s());

View File

@ -89,7 +89,7 @@ public class plugin extends SubCommand {
}
@Override
public boolean execute(final Player plr, final String... args) {
public boolean execute(final PlotPlayer plr, final String... args) {
Bukkit.getScheduler().runTaskAsynchronously(PlotSquared.getMain(), new Runnable() {
@Override
public void run() {