Made list respect vanish and AFK
This commit is contained in:
@@ -13,11 +13,12 @@ import com.redstoner.annotations.Version;
|
|||||||
import com.redstoner.misc.CommandHolderType;
|
import com.redstoner.misc.CommandHolderType;
|
||||||
import com.redstoner.misc.Utils;
|
import com.redstoner.misc.Utils;
|
||||||
import com.redstoner.modules.Module;
|
import com.redstoner.modules.Module;
|
||||||
|
import com.redstoner.modules.datamanager.DataManager;
|
||||||
|
|
||||||
import net.nemez.chatapi.click.Message;
|
import net.nemez.chatapi.click.Message;
|
||||||
|
|
||||||
@Commands(CommandHolderType.File)
|
@Commands(CommandHolderType.File)
|
||||||
@Version(major = 4, minor = 0, revision = 0, compatible = 4)
|
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
|
||||||
public class List implements Module
|
public class List implements Module
|
||||||
{
|
{
|
||||||
private HashMap<String, Integer> onConsole;
|
private HashMap<String, Integer> onConsole;
|
||||||
@@ -25,7 +26,7 @@ public class List implements Module
|
|||||||
@Override
|
@Override
|
||||||
public void postEnable()
|
public void postEnable()
|
||||||
{
|
{
|
||||||
onConsole = new HashMap<String, Integer>();
|
onConsole = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "console_join")
|
@Command(hook = "console_join")
|
||||||
@@ -122,8 +123,7 @@ public class List implements Module
|
|||||||
}
|
}
|
||||||
if (!shownAnything)
|
if (!shownAnything)
|
||||||
{
|
{
|
||||||
getLogger().message(sender,
|
getLogger().message(sender, new String[] {
|
||||||
new String[] {
|
|
||||||
"Looks like I couldn't figure out what you meant. Try again with different parameters maybe?",
|
"Looks like I couldn't figure out what you meant. Try again with different parameters maybe?",
|
||||||
"Possible parameters are: &eAll&7, &eStaff&7, &eVisitor&7, &eMember&7, &eBuilder&7, &eTrusted&7, &eMit&7, &eMod&7, &eAdmin&7 and &eLead",
|
"Possible parameters are: &eAll&7, &eStaff&7, &eVisitor&7, &eMember&7, &eBuilder&7, &eTrusted&7, &eMit&7, &eMod&7, &eAdmin&7 and &eLead",
|
||||||
"You can also combine any of the parameters, like this: &eMember, Staff"});
|
"You can also combine any of the parameters, like this: &eMember, Staff"});
|
||||||
@@ -170,11 +170,25 @@ public class List implements Module
|
|||||||
{
|
{
|
||||||
if (player == null || player.canSee(p))
|
if (player == null || player.canSee(p))
|
||||||
{
|
{
|
||||||
sb.append(Utils.getName(p));
|
sb.append(Utils.getName(p) + afk(p));
|
||||||
sb.append(", ");
|
sb.append(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sb.toString().replaceAll(", $", "");
|
return sb.toString().replaceAll(", $", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String afk(Player player)
|
||||||
|
{
|
||||||
|
return DataManager.getState(player, "afk")
|
||||||
|
? (String) DataManager.getConfigOrDefault("afk", "indicator", "&7[AFK]")
|
||||||
|
: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String vanished(Player player)
|
||||||
|
{
|
||||||
|
return DataManager.getState(player, "vanished")
|
||||||
|
? (String) DataManager.getConfigOrDefault("vanish", "indivator", "&7[V]")
|
||||||
|
: "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user