diff --git a/.idea/misc.xml b/.idea/misc.xml index 279d325..86cb690 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/modules.xml b/.idea/modules.xml index 5b6c3b4..95d3b5b 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,6 +2,7 @@ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7d29752..74ed61e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,11 @@ + + + + + - { - "keyToString": { - "RunOnceActivity.OpenProjectViewOnStart": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "SHARE_PROJECT_CONFIGURATION_FILES": "true", - "git-widget-placeholder": "main" + +}]]> diff --git a/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java b/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java index 089e758..bfe282f 100644 --- a/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java +++ b/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java @@ -1,6 +1,7 @@ package cf.sobrooms.commands; import cf.sobrooms.Main; +import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -12,17 +13,24 @@ import java.io.IOException; public class SetLoggingModeCommand implements CommandExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args[0].isBlank()) { - sender.sendMessage("Please only provide true or false."); + sender.sendMessage("Please only provide true or false in the command arguments."); return false; } else { if (args[0].equals("true") || args[0].equals("false")) { try { + FileWriter writer = new FileWriter(Main.isLoggingConfig); writer.write(args[0]); writer.close(); System.out.println("Wrote to config, closing writer..."); sender.sendMessage(ChatColor.RED + "" + ChatColor.ITALIC + "Changes will only apply once the server has restarted."); - sender.sendMessage(ChatColor.RED + "" + ChatColor.ITALIC + "Restart your server if you would like to apply the changes."); + String status = ""; + if (args[0].equals("true")) + status = "enabled"; + else if (args[0].equals("false")) + status = "disabled"; + Bukkit.broadcastMessage(ChatColor.ITALIC + "%s %s server logging.".formatted(sender.getName(), status)); + Bukkit.broadcastMessage(ChatColor.ITALIC + "Changes will only apply once the server has restarted."); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/src/main/java/cf/sobrooms/events/player/PlayerJoin.java b/src/main/java/cf/sobrooms/events/player/PlayerJoin.java index 3ad8ae7..e0fd05f 100644 --- a/src/main/java/cf/sobrooms/events/player/PlayerJoin.java +++ b/src/main/java/cf/sobrooms/events/player/PlayerJoin.java @@ -24,6 +24,8 @@ public class PlayerJoin implements Listener { .setColor(Color.BLUE); notify.addEmbed(embedObject); try { + if (!player.hasPlayedBefore()) + player.sendMessage("Welcome to the server!"); notify.execute(); } catch (IOException e) { throw new RuntimeException(e);