fix for confusion between top and bottom guis.

This commit is contained in:
Brianna O'Keefe 2018-12-05 04:30:59 -05:00
parent c39e3dbbaf
commit 30e0954f0d

View File

@ -74,12 +74,12 @@ public abstract class AbstractGUI implements Listener {
}
}
}
Map<Range, Clickable> entries = new HashMap<>(gui.clickables);
for (Map.Entry<Range, Clickable> entry : entries.entrySet()) {
Range range = entry.getKey();
if (!range.isBottom() && bottom || range.getClickType() != null && range.getClickType() != event.getClick())
if (range.isBottom() && !bottom || !range.isBottom() && bottom || range.getClickType() != null && range.getClickType() != event.getClick())
continue;
if (event.getSlot() >= range.getMin() && event.getSlot() <= range.getMax()) {
entry.getValue().Clickable(player, inventory, event.getCursor(), event.getSlot(), event.getClick());