Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-11-15 03:42:57 -08:00
commit ad6f41e1c6
2 changed files with 7 additions and 4 deletions

View File

@ -285,11 +285,14 @@ public class GameFlagManager implements Listener
if (!game.InProgress())
return;
if (game.InventoryClick)
return;
Player player = UtilPlayer.searchExact(event.getWhoClicked().getName());
if (player != null && !game.IsAlive(player))
return;
if (game.InventoryClick)
if (!game.IsAlive(player))
return;
if (event.getInventory().getType() == InventoryType.CRAFTING)

View File

@ -156,12 +156,12 @@ public class GamePlayerManager implements Listener
}
@EventHandler
public void InventoryClick(InventoryClickEvent event)
public void DisallowCreativeClick(InventoryClickEvent event)
{
if (Manager.GetGame() == null || !Manager.GetGame().InProgress())
return;
if (event.getWhoClicked().getGameMode() == GameMode.CREATIVE && event.getInventory().getType() == InventoryType.CREATIVE)
if ((event.getInventory().getType() == InventoryType.CREATIVE || event.getInventory().getType() == InventoryType.PLAYER) && !event.getWhoClicked().isOp())
{
event.setCancelled(true);
event.getWhoClicked().closeInventory();