1.2.0: Remove unnecessary events, use yml as a config
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package moe.sob.commands;
|
||||
|
||||
import moe.sob.Main;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class SetGreetMessageCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args[0].isBlank()) {
|
||||
sender.sendMessage("Insufficient arguments.");
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
String greetMessage = String.join(" ", args);
|
||||
Main.configR.set("server.greet_message", greetMessage);
|
||||
Main.configR.save(Main.config);
|
||||
|
||||
sender.sendMessage("Changed greet message successfully.");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user