Skip to content

Commit

Permalink
Update WhitelistCommand.java
Browse files Browse the repository at this point in the history
  • Loading branch information
CptGummiball committed Sep 12, 2024
1 parent eb00d4d commit f2dc0f6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/org/cptgummiball/whitelister/WhitelistCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cptgummiball.whitelister;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
Expand All @@ -14,7 +13,7 @@
import java.util.UUID;

public class WhitelistCommand implements CommandExecutor, TabCompleter {
private final WhitelistManager whitelistManager = null;
private WhitelistManager whitelistManager;
private final Whitelister plugin;

public WhitelistCommand(Whitelister plugin) {
Expand All @@ -24,7 +23,7 @@ public WhitelistCommand(Whitelister plugin) {

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (args.length == 0 || args[0].equalsIgnoreCase("list")) {

Expand Down Expand Up @@ -60,9 +59,9 @@ private void listPendingApplications(Player player) {
String appList = plugin.getConfig().getString("messages.application_list", null);
Map<String, UUID> applications = whitelistManager.getPendingApplications();
if (applications.isEmpty()) {
player.sendMessage(ChatColor.RED + noApp);
player.sendMessage(noApp);
} else {
player.sendMessage(ChatColor.GREEN + appList);
player.sendMessage(appList);
for (String username : applications.keySet()) {
player.sendMessage("- " + username);
}
Expand All @@ -75,9 +74,9 @@ private void acceptApplication(Player player, String username) {
Map<String, UUID> applications = whitelistManager.getPendingApplications();
if (applications.containsKey(username)) {
whitelistManager.acceptApplication(username);
player.sendMessage(ChatColor.GREEN + appAccept.replace("{username}", username));
player.sendMessage(appAccept.replace("{username}", username));
} else {
player.sendMessage(ChatColor.RED + noAppFound.replace("{username}", username));
player.sendMessage(noAppFound.replace("{username}", username));
}
}
}

0 comments on commit f2dc0f6

Please sign in to comment.