File tree 1 file changed +5
-3
lines changed
src/main/java/me/truemb/rentit/listener
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ public void onRollbackGUIClick(InventoryClickEvent e) {
40
40
ItemStack item = e .getCurrentItem ();
41
41
ItemStack cursorItem = e .getCursor ();
42
42
43
- InventoryHolder holder = e .getInventory ().getHolder ();
43
+ Inventory inv = e .getInventory ();
44
+ Inventory clickInv = e .getClickedInventory ();
45
+ InventoryHolder holder = inv .getHolder ();
44
46
45
47
if (holder == null )
46
48
return ;
@@ -53,8 +55,8 @@ public void onRollbackGUIClick(InventoryClickEvent e) {
53
55
if (guiHolder .getGuiType () != GuiType .ROLLBACK )
54
56
return ;
55
57
56
- //NO ITEMS FROM BOTTOM INVENTORY
57
- if ((item != null && item .getType () != Material .AIR ) && (e . getClickedInventory () == null || !e . getClickedInventory (). equals (e . getView (). getTopInventory () ))) {
58
+ //NO ITEMS FROM BOTTOM INVENTORY
59
+ if ((item != null && item .getType () != Material .AIR ) && (clickInv == null || !clickInv . equals (inv ))) {
58
60
e .setCancelled (true );
59
61
return ;
60
62
}
You can’t perform that action at this time.
0 commit comments