mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-11-01 02:29:17 +00:00
Merge pull request #26 from saxnbt/patch-3
maximum cope, fixed arguments
This commit is contained in:
commit
0e1991e91f
|
@ -15,23 +15,27 @@ public class Command_myadmin extends FreedomCommand {
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
||||||
final UUID uuid = sender_p.getUniqueId(); // Get the sender's uuid as a variable.
|
final UUID uuid = sender_p.getUniqueId(); // Get the sender's uuid as a variable.
|
||||||
if (args.length >= 2) {
|
if(args.length == 1) {
|
||||||
if ("setlogin".equalsIgnoreCase(args[0])) {
|
if ("clearloginmsg".equalsIgnoreCase(args[0])) {
|
||||||
final String inputMessage = StringUtils.join(args, " ", 1, args.length); // Parse the input provided.
|
|
||||||
|
|
||||||
playerMsg(ChatColor.GRAY + "Set your custom login message."); // Notify player that the login message has been set.
|
|
||||||
|
|
||||||
AdminList.getEntry(uuid).setCustomLoginMessage(inputMessage); // Set the custom login message to the value.
|
|
||||||
AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration.
|
|
||||||
|
|
||||||
AdminList.updateIndexLists(); // Update and refresh configuration.
|
|
||||||
return true;
|
|
||||||
} else if ("clearloginmsg".equalsIgnoreCase(args[0])) {
|
|
||||||
playerMsg(ChatColor.GRAY + "Cleared your custom login message."); // Notify player that the login message has been set.
|
playerMsg(ChatColor.GRAY + "Cleared your custom login message."); // Notify player that the login message has been set.
|
||||||
|
|
||||||
AdminList.getEntry(uuid).setCustomLoginMessage(""); // Set the custom login message to the value.
|
AdminList.getEntry(uuid).setCustomLoginMessage(""); // Set the custom login message to the value.
|
||||||
AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration.
|
AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration.
|
||||||
|
|
||||||
|
AdminList.updateIndexLists(); // Update and refresh configuration.
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (args.length >= 2) {
|
||||||
|
if ("setlogin".equalsIgnoreCase(args[0])) {
|
||||||
|
final String inputMessage = StringUtils.join(args, " ", 1, args.length); // Parse the input provided.
|
||||||
|
|
||||||
|
playerMsg(ChatColor.GRAY + "Set your custom login message."); // Notify player that the login message has been set.
|
||||||
|
|
||||||
|
AdminList.getEntry(uuid).setCustomLoginMessage(inputMessage); // Set the custom login message to the value.
|
||||||
|
AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration.
|
||||||
|
|
||||||
AdminList.updateIndexLists(); // Update and refresh configuration.
|
AdminList.updateIndexLists(); // Update and refresh configuration.
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue