package com.devotedmc.ExilePearl.command;

import com.devotedmc.ExilePearl.ExilePearl;
import com.devotedmc.ExilePearl.ExilePearlPlugin;
import com.devotedmc.ExilePearl.util.Permission;

public class CmdAdminCheckExiled extends PearlCommand {

	public CmdAdminCheckExiled(ExilePearlPlugin plugin) {
		super(plugin);
		this.aliases.add("check");

		this.setHelpShort("Checks if a player is exiled");
		
		this.requiredArgs.add("player");
		
		this.permission = Permission.ADMIN.node;
		this.visibility = CommandVisibility.SECRET;
	}

	@Override
	public void perform() {
		String name = argAsString(0);
		
		ExilePearl pearl = pearlApi.getPearl(name);
		if (pearl == null) {
			msg("<i>No pearl was found with the name <c>%s", name);
			return;
		}
		msg("<g>Found exile pearl for player %s", name);

		for (String s : pearlApi.getLoreGenerator().generateLore(pearl)) {
			if (s.contains("Commands")) {
				return;
			}
			msg(s);
		}
	}
}

@@ -740,16 +740,130 @@
 rn;%0A%09%09%7D%0A
+%09%09if(pearl.getFreedOffline()) %7B%0A%09%09%09msg(%22%3Ci%3E%25s has been freed but hasn't logged in yet.%22, name);%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A
 %09%09msg(%22%3C

update check command