Added whitelist check in CoreClientManager
This commit is contained in:
parent
525df6c2b0
commit
a75ced170c
@ -19,6 +19,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -138,6 +139,19 @@ public class CoreClientManager implements Listener
|
||||
|
||||
event.disallow(Result.KICK_OTHER, "Error retrieving information from web, please retry in a minute.");
|
||||
}
|
||||
|
||||
if (Bukkit.hasWhitelist() && !Get(event.getName()).GetRank().Has(Rank.MODERATOR))
|
||||
{
|
||||
for (OfflinePlayer player : Bukkit.getWhitelistedPlayers())
|
||||
{
|
||||
if (player.getName().equalsIgnoreCase(event.getName()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.disallow(Result.KICK_WHITELIST, "You are not whitelisted my friend.");
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadClient(CoreClient client, String ipAddress)
|
||||
|
Loading…
Reference in New Issue
Block a user