Convert to UtilServer.isTestServer

This commit is contained in:
samczsun 2017-01-07 16:25:15 -05:00 committed by cnr
parent 19ac8f0c3b
commit 39ba03d1b4
13 changed files with 20 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -27,10 +28,8 @@ public class TestRank extends CommandBase<CoreClientManager>
UtilPlayer.message(caller, F.main("Permissions", "This requires Permission Rank [" + Rank.SNR_MODERATOR.getTag(false, true) + C.cGray + "]."));
return;
}
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if (!testServer)
if (!UtilServer.isTestServer())
{
UtilPlayer.message(caller, F.main(Plugin.getName(), F.elem("This command can only be used on test servers!")));
return;

View File

@ -10,6 +10,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
@ -40,7 +41,7 @@ public class RestartManager extends MiniPlugin
super("Restart Manager", plugin);
_serverName = plugin.getConfig().getString("serverstatus.name");
_testServer = plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
_testServer = UtilServer.isTestServer();
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
if (inRestartZone(hour))

View File

@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilServer;
import mineplex.game.clans.tutorial.TutorialManager;
public class FinishCommand extends CommandBase<TutorialManager>
@ -16,8 +17,7 @@ public class FinishCommand extends CommandBase<TutorialManager>
@Override
public void Execute(Player caller, String[] args)
{
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if (_commandCenter.GetClientManager().hasRank(caller, testServer ? Rank.ALL : Rank.JNR_DEV))
if (_commandCenter.GetClientManager().hasRank(caller, UtilServer.isTestServer() ? Rank.ALL : Rank.JNR_DEV))
{
Plugin.finishTutorial(caller);
}

View File

@ -4,6 +4,7 @@ import mineplex.core.command.MultiCommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.game.clans.tutorial.TutorialManager;
import org.bukkit.entity.Player;
@ -26,8 +27,7 @@ public class TutorialCommand extends MultiCommandBase<TutorialManager>
@Override
public void Execute(Player caller, String[] args)
{
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if (_commandCenter.GetClientManager().hasRank(caller, testServer ? Rank.ALL : Rank.JNR_DEV))
if (_commandCenter.GetClientManager().hasRank(caller, UtilServer.isTestServer() ? Rank.ALL : Rank.JNR_DEV))
{
super.Execute(caller, args);
}

View File

@ -501,10 +501,8 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
public void AdminOP(PlayerJoinEvent event)
{
// Give developers operator on their servers
boolean testServer = _plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
Rank minimum = Rank.OWNER;
if (testServer)
if (UtilServer.isTestServer() || UtilServer.isDevServer())
{
minimum = Rank.JNR_DEV;
}

View File

@ -961,7 +961,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
}
if (this.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
if (UtilServer.isTestServer())
event.setMotd(ChatColor.GOLD + "Private Mineplex Test Server");
}

View File

@ -84,7 +84,7 @@ public class GameBoosterManager extends MiniPlugin
{
Booster booster = event.getBooster();
boolean isTesting = event.getBoosterGroup().equalsIgnoreCase("Testing");
boolean isTesting = UtilServer.isTestServer();
if (event.getBoosterGroup().equals(_boosterGroup))
{

View File

@ -7,6 +7,7 @@ import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
public class RequiredRankCommand extends CommandBase<ArcadeManager>
{
@ -22,7 +23,7 @@ public class RequiredRankCommand extends CommandBase<ArcadeManager>
@Override
public void Execute(Player caller, String[] args)
{
if(!_manager.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
if(!UtilServer.isTestServer())
{
UtilPlayer.message(caller, F.main("Command", "This is not a test server.."));
return;

View File

@ -5,6 +5,8 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import org.bukkit.ChatColor;
@ -100,7 +102,7 @@ public class SetCommand extends CommandBase<ArcadeManager>
GameType type = matches.get(0);
Plugin.GetGame().setGame(type, caller, true);
if(Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
if(UtilServer.isTestServer())
{
Plugin.GetGameList().clear();
Plugin.GetGameList().add(type);

View File

@ -716,7 +716,7 @@ public class CaptureTheFlag extends TeamGame
{
boolean authorized = Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.JNR_DEV);
if (Manager.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
if (UtilServer.isTestServer())
if (Manager.GetClients().Get(event.getPlayer()).GetRank().has(Rank.SNR_MODERATOR))
authorized = true;

View File

@ -1640,7 +1640,7 @@ public class SpeedBuilders extends SoloGame
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().has(event.getPlayer(), Rank.MAPDEV, true))
return;
if (!Manager.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
if (!UtilServer.isTestServer())
{
UtilPlayer.message(event.getPlayer(), F.main("Build", C.cYellow + "You can only use this on testing servers!"));

View File

@ -42,7 +42,7 @@ public class GameTestingManager implements Listener
_manager.getPluginManager().registerEvents(this, _manager.getPlugin());
_enabled = _manager.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
_enabled = UtilServer.isTestServer();
}
public ArcadeManager getManager()

View File

@ -184,7 +184,7 @@ public class ProgressingKitManager implements Listener
String message = event.getMessage();
String user = event.getPlayer().getName();
if(user.equalsIgnoreCase("TadahTech") || user.equalsIgnoreCase("Moppletop") || _manager.GetServerConfig().ServerGroup.equalsIgnoreCase("Testing"))
if(user.equalsIgnoreCase("Moppletop") || UtilServer.isTestServer())
{
if(message.startsWith("/kpsetlevel"))
{