mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Minor refactor and fixes.
This commit is contained in:
parent
d079990a3a
commit
f240742489
@ -36,7 +36,6 @@ import java.util.logging.Level;
|
||||
*/
|
||||
public final class RedisBungee extends Plugin implements Listener {
|
||||
private static final ServerPing.PlayerInfo[] EMPTY_PLAYERINFO = new ServerPing.PlayerInfo[]{};
|
||||
private RedisBungeeCommandSender commandSender = new RedisBungeeCommandSender();
|
||||
private static Configuration configuration;
|
||||
private JedisPool pool;
|
||||
private RedisBungee plugin;
|
||||
@ -390,7 +389,7 @@ public final class RedisBungee extends Plugin implements Listener {
|
||||
cmd = s2;
|
||||
}
|
||||
getLogger().info("Invoking command from PubSub: /" + s2);
|
||||
getProxy().getPluginManager().dispatchCommand(commandSender, cmd);
|
||||
getProxy().getPluginManager().dispatchCommand(RedisBungeeCommandSender.instance, cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,8 +22,10 @@ import java.util.Collections;
|
||||
* @author tuxed
|
||||
* @since 0.2.3
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class RedisBungeeCommandSender implements CommandSender {
|
||||
protected static RedisBungeeCommandSender instance = new RedisBungeeCommandSender();
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "RedisBungee";
|
||||
|
@ -47,7 +47,7 @@ public class RedisBungeeCommands {
|
||||
BaseComponent[] playersOnline = new ComponentBuilder("").color(ChatColor.YELLOW).append(String.valueOf(count))
|
||||
.append(" player(s) are currently online.").create();
|
||||
if (args.length > 0 && args[0].equals("showall")) {
|
||||
if (RedisBungee.getConfiguration().getBoolean("canonical-glist", false)) {
|
||||
if (RedisBungee.getConfiguration().getBoolean("canonical-glist", true)) {
|
||||
Multimap<String, String> serverToPlayers = HashMultimap.create();
|
||||
for (String p : RedisBungee.getApi().getPlayersOnline()) {
|
||||
ServerInfo si = RedisBungee.getApi().getServerFor(p);
|
||||
|
Loading…
Reference in New Issue
Block a user