Add isBottomInventoryAllowed to ChestGui.

This commit is contained in:
ulumulu1510 committed 2017-01-25 14:37:45 +01:00
1 parent 1281173689
commit 77da60510e
2 files changed
+19 -1

No files matched your search

@@ -151,6 +151,14 @@ public class ChestGui
public boolean isAutoremoving() { return this.autoremoving; } public boolean isAutoremoving() { return this.autoremoving; }
public void setAutoremoving(boolean autoremoving) { this.autoremoving = 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 // CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
@@ -49,7 +49,17 @@ public class EngineMassiveCoreChestGui extends Engine
// ... warn on bottom inventory ... // ... warn on bottom inventory ...
if (InventoryUtil.isBottomInventory(event)) 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; return;
} }