dunno if it works
This commit is contained in:
generated
-1
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="1">
|
||||
|
||||
generated
+1
@@ -2,6 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/cf.sobrooms.notifyonstart.main.iml" filepath="$PROJECT_DIR$/.idea/modules/cf.sobrooms.notifyonstart.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/notifyonstart.main.iml" filepath="$PROJECT_DIR$/.idea/modules/notifyonstart.main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
generated
+12
-7
@@ -5,7 +5,11 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ce97b9f5-6785-4670-b350-12f90ab9ea27" name="Changes" comment="wrong version number">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cf/sobrooms/commands/SetLoggingModeCommand.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/cf/sobrooms/events/player/PlayerJoin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cf/sobrooms/events/player/PlayerJoin.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -44,18 +48,19 @@
|
||||
"associatedIndex": 8
|
||||
}</component>
|
||||
<component name="ProjectId" id="2VtRIra79d9tkHTc8fsXlFQRFWj" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RunManager">
|
||||
<configuration name="notify-on-start [build]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
|
||||
<ExternalSystemSettings>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user