From b9c1970d20bdcce5cbad417112f353186bbddb4d Mon Sep 17 00:00:00 2001 From: Nathan Curran <30569566+Focusvity@users.noreply.github.com> Date: Tue, 16 Mar 2021 19:56:29 +1100 Subject: [PATCH 1/2] Update player's permission when opping. --- .../java/me/totalfreedom/totalfreedommod/command/Command_op.java | 1 + .../me/totalfreedom/totalfreedommod/command/Command_opall.java | 1 + .../me/totalfreedom/totalfreedommod/command/Command_opme.java | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java index 93ff8397..a45c9c43 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_op.java @@ -41,6 +41,7 @@ public class Command_op extends FreedomCommand matchedPlayerNames.add(player.getName()); player.setOp(true); player.sendMessage(FreedomCommand.YOU_ARE_OP); + plugin.rm.updateDisplay(player); } } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opall.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opall.java index 029c5751..9436c8dd 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opall.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opall.java @@ -22,6 +22,7 @@ public class Command_opall extends FreedomCommand { player.setOp(true); player.sendMessage(FreedomCommand.YOU_ARE_OP); + plugin.rm.updateDisplay(player); } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opme.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opme.java index eaadd8fc..b2b979cc 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opme.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_opme.java @@ -17,6 +17,7 @@ public class Command_opme extends FreedomCommand FUtil.adminAction(sender.getName(), "Opping " + sender.getName(), false); sender.setOp(true); sender.sendMessage(FreedomCommand.YOU_ARE_OP); + plugin.rm.updateDisplay(playerSender); return true; } } \ No newline at end of file From eb05b0504241a4b0d1a2464c76421e4c15c24ee0 Mon Sep 17 00:00:00 2001 From: Nathan Curran <30569566+Focusvity@users.noreply.github.com> Date: Tue, 16 Mar 2021 20:21:31 +1100 Subject: [PATCH 2/2] Fixed FS-93 - Players no longer need to relog, just need to be opped to get permissions. - Removed redundant PlayerJoinEvent code as it's already been executed (See RankManager class). --- .../totalfreedom/totalfreedommod/command/Command_deop.java | 1 + .../totalfreedommod/command/Command_deopall.java | 1 + .../totalfreedommod/permissions/PermissionManager.java | 6 ------ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java index 73e18112..b9ec6b62 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deop.java @@ -40,6 +40,7 @@ public class Command_deop extends FreedomCommand matchedPlayerNames.add(player.getName()); player.setOp(false); player.sendMessage(FreedomCommand.YOU_ARE_NOT_OP); + plugin.rm.updateDisplay(player); } } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deopall.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deopall.java index c73e088a..4a8ec1f8 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deopall.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_deopall.java @@ -20,6 +20,7 @@ public class Command_deopall extends FreedomCommand { player.setOp(false); player.sendMessage(FreedomCommand.YOU_ARE_NOT_OP); + plugin.rm.updateDisplay(player); } return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java b/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java index a3f23fb8..31a32655 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java @@ -117,10 +117,4 @@ public class PermissionManager extends FreedomService setPermissions(player); } } - - @EventHandler(priority = EventPriority.NORMAL) - public void onPlayerJoin(PlayerJoinEvent event) - { - setPermissions(event.getPlayer()); - } } \ No newline at end of file