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", "You seem to have all treasures for this chest"));
player.sendMessage(F.main("Treasure", "unlocked alredy")); player.sendMessage(F.main("Treasure", "unlocked alredy"));
player.sendMessage("Ignoring that too^^"); if(testServer)
// _inventoryManager.addItemToInventory(player, treasureType.getItemName(), 1); {
// return; 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(){} public void disable(){}
//TODO: REMOVE THIS!
@EventHandler @EventHandler
public void onCommand(PlayerCommandPreprocessEvent event) 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")) if(event.getMessage().equalsIgnoreCase("/winroom"))
{ {
event.setCancelled(true);
List<Player> list = new ArrayList<>(UtilServer.getPlayersCollection()); List<Player> list = new ArrayList<>(UtilServer.getPlayersCollection());
AnnounceEnd(list); AnnounceEnd(list);
Bukkit.getScheduler().runTaskLater(getArcadeManager().getPlugin(), () -> { WinEffectManager.end(); }, 20 * 12); Bukkit.getScheduler().runTaskLater(getArcadeManager().getPlugin(), () -> { WinEffectManager.end(); }, 20 * 12);
} }
if(event.getMessage().equalsIgnoreCase("/winroom2"))
{
event.setCancelled(true);
SetState(GameState.End);
}
} }
} }