Skip to content

Commit

Permalink
Added actual implementation of convertSlot method
Browse files Browse the repository at this point in the history
Fixed getInventory invalid returns
  • Loading branch information
fulminazzo committed Apr 8, 2024
1 parent 94d95d1 commit 9a3a60a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ private static InventoryView getInventoryView(Player player, Inventory inventory
when(player.getOpenInventory()).thenReturn(view);
when(view.getPlayer()).thenReturn(player);
when(view.getItem(any(int.class))).thenCallRealMethod();
when(view.convertSlot(any(int.class))).thenCallRealMethod();
when(view.getInventory(any(int.class))).thenAnswer(a -> {
int slot = a.getArgument(0);
if (slot > inventory.getSize()) return inventory;
if (slot < inventory.getSize()) return inventory;
return playerInventory;
});
return view;
Expand Down

0 comments on commit 9a3a60a

Please sign in to comment.