Skip to content

Commit

Permalink
Make trader view work, with limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Feb 18, 2024
1 parent 8864d89 commit a8f3763
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main/src/main/java/net/citizensnpcs/trait/ShopTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,13 @@ public void onInventoryClick(InventoryClickEvent evt) {
evt.setCancelled(true);
if (evt.getSlotType() != SlotType.RESULT)
return;
// TODO: work around crafting slot limitations in minecraft
player.getInventory().addItem(evt.getClickedInventory().getItem(0));
evt.getClickedInventory().setItem(0, null);
if (evt.getClickedInventory().getItem(1) != null) {
player.getInventory().addItem(evt.getClickedInventory().getItem(1));
evt.getClickedInventory().setItem(1, null);
}
trades.get(selectedTrade).onClick(shop, player, evt.getClick().isShiftClick(),
lastClickedTrade == selectedTrade);
lastClickedTrade = selectedTrade;
Expand Down

0 comments on commit a8f3763

Please sign in to comment.