Schematic stuff

This commit is contained in:
boy0001 2015-07-25 03:37:39 +10:00
parent 2a52ad4702
commit c0101695c6
11 changed files with 385 additions and 27 deletions

View file

@ -81,7 +81,14 @@ public class SchematicCmd extends SubCommand {
final Location loc = plr.getLocation();
final Plot plot = MainUtil.getPlot(loc);
if (plot == null) {
sendMessage(plr, C.NOT_IN_PLOT);
return !sendMessage(plr, C.NOT_IN_PLOT);
}
if (!plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr, "plots.admin.command.schematic.paste")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}
if (this.running) {
@ -218,8 +225,12 @@ public class SchematicCmd extends SubCommand {
if (plot == null) {
return !sendMessage(plr, C.NOT_IN_PLOT);
}
if (!plot.isAdded(plr.getUUID())) {
sendMessage(plr, C.NO_PLOT_PERMS);
if (!plot.hasOwner()) {
MainUtil.sendMessage(plr, C.PLOT_UNOWNED);
return false;
}
if (!plot.isOwner(plr.getUUID()) && !Permissions.hasPermission(plr, "plots.admin.command.schematic.save")) {
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}
p2 = plot;