Merge remote-tracking branch 'origin/develop' into command_ranks

This commit is contained in:
tastybento 2018-08-12 13:46:01 -07:00
commit 67dc4eedb3
6 changed files with 22 additions and 23 deletions

View File

@ -242,8 +242,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
}
// Check perms, but only if this isn't the console
if ((sender instanceof Player) && !sender.isOp() && !cmd.getPermission().isEmpty() && !sender.hasPermission(cmd.getPermission())) {
user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", TextVariables.PERMISSION, cmd.getPermission());
user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, cmd.getPermission());
return false;
}
// Fire an event to see if this command should be cancelled
@ -747,14 +746,14 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
return;
} else {
// Player has another outstanding confirmation request that will now be cancelled
user.sendMessage("general.previous-request-cancelled");
user.sendMessage("commands.confirmation.previous-request-cancelled");
}
}
// Tell user that they need to confirm
user.sendMessage("general.confirm", "[seconds]", String.valueOf(getSettings().getConfirmationTime()));
user.sendMessage("commands.confirmation.confirm", "[seconds]", String.valueOf(getSettings().getConfirmationTime()));
// Set up a cancellation task
BukkitTask task = Bukkit.getScheduler().runTaskLater(getPlugin(), () -> {
user.sendMessage("general.request-cancelled");
user.sendMessage("commands.confirmation.request-cancelled");
toBeConfirmed.remove(user);
}, getPlugin().getSettings().getConfirmationTime() * 20L);

View File

@ -221,11 +221,11 @@ public class Flag implements Comparable<Flag> {
pib.description(d);
plugin.getRanksManager().getRanks().forEach((reference, score) -> {
if (score > RanksManager.BANNED_RANK && score < island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.blocked_rank") + user.getTranslation(reference));
pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference));
} else if (score <= RanksManager.OWNER_RANK && score > island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.allowed_rank") + user.getTranslation(reference));
pib.description(user.getTranslation("protection.panel.flag-item.allowed-rank") + user.getTranslation(reference));
} else if (score == island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.minimal_rank") + user.getTranslation(reference));
pib.description(user.getTranslation("protection.panel.flag-item.minimal-rank") + user.getTranslation(reference));
}
});
}

View File

@ -5,6 +5,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.user.User;
@ -38,8 +39,7 @@ public class CycleClick implements PanelItem.ClickHandler {
}
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id;
if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", "[permission]", reqPerm);
user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true;
}

View File

@ -8,6 +8,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
import world.bentobox.bentobox.api.user.User;
@ -40,8 +41,7 @@ public class IslandToggleClick implements ClickHandler {
}
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id;
if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", "[permission]", reqPerm);
user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true;
}

View File

@ -8,6 +8,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
import world.bentobox.bentobox.api.user.User;
@ -39,8 +40,7 @@ public class WorldToggleClick implements ClickHandler {
}
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".admin.world.settings." + id;
if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", "[permission]", reqPerm);
user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true;
}

View File

@ -12,12 +12,9 @@ meta:
general:
success: "&aSuccess!"
request-cancelled: "&cConfirmation timeout - &brequest cancelled"
previous-request-cancelled: "&6Previous confirmation request cancelled"
confirm: "&cType command again within &b[seconds]s&c to confirm"
errors:
command-cancelled: "&cCommand cancelled"
no-permission: "&cYou don't have permission to execute this command."
no-permission: "&cYou don't have the permission to execute this command (&7[permission])&c."
use-in-game: "&cThis command is only available in game."
no-team: "&cYou do not have a team!"
no-island: "&cYou do not have an island!"
@ -35,7 +32,6 @@ general:
warp-not-safe: "&cThat warp is not safe right now!"
wrong-world: "&cYou are not in the right world to do that!"
you-must-wait: "&cYou must wait [number]s before you can do that command again"
you-need: "&cYou need [permission]"
tips:
changing-obsidian-to-lava: "Changing obsidian back into lava. Be careful!"
@ -184,7 +180,11 @@ commands:
loaded-addons: "Loaded Add-Ons"
loaded-game-worlds: "Loaded Game Worlds"
addon-syntax: "&2[name] &3[version]"
game-worlds: "&2[name]"
game-worlds: "&2[name]"
confirmation:
confirm: "&cType command again within &b[seconds]s&c to confirm"
previous-request-cancelled: "&6Previous confirmation request cancelled"
request-cancelled: "&cConfirmation timeout - &brequest cancelled"
island:
go:
parameters: "[home number]"
@ -635,9 +635,9 @@ protection:
&a[description]
&7Allowed for:
allowed_rank: "&3- &a"
blocked_rank: "&3- &c"
minimal_rank: "&3- &2"
allowed-rank: "&3- &a"
blocked-rank: "&3- &c"
minimal-rank: "&3- &2"
menu-layout: "&a[description]"
setting-layout: |
&a[description]