From 0f2847b68468f5c84faa39794284650c7998aaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E5=82=91?= Date: Thu, 12 Jan 2023 22:20:30 +0800 Subject: [PATCH] Add save data changes --- .../github/jie65535/openchat/commands/ChatPlayerCommands.java | 2 ++ .../github/jie65535/openchat/commands/ChatServerCommands.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/jie65535/openchat/commands/ChatPlayerCommands.java b/src/main/java/com/github/jie65535/openchat/commands/ChatPlayerCommands.java index 2dc7e76..2a5fa81 100644 --- a/src/main/java/com/github/jie65535/openchat/commands/ChatPlayerCommands.java +++ b/src/main/java/com/github/jie65535/openchat/commands/ChatPlayerCommands.java @@ -20,9 +20,11 @@ public class ChatPlayerCommands implements CommandHandler { var set = OpenChatPlugin.getInstance().getData().offChatPlayers; if (subCommand.equals("on")) { set.remove(targetPlayer.getUid()); + OpenChatPlugin.getInstance().saveData(); CommandHandler.sendMessage(sender, "OK"); } else if (subCommand.equals("off")) { set.add(targetPlayer.getUid()); + OpenChatPlugin.getInstance().saveData(); CommandHandler.sendMessage(sender, "OK"); } } diff --git a/src/main/java/com/github/jie65535/openchat/commands/ChatServerCommands.java b/src/main/java/com/github/jie65535/openchat/commands/ChatServerCommands.java index 6610ced..2c57b99 100644 --- a/src/main/java/com/github/jie65535/openchat/commands/ChatServerCommands.java +++ b/src/main/java/com/github/jie65535/openchat/commands/ChatServerCommands.java @@ -21,7 +21,7 @@ public class ChatServerCommands implements CommandHandler { } var plugin = OpenChatPlugin.getInstance(); - var subCommand = args.get(0); + var subCommand = args.get(0).toLowerCase(); switch (subCommand) { case "on" -> { plugin.getConfig().serverChatEnabled = true;