Skip to content
Permalink
Browse files

- Made /ta ? require the towny.admin permission node.

    - Closes ticket #3531.
  • Loading branch information
LlmDl committed Dec 1, 2019
1 parent 60e492c commit c4766bb9dd949e3dae71ec698891d668faed4660
Showing with 9 additions and 6 deletions.
  1. +3 −1 resources/ChangeLog.txt
  2. +6 −5 src/com/palmergames/bukkit/towny/command/TownyAdminCommand.java
@@ -3912,4 +3912,6 @@ v0.92.0.11:
- This is similar effect to Event War's 'winner_takes_ownership_of_townblocks', but does not mess with bonus plots.
- Adds the 'msg_war_defender_keeps_claims' language string to notify the towns that capturing the townblock is disabled.
- Closes ticket #3514
- chinese.yml updated to 0.66 by qsefthuopq
- chinese.yml updated to 0.66 by qsefthuopq
- Made /ta ? require the towny.admin permission node.
- Closes ticket #3531.
@@ -142,9 +142,9 @@ private Object getSender() {

public boolean parseTownyAdminCommand(String[] split) throws TownyException {
TownyUniverse townyUniverse = TownyUniverse.getInstance();
if (getSender()==player && !townyUniverse.getPermissionSource().testPermission(player, PermissionNodes.TOWNY_ADMIN.getNode()))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));
if (split.length == 0) {
if (getSender()==player && !townyUniverse.getPermissionSource().testPermission(player, PermissionNodes.TOWNY_ADMIN.getNode()))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));
buildTAPanel();
for (String line : ta_panel) {
sender.sendMessage(line);
@@ -849,6 +849,10 @@ public void parseAdminNationCommand(String[] split) throws TownyException {

public void adminSet(String[] split) throws TownyException {
TownyUniverse townyUniverse = TownyUniverse.getInstance();

if (!townyUniverse.getPermissionSource().testPermission(player, PermissionNodes.TOWNY_COMMAND_TOWNYADMIN_SET.getNode(split[0].toLowerCase())))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));

if (split.length == 0) {
sender.sendMessage(ChatTools.formatTitle("/townyadmin set"));
// TODO: player.sendMessage(ChatTools.formatCommand("",
@@ -863,9 +867,6 @@ public void adminSet(String[] split) throws TownyException {
return;
}

if (!townyUniverse.getPermissionSource().testPermission(player, PermissionNodes.TOWNY_COMMAND_TOWNYADMIN_SET.getNode(split[0].toLowerCase())))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));

if (split[0].equalsIgnoreCase("mayor")) {
if (!townyUniverse.getPermissionSource().testPermission(player, PermissionNodes.TOWNY_COMMAND_TOWNYADMIN_SET_MAYOR.getNode(split[0].toLowerCase())))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));

0 comments on commit c4766bb

Please sign in to comment.
You can’t perform that action at this time.