Skip to content

Commit

Permalink
Fix visual bug (offhand item disappearing) caused by client-side
Browse files Browse the repository at this point in the history
  • Loading branch information
NewbieOrange committed Dec 19, 2021
1 parent 4f05404 commit 37113e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/me/desht/clicksort/ClickSortPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ public void onInventoryClicked(final InventoryClickEvent event) {
if (!sortEvent.isCancelled()) {
sortInventory(event, sortMethod);
if (clickMethod.shouldCancelEvent()) {
Bukkit.getScheduler().runTaskLater(this, () -> {
player.getInventory().setItemInOffHand(player.getInventory().getItemInOffHand());
}, 1L);
event.setCancelled(true);
}
}
Expand Down

0 comments on commit 37113e3

Please sign in to comment.