This commit is contained in:
boy0001 2015-02-21 23:01:15 +11:00
parent 50c80ba5c4
commit 1eb0ba47b4
30 changed files with 37 additions and 69 deletions

View File

@ -1,34 +0,0 @@
package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.bukkit.BukkitPlayerFunctions;
/**
* Created 2014-11-09 for PlotSquared
*
* @author Citymonstret
*/
public class Ban extends SubCommand {
public Ban() {
super(Command.BAN, "Alias for /plot denied add", "/plot ban [player]", CommandCategory.ACTIONS, true);
}
@Override
public boolean execute(final PlotPlayer plr, final String... args) {
if (args.length < 1) {
return MainUtil.sendMessage(plr, "&cUsage: &c" + this.usage);
}
Plot plot = MainUtil.getPlot(plr.getLocation());
if (plot == null) {
return sendMessage(plr, C.NOT_IN_PLOT);
}
if (!plot.isAdded(plr.getUUID())) {
return sendMessage(plr, C.NO_PLOT_PERMS);
}
return plr.performCommand("plot denied add " + args[0]);
}
}

View File

@ -27,6 +27,7 @@ import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
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.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
@ -45,10 +46,11 @@ public class Buy extends SubCommand {
@Override @Override
public boolean execute(final PlotPlayer plr, final String... args) { public boolean execute(final PlotPlayer plr, final String... args) {
if (!PlotSquared.useEconomy) { if (PlotSquared.economy == null) {
return sendMessage(plr, C.ECON_DISABLED); return sendMessage(plr, C.ECON_DISABLED);
} }
final World world = plr.getWorld(); Location loc = plr.getLocation();
final String world = loc.getWorld();
if (!PlotSquared.isPlotWorld(world)) { if (!PlotSquared.isPlotWorld(world)) {
return sendMessage(plr, C.NOT_IN_PLOT_WORLD); return sendMessage(plr, C.NOT_IN_PLOT_WORLD);
} }
@ -62,7 +64,7 @@ public class Buy extends SubCommand {
return sendMessage(plr, C.NOT_VALID_PLOT_ID); return sendMessage(plr, C.NOT_VALID_PLOT_ID);
} }
} else { } else {
plot = BukkitPlayerFunctions.getCurrentPlot(plr); plot = MainUtil.getPlot(loc);
} }
if (plot == null) { if (plot == null) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);

View File

@ -92,7 +92,7 @@ public class Claim extends SubCommand {
if (BukkitPlayerFunctions.getPlayerPlotCount(plr.getWorld(), plr) >= BukkitPlayerFunctions.getAllowedPlots(plr)) { if (BukkitPlayerFunctions.getPlayerPlotCount(plr.getWorld(), plr) >= BukkitPlayerFunctions.getAllowedPlots(plr)) {
return sendMessage(plr, C.CANT_CLAIM_MORE_PLOTS); return sendMessage(plr, C.CANT_CLAIM_MORE_PLOTS);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (plot.hasOwner()) { if (plot.hasOwner()) {
return sendMessage(plr, C.PLOT_IS_CLAIMED); return sendMessage(plr, C.PLOT_IS_CLAIMED);
} }

View File

@ -66,7 +66,7 @@ public class Clear extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return sendMessage(plr, C.UNLINK_REQUIRED); return sendMessage(plr, C.UNLINK_REQUIRED);
} }

View File

@ -42,7 +42,7 @@ public class Comment extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }

View File

@ -38,7 +38,7 @@ public class Copy extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.copy")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.copy")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS); MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;

View File

@ -43,7 +43,7 @@ public class CreateRoadSchematic extends SubCommand {
if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) { if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) {
return sendMessage(player, C.NOT_IN_PLOT_WORLD); return sendMessage(player, C.NOT_IN_PLOT_WORLD);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(player); final Plot plot = MainUtil.getPlot(loc);
final HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); final HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld());
manager.setupRoadSchematic(plot); manager.setupRoadSchematic(plot);
MainUtil.update(BukkitUtil.getLocation(entity)); MainUtil.update(BukkitUtil.getLocation(entity));

View File

@ -24,7 +24,7 @@ public class DEOP extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasRights(plr)) { if (!plot.hasRights(plr)) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }

View File

@ -84,7 +84,7 @@ public class DebugClear extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr) || !(PlotSquared.getPlotWorld(plr.getWorld()) instanceof SquarePlotWorld)) { if (!BukkitPlayerFunctions.isInPlot(plr) || !(PlotSquared.getPlotWorld(plr.getWorld()) instanceof SquarePlotWorld)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return sendMessage(plr, C.UNLINK_REQUIRED); return sendMessage(plr, C.UNLINK_REQUIRED);
} }

View File

@ -42,7 +42,7 @@ public class Delete extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return !sendMessage(plr, C.NOT_IN_PLOT); return !sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED); return !sendMessage(plr, C.UNLINK_REQUIRED);
} }

View File

@ -50,7 +50,7 @@ public class Denied extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if ((plot == null) || !plot.hasOwner()) { if ((plot == null) || !plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED); MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false; return false;
@ -93,7 +93,7 @@ public class Denied extends SubCommand {
} }
final Player player = UUIDHandler.uuidWrapper.getPlayer(uuid); final Player player = UUIDHandler.uuidWrapper.getPlayer(uuid);
if (!uuid.equals(DBFunc.everyone) && (player != null) && player.isOnline()) { if (!uuid.equals(DBFunc.everyone) && (player != null) && player.isOnline()) {
final Plot pl = BukkitPlayerFunctions.getCurrentPlot(player); final Plot pl = MainUtil.getPlot(loc);
if ((pl != null) && pl.id.equals(plot.id)) { if ((pl != null) && pl.id.equals(plot.id)) {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.YOU_BE_DENIED); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.YOU_BE_DENIED);
player.teleport(player.getWorld().getSpawnLocation()); player.teleport(player.getWorld().getSpawnLocation());

View File

@ -56,7 +56,7 @@ public class FlagCmd extends SubCommand {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.COMMAND_SYNTAX, "/plot flag <set|remove|add|list|info>"); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.COMMAND_SYNTAX, "/plot flag <set|remove|add|list|info>");
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(player); final Plot plot = MainUtil.getPlot(loc);
if (plot == null) { if (plot == null) {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT);
return false; return false;

View File

@ -48,7 +48,7 @@ public class Helpers extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if ((plot == null) || !plot.hasOwner()) { if ((plot == null) || !plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED); MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false; return false;

View File

@ -54,7 +54,7 @@ public class Inbox extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if ((plot != null) && !plot.hasOwner()) { if ((plot != null) && !plot.hasOwner()) {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;

View File

@ -66,7 +66,7 @@ public class Info extends SubCommand {
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT); MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT);
return false; return false;
} }
plot = BukkitPlayerFunctions.getCurrentPlot(player); plot = MainUtil.getPlot(loc);
} else { } else {
if (args.length < 2) { if (args.length < 2) {
MainUtil.sendMessage(null, C.INFO_SYNTAX_CONSOLE); MainUtil.sendMessage(null, C.INFO_SYNTAX_CONSOLE);

View File

@ -42,7 +42,7 @@ public class Kick extends SubCommand {
MainUtil.sendMessage(plr, "You're not in a plot."); MainUtil.sendMessage(plr, "You're not in a plot.");
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.kick")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.kick")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS); MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;
@ -56,7 +56,7 @@ public class Kick extends SubCommand {
return false; return false;
} }
final Player player = Bukkit.getPlayer(args[0]); final Player player = Bukkit.getPlayer(args[0]);
if (!player.getWorld().equals(plr.getWorld()) || !BukkitPlayerFunctions.isInPlot(player) || (BukkitPlayerFunctions.getCurrentPlot(player) == null) || !BukkitPlayerFunctions.getCurrentPlot(player).equals(plot)) { if (!player.getWorld().equals(plr.getWorld()) || !BukkitPlayerFunctions.isInPlot(player) || (MainUtil.getPlot(loc) == null) || !MainUtil.getPlot(loc).equals(plot)) {
MainUtil.sendMessage(plr, C.INVALID_PLAYER.s().replaceAll("%player%", args[0])); MainUtil.sendMessage(plr, C.INVALID_PLAYER.s().replaceAll("%player%", args[0]));
return false; return false;
} }

View File

@ -78,7 +78,7 @@ public class Merge extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if ((plot == null) || !plot.hasOwner()) { if ((plot == null) || !plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED); MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false; return false;

View File

@ -44,7 +44,7 @@ public class MusicSubcommand extends SubCommand {
sendMessage(player, C.NOT_IN_PLOT); sendMessage(player, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(player); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasRights(player)) { if (!plot.hasRights(player)) {
sendMessage(player, C.NO_PLOT_PERMS); sendMessage(player, C.NO_PLOT_PERMS);
return true; return true;

View File

@ -24,7 +24,7 @@ public class OP extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasRights(plr)) { if (!plot.hasRights(plr)) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }

View File

@ -38,7 +38,7 @@ public class Paste extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.paste")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.paste")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS); MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;

View File

@ -47,7 +47,7 @@ public class Rate extends SubCommand {
sendMessage(plr, C.NOT_IN_PLOT); sendMessage(plr, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
sendMessage(plr, C.RATING_NOT_OWNED); sendMessage(plr, C.RATING_NOT_OWNED);
return true; return true;

View File

@ -98,7 +98,7 @@ public class Schematic extends SubCommand {
} }
final int x; final int x;
final int z; final int z;
final Plot plot2 = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot2 = MainUtil.getPlot(loc);
final Dimension dem = schematic.getSchematicDimension(); final Dimension dem = schematic.getSchematicDimension();
final Location bot = MainUtil.getPlotBottomLoc(plr.getWorld(), plot2.id).add(1, 0, 1); final Location bot = MainUtil.getPlotBottomLoc(plr.getWorld(), plot2.id).add(1, 0, 1);
final int length2 = MainUtil.getPlotWidth(plr.getWorld(), plot2.id); final int length2 = MainUtil.getPlotWidth(plr.getWorld(), plot2.id);
@ -165,7 +165,7 @@ public class Schematic extends SubCommand {
} }
final int l1 = schematic.getSchematicDimension().getX(); final int l1 = schematic.getSchematicDimension().getX();
final int l2 = schematic.getSchematicDimension().getZ(); final int l2 = schematic.getSchematicDimension().getZ();
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
final int length = MainUtil.getPlotWidth(plr.getWorld(), plot.id); final int length = MainUtil.getPlotWidth(plr.getWorld(), plot.id);
if ((l1 < length) || (l2 < length)) { if ((l1 < length) || (l2 < length)) {
sendMessage(plr, C.SCHEMATIC_INVALID, String.format("Wrong size (x: %s, z: %d) vs %d ", l1, l2, length)); sendMessage(plr, C.SCHEMATIC_INVALID, String.format("Wrong size (x: %s, z: %d) vs %d ", l1, l2, length));
@ -251,7 +251,7 @@ public class Schematic extends SubCommand {
sendMessage(plr, C.NOT_IN_PLOT); sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot myplot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot myplot = MainUtil.getPlot(loc);
if (!myplot.hasRights(plr)) { if (!myplot.hasRights(plr)) {
sendMessage(plr, C.NO_PLOT_PERMS); sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;

View File

@ -68,7 +68,7 @@ public class Set extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasOwner()) { if (!plot.hasOwner()) {
sendMessage(plr, C.PLOT_NOT_CLAIMED); sendMessage(plr, C.PLOT_NOT_CLAIMED);
return false; return false;

View File

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

View File

@ -53,7 +53,7 @@ public class Swap extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return false; return false;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.swap")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.swap")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS); MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false; return false;

View File

@ -49,7 +49,7 @@ public class Trusted extends SubCommand {
MainUtil.sendMessage(plr, C.NOT_IN_PLOT); MainUtil.sendMessage(plr, C.NOT_IN_PLOT);
return true; return true;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if ((plot == null) || !plot.hasOwner()) { if ((plot == null) || !plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED); MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false; return false;

View File

@ -24,7 +24,7 @@ public class Unban extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!plot.hasRights(plr)) { if (!plot.hasRights(plr)) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }

View File

@ -44,7 +44,7 @@ public class Unclaim extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return !sendMessage(plr, C.NOT_IN_PLOT); return !sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) { if (!BukkitPlayerFunctions.getTopPlot(plr.getWorld(), plot).equals(BukkitPlayerFunctions.getBottomPlot(plr.getWorld(), plot))) {
return !sendMessage(plr, C.UNLINK_REQUIRED); return !sendMessage(plr, C.UNLINK_REQUIRED);
} }

View File

@ -54,7 +54,7 @@ public class Unlink extends SubCommand {
if (!BukkitPlayerFunctions.isInPlot(plr)) { if (!BukkitPlayerFunctions.isInPlot(plr)) {
return sendMessage(plr, C.NOT_IN_PLOT); return sendMessage(plr, C.NOT_IN_PLOT);
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(plr); final Plot plot = MainUtil.getPlot(loc);
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.unlink")) { if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.unlink")) {
return sendMessage(plr, C.NO_PLOT_PERMS); return sendMessage(plr, C.NO_PLOT_PERMS);
} }

View File

@ -99,7 +99,7 @@ public class ForceFieldListener implements Listener {
if (!BukkitPlayerFunctions.isInPlot(player)) { if (!BukkitPlayerFunctions.isInPlot(player)) {
return; return;
} }
final Plot plot = BukkitPlayerFunctions.getCurrentPlot(player); final Plot plot = MainUtil.getPlot(loc);
if ((FlagManager.getPlotFlag(plot, "forcefield") != null) && FlagManager.getPlotFlag(plot, "forcefield").getValue().equals("true")) { if ((FlagManager.getPlotFlag(plot, "forcefield") != null) && FlagManager.getPlotFlag(plot, "forcefield").getValue().equals("true")) {
if (!PlotListener.booleanFlag(plot, "forcefield", false)) { if (!PlotListener.booleanFlag(plot, "forcefield", false)) {
UUID uuid = UUIDHandler.getUUID(player); UUID uuid = UUIDHandler.getUUID(player);