Only closing CREATIVE Inv for non-ops.

This commit is contained in:
Chiss 2014-11-15 22:40:56 +11:00
parent ca58f11174
commit 057594205e

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();