Only closing CREATIVE Inv for non-ops.
This commit is contained in:
parent
ca58f11174
commit
057594205e
@ -156,12 +156,12 @@ public class GamePlayerManager implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void InventoryClick(InventoryClickEvent event)
|
public void DisallowCreativeClick(InventoryClickEvent event)
|
||||||
{
|
{
|
||||||
if (Manager.GetGame() == null || !Manager.GetGame().InProgress())
|
if (Manager.GetGame() == null || !Manager.GetGame().InProgress())
|
||||||
return;
|
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.setCancelled(true);
|
||||||
event.getWhoClicked().closeInventory();
|
event.getWhoClicked().closeInventory();
|
||||||
|
Loading…
Reference in New Issue
Block a user