Skip to content

Commit

Permalink
Basic holders
Browse files Browse the repository at this point in the history
  • Loading branch information
TonimatasDEV committed Feb 27, 2024
1 parent e4de063 commit 9307c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public void onCommandPreProcess(PlayerCommandPreprocessEvent event) {
// Check if the player is in the disabled world
if (PerWorldUtils.getDisabledWorlds(plugin).contains(event.getPlayer().getWorld().getName())) {
// Send block message to the player.
event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', Objects.requireNonNull(PerWorldPlugins.getInstance().getConfig().getString("disabledCommandMessage"))));
event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&',
Objects.requireNonNull(Objects.requireNonNull(PerWorldPlugins.getInstance().getConfig().getString("disabledCommandMessage"))
.replaceAll("\\{world}", event.getPlayer().getWorld().getName())
.replaceAll("\\{player}", event.getPlayer().getName()))));
// Cancel the event.
event.setCancelled(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateChecker: true
# Disable or Enable the bStats metrics.
metrics: true
# Message send when execute blocked plugin command.
disabledCommandMessage: "&4[Server]: &fThis command is disabled for this world."
disabledCommandMessage: "&4[Server]: &f{player} this command is disabled for {world}."

# If false, the plugins/groups added in the world will work.
# If true, it will be reversed.
Expand Down

0 comments on commit 9307c60

Please sign in to comment.