@@ -64,7 +64,6 @@ public class ParallelChat extends ParallelModule {
6464
6565 private final FileConfiguration bannedWordsConfig = new YamlConfiguration ();
6666 public List <String > bannedWords = new ArrayList <>();
67- public List <String > allowedWords = new ArrayList <>();
6867
6968 public List <Component > autoMessages = new ArrayList <>();
7069
@@ -176,7 +175,6 @@ UUID varchar(36) not null,
176175 }
177176
178177 this .bannedWords = bannedWordsConfig .getStringList ("Banned-Words" );
179- this .allowedWords = bannedWordsConfig .getStringList ("Whitelisted-Words" );
180178 ParallelUtils .log (Level .INFO , "ParallelChat: Loaded " + bannedWords .size () + " banned words." );
181179
182180 ConfigurationSection groups = puPlugin .getConfig ().getConfigurationSection ("group-formats" );
@@ -223,8 +221,8 @@ UUID varchar(36) not null,
223221
224222
225223 try {
226- this .chatLogWriter = Files .newBufferedWriter (Path .of (puPlugin .getDataFolder ().getAbsolutePath () + "/chat_log.txt" ), StandardCharsets .UTF_8 , StandardOpenOption .WRITE );
227- this .cmdLogWriter = Files .newBufferedWriter (Path .of (puPlugin .getDataFolder ().getAbsolutePath () + "/command_log.txt" ), StandardCharsets .UTF_8 , StandardOpenOption .WRITE );
224+ this .chatLogWriter = Files .newBufferedWriter (Path .of (puPlugin .getDataFolder ().getAbsolutePath () + "/chat_log.txt" ), StandardCharsets .UTF_8 , StandardOpenOption .CREATE , StandardOpenOption . WRITE );
225+ this .cmdLogWriter = Files .newBufferedWriter (Path .of (puPlugin .getDataFolder ().getAbsolutePath () + "/command_log.txt" ), StandardCharsets .UTF_8 , StandardOpenOption .CREATE , StandardOpenOption . WRITE );
228226 }
229227 catch (IOException e ) {
230228 ParallelUtils .log (Level .SEVERE , "Failed to open writer to loggers!" );
@@ -257,6 +255,8 @@ UUID varchar(36) not null,
257255 puPlugin .getCommand ("formats" ).setExecutor (new ParallelFormats ());
258256 puPlugin .getCommand ("dnd" ).setExecutor (new ParallelDoNotDisturb ());
259257 puPlugin .getCommand ("reloademojis" ).setExecutor (new ParallelReloadEmojis ());
258+ puPlugin .getCommand ("banword" ).setExecutor (new ParallelBanWord ());
259+ puPlugin .getCommand ("allowword" ).setExecutor (new ParallelAllowWord ());
260260
261261 this .chatroomCommands = new ChatroomCommands ();
262262 puPlugin .getCommand ("chatroom" ).setExecutor (chatroomCommands );
@@ -316,6 +316,15 @@ public void onDisable() {
316316
317317 // save chatrooms
318318 chatRoomManager .saveChatroomsToFile ();
319+
320+ // save banned words list in case any words were added or removed
321+ bannedWordsConfig .set ("Banned-Words" , bannedWords );
322+ try {
323+ bannedWordsConfig .save (new File (puPlugin .getDataFolder (), "bannedwords.yml" ));
324+ } catch (IOException e ) {
325+ ParallelUtils .log (Level .SEVERE , "Failed to save banned words to file!" );
326+ e .printStackTrace ();
327+ }
319328 }
320329
321330 @ Override
0 commit comments