Made debugging tools only available on test servers

This commit is contained in:
xGamingDudex 2016-05-16 02:04:15 +02:00
parent 816a7ca232
commit a27a618b2f
2 changed files with 21 additions and 10 deletions

View File

@ -151,9 +151,15 @@ public class TreasureLocation implements Listener
{
player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest"));
player.sendMessage(F.main("Treasure", "unlocked alredy"));
player.sendMessage("Ignoring that too^^");
// _inventoryManager.addItemToInventory(player, treasureType.getItemName(), 1);
// return;
if(testServer)
{
player.sendMessage("Ignoring that too^^");
}
else
{
_inventoryManager.addItemToInventory(player, treasureType.getItemName(), 1);
return;
}
}
}

View File

@ -1850,22 +1850,27 @@ public abstract class Game implements Listener
public void disable(){}
//TODO: REMOVE THIS!
@EventHandler
public void onCommand(PlayerCommandPreprocessEvent event)
{
boolean testServer = getArcadeManager().getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if(!testServer) return;
event.setCancelled(true);
if(GetState() == GameState.Loading)
{
event.getPlayer().sendMessage(F.main("Game", C.cRed + "Game is loading, please wait"));
return;
}
if(event.getMessage().equalsIgnoreCase("/winroom"))
{
event.setCancelled(true);
List<Player> list = new ArrayList<>(UtilServer.getPlayersCollection());
AnnounceEnd(list);
Bukkit.getScheduler().runTaskLater(getArcadeManager().getPlugin(), () -> { WinEffectManager.end(); }, 20 * 12);
}
if(event.getMessage().equalsIgnoreCase("/winroom2"))
{
event.setCancelled(true);
SetState(GameState.End);
}
}
}