Don't allow edits on plots when owner is offline and player is only added (#1313)

This commit is contained in:
dordsor21
2021-10-04 13:34:40 +01:00
committed by GitHub
parent d44f297068
commit 6895234815
11 changed files with 156 additions and 55 deletions

View File

@ -944,7 +944,7 @@ public class SchematicCommands {
}
LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath());
} else {
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.manual"));
actor.print(Caption.of("fawe.cancel.reason.manual"));
}
}
//FAWE end

View File

@ -206,9 +206,9 @@ public class UtilityCommands {
desc = "Cancel your current command"
)
@CommandPermissions(value = "fawe.cancel", queued = false)
public void cancel(Actor actor) {
int cancelled = actor.cancel(false);
actor.print(Caption.of("fawe.cancel.worldedit.cancel.count", cancelled));
public void cancel(Player player) {
int cancelled = player.cancel(false);
player.print(Caption.of("fawe.cancel.count", cancelled));
}
@Command(

View File

@ -61,7 +61,7 @@ public @interface Confirm {
* (long) value;
long max = 2 << 18;
if (max != -1 && area > max) {
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm.region",
actor.print(Caption.of("fawe.cancel.reason.confirm.region",
pos1, pos2, getArgs(context), region.getHeight() * area
));
return confirm(actor, context);
@ -77,7 +77,7 @@ public @interface Confirm {
}
int max = WorldEdit.getInstance().getConfiguration().maxRadius;
if (max != -1 && value > max) {
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm.radius",
actor.print(Caption.of("fawe.cancel.reason.confirm.radius",
value, max, getArgs(context)
));
return confirm(actor, context);
@ -93,7 +93,7 @@ public @interface Confirm {
}
int max = 50; //TODO configurable, get Key.of(Method.class) @Limit
if (max != -1 && value > max) {
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm.limit",
actor.print(Caption.of("fawe.cancel.reason.confirm.limit",
value, max, getArgs(context)
));
return confirm(actor, context);
@ -107,7 +107,7 @@ public @interface Confirm {
if (checkExisting(context)) {
return true;
}
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm", Processor.getArgs(context)));
actor.print(Caption.of("fawe.cancel.reason.confirm", Processor.getArgs(context)));
return confirm(actor, context);
}
};