fixed better

This commit is contained in:
Mini-Chiss 2015-08-15 12:31:19 +02:00
parent 6ac586790d
commit ba6806935d

View File

@ -81,30 +81,25 @@ public class EventModule extends MiniPlugin
{
if (!event.getMessage().toLowerCase().startsWith("/sethost "))
return;
boolean allowed = Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true);
//Player isnt OP! Check if allowed.
if (!event.getPlayer().isOp())
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
//NOT EVENT TEST! NOT ALLOWED!
if (!allowed)
{
//Not JNR Dev either
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true))
{
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
//NOT EVENT TEST!
if (!eventTestServer)
{
return;
}
else
{
//Not Snr Mod
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.SNR_MODERATOR, true))
{
return;
}
}
}
allowed = eventTestServer &&
Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.SNR_MODERATOR, true);
}
if (!allowed)
{
return;
}
Manager.GetServerConfig().HostName = event.getMessage().split(" ")[1];