From 02e1df6e9c1671bd59e345c49bd65fb3aedd4ff8 Mon Sep 17 00:00:00 2001 From: Nathan Curran <30569566+Focusvity@users.noreply.github.com> Date: Sun, 7 Mar 2021 15:43:08 +1100 Subject: [PATCH 1/3] Save data when removing a player from rank (FS-134) --- .gitignore | 6 +----- .../me/totalfreedom/tfguilds/command/SetRankSubcommand.java | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 89a26f4..166641b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ -/.idea/artifacts -/.idea/libraries -/.idea/workspace.xml -/.idea/modules.xml -/.idea/uiDesigner.xml +/.idea/ target/ out/ \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java index b4ac17e..2527f70 100644 --- a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java +++ b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java @@ -57,7 +57,7 @@ public class SetRankSubcommand extends Common implements CommandExecutor } String name = StringUtils.join(args, " ", 2, args.length); - if (name.toLowerCase().equals("none")) + if (name.equalsIgnoreCase("none")) { for (GuildRank gr : guild.getRanks()) { @@ -80,6 +80,7 @@ public class SetRankSubcommand extends Common implements CommandExecutor for (GuildRank gr : guild.getRanks()) { gr.getMembers().remove(r.getUniqueId()); + gr.save(); } rank.getMembers().add(r.getUniqueId()); From c9972c2879a5e49815733753805969a205b85404 Mon Sep 17 00:00:00 2001 From: Nathan Curran <30569566+Focusvity@users.noreply.github.com> Date: Sun, 7 Mar 2021 15:53:19 +1100 Subject: [PATCH 2/3] Added another missed save statement --- .../java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java index 2527f70..71fbecf 100644 --- a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java +++ b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java @@ -62,6 +62,7 @@ public class SetRankSubcommand extends Common implements CommandExecutor for (GuildRank gr : guild.getRanks()) { gr.getMembers().remove(r.getUniqueId()); + gr.save(); } sender.sendMessage(tl(PREFIX + "Removed the rank of %s%" + r.getName() + "%p% in your guild.")); From a0075b2163c4a449f007a100d8d11187fc97c3fd Mon Sep 17 00:00:00 2001 From: Nathan Curran <30569566+Focusvity@users.noreply.github.com> Date: Sun, 7 Mar 2021 19:17:44 +1100 Subject: [PATCH 3/3] Use toLowerCase instead --- .../me/totalfreedom/tfguilds/command/SetRankSubcommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java index 71fbecf..967a3ec 100644 --- a/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java +++ b/src/main/java/me/totalfreedom/tfguilds/command/SetRankSubcommand.java @@ -56,8 +56,8 @@ public class SetRankSubcommand extends Common implements CommandExecutor return true; } - String name = StringUtils.join(args, " ", 2, args.length); - if (name.equalsIgnoreCase("none")) + String name = StringUtils.join(args, " ", 2, args.length).toLowerCase(); + if (name.equals("none")) { for (GuildRank gr : guild.getRanks()) {