Fix console support for cracked/premium commands (Fixes# 62)

This commit is contained in:
games647
2016-08-20 17:38:47 +02:00
parent 3e84ebd787
commit 558ee1c92c
3 changed files with 17 additions and 8 deletions

View File

@ -2,6 +2,7 @@
* Fix third-party not premium player detection
* Fix ProtocolSupport BungeeCord
* Fix duplicate logins for BungeeAuth users
######1.7.1

View File

@ -2,6 +2,7 @@ package com.github.games647.fastlogin.bukkit.commands;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.core.PlayerProfile;
import com.google.common.collect.Iterables;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
@ -99,10 +100,13 @@ public class CrackedCommand implements CommandExecutor {
if (sender instanceof Player) {
notifiyBungeeCord((Player) sender, target);
} else {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
//todo: add console support
// Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
// notifiyBungeeCord(firstPlayer, target);
Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
if (firstPlayer == null) {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
return;
}
notifiyBungeeCord(firstPlayer, target);
}
}

View File

@ -2,6 +2,7 @@ package com.github.games647.fastlogin.bukkit.commands;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.core.PlayerProfile;
import com.google.common.collect.Iterables;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
@ -117,10 +118,13 @@ public class PremiumCommand implements CommandExecutor {
if (sender instanceof Player) {
notifiyBungeeCord((Player) sender, target);
} else {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
//todo: add console support
// Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
// notifiyBungeeCord(firstPlayer, target);
Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
if (firstPlayer == null) {
plugin.getLogger().info("No player online to send a plugin message to the proxy");
return;
}
notifiyBungeeCord(firstPlayer, target);
}
}