mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 07:46:31 +00:00
commit
a7cc9596f4
1 changed files with 4 additions and 11 deletions
|
@ -10,14 +10,14 @@ import org.bukkit.entity.Player;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME)
|
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME)
|
||||||
@CommandParameters(description = "Manages your admin login message and other utilities.", usage = "/<command> <clear <variable> | setloginmessage <message>>")
|
@CommandParameters(description = "Manages your admin login message and other utilities.", usage = "/<command> <clearloginmsg | setlogin <message>>")
|
||||||
public class Command_myadmin extends FreedomCommand {
|
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.
|
||||||
if (args.length >= 2) {
|
if (args.length >= 2) {
|
||||||
if ("setloginmessage".equalsIgnoreCase(args[0])) {
|
if ("setlogin".equalsIgnoreCase(args[0])) {
|
||||||
final String inputMessage = StringUtils.join(args, " ", 1, args.length); // Parse the input provided.
|
final String inputMessage = StringUtils.join(args, " ", 1, args.length); // Parse the input provided.
|
||||||
final UUID uuid = sender_p.getUniqueId(); // Get the sender's uuid as a variable.
|
|
||||||
|
|
||||||
playerMsg(ChatColor.GRAY + "Set your custom login message."); // Notify player that the login message has been set.
|
playerMsg(ChatColor.GRAY + "Set your custom login message."); // Notify player that the login message has been set.
|
||||||
|
|
||||||
|
@ -26,10 +26,7 @@ public class Command_myadmin extends FreedomCommand {
|
||||||
|
|
||||||
AdminList.updateIndexLists(); // Update and refresh configuration.
|
AdminList.updateIndexLists(); // Update and refresh configuration.
|
||||||
return true;
|
return true;
|
||||||
} else if ("clear".equalsIgnoreCase(args[0])) {
|
} else if ("clearloginmsg".equalsIgnoreCase(args[0])) {
|
||||||
if("loginmessage".equals(args[1])) {
|
|
||||||
final UUID uuid = sender_p.getUniqueId(); // Get the sender's uuid as a variable.
|
|
||||||
|
|
||||||
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.
|
||||||
|
@ -40,10 +37,6 @@ public class Command_myadmin extends FreedomCommand {
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue