Add isBottomInventoryAllowed to ChestGui.

This commit is contained in:
ulumulu1510 2016-12-27 01:02:14 +01:00
parent 1281173689
commit 77da60510e
2 changed files with 19 additions and 1 deletions

View File

@ -151,6 +151,14 @@ public class ChestGui
public boolean isAutoremoving() { return this.autoremoving; }
public void setAutoremoving(boolean autoremoving) { this.autoremoving = autoremoving; }
// -------------------------------------------- //
// ALLOWBOTTOMINVENTORY
// -------------------------------------------- //
private boolean allowBottomInventory = false;
public boolean isBottomInventoryAllowed() { return this.allowBottomInventory; }
public void setBottomInventoryAllow(boolean allowBottomInventory) { this.allowBottomInventory = allowBottomInventory; }
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //

View File

@ -49,7 +49,17 @@ public class EngineMassiveCoreChestGui extends Engine
// ... warn on bottom inventory ...
if (InventoryUtil.isBottomInventory(event))
{
MixinMessage.get().msgOne(event.getWhoClicked(), "<b>Exit the GUI to edit your items.");
// ... only if its not allowed.
if (gui.isBottomInventoryAllowed())
{
event.setCancelled(false);
event.setResult(Result.DEFAULT);
}
else
{
MixinMessage.get().msgOne(event.getWhoClicked(), "<b>Exit the GUI to edit your items.");
}
return;
}