refactor: Use player friendly done message on restricted building (#3309)

This commit is contained in:
Alex 2021-11-02 14:32:04 +01:00 committed by GitHub
parent 7263290bbe
commit 48c7a3e94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 12 deletions

View File

@ -318,8 +318,7 @@ public class BlockEventListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
TranslatableCaption.of("done.building_restricted")
);
event.setCancelled(true);
return;
@ -401,8 +400,7 @@ public class BlockEventListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
TranslatableCaption.of("done.building_restricted")
);
event.setCancelled(true);
return;

View File

@ -985,8 +985,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
TranslatableCaption.of("done.building_restricted")
);
e.setCancelled(true);
return;
@ -1258,8 +1257,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
TranslatableCaption.of("done.building_restricted")
);
event.setCancelled(true);
}
@ -1332,8 +1330,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
TranslatableCaption.of("done.building_restricted")
);
event.setCancelled(true);
}

View File

@ -178,8 +178,7 @@ public class BukkitEntityUtil {
if (!Permissions
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
plotPlayer.sendMessage(
TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
TranslatableCaption.of("done.building_restricted")
);
return false;
}

View File

@ -94,6 +94,7 @@
"done.done_insufficient_complexity": "<prefix><red>This plot is too simple. Please add more detail before using this command.</red>",
"done.done_success": "<prefix><gold>Successfully marked this plot as done.</gold>",
"done.done_removed": "<prefix><gray>You may now continue building in this plot.</gray>",
"done.building_restricted": "<prefix><gray>You can't build on plots marked as done.</gray>",
"ratings.ratings_purged": "<prefix><gray>Purged ratings for this plot.</gray>",
"ratings.rating_not_valid": "<prefix><red>You need to specify a number between 1 and 10.</red>",
"ratings.rating_already_exists": "<prefix><gray>You have already rated plot <plot>.</gray>",