This commit is contained in:
samczsun 2017-03-09 22:35:13 -05:00 committed by cnr
parent 26d3a77748
commit 1ecd46f7ee

View File

@ -561,16 +561,23 @@ public class GameHostManager implements Listener
@EventHandler
public void whitelistCommand(PlayerCommandPreprocessEvent event)
{
if (_host == null || !event.getPlayer().equals(_host))
if (_host == null)
return;
if (isCommunityServer())
return;
if (!event.getMessage().toLowerCase().startsWith("/whitelist"))
return;
if (!isPrivateServer())
if (!event.getPlayer().equals(_host))
{
event.setCancelled(true);
UtilPlayer.message(event.getPlayer(), F.main("MPS", "You do not have permission to whitelist players. Ask the MPS host"));
return;
}
if (isCommunityServer() || !isPrivateServer())
{
event.setCancelled(true);
return;
}
event.setCancelled(true);