Skip to content

Commit

Permalink
Cursor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
RockinChaos committed Feb 10, 2024
1 parent 1821c65 commit 0dfcfc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/me/RockinChaos/itemjoin/item/ItemMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -4659,6 +4659,9 @@ public void removeFrom(final Player player, int... amount) {
if (this.isSimilar(player, inv.getBoots())) {
inv.setBoots(new ItemStack(Material.AIR));
}
if (this.isSimilar(player, player.getItemOnCursor())) {
player.setItemOnCursor(new ItemStack(Material.AIR));
}
if (ServerUtils.hasSpecificUpdate("1_9") && this.isSimilar(player, PlayerHandler.getOffHandItem(player))) {
PlayerHandler.setOffHandItem(player, new ItemStack(Material.AIR));
}
Expand All @@ -4685,6 +4688,8 @@ public void removeFrom(final Player player, int... amount) {
inv.setLeggings(ItemHandler.modifyItem(inv.getLeggings(), false, amount[0]));
} else if (this.isSimilar(player, inv.getBoots())) {
inv.setBoots(ItemHandler.modifyItem(inv.getBoots(), false, amount[0]));
} else if (this.isSimilar(player, player.getItemOnCursor())) {
player.setItemOnCursor(ItemHandler.modifyItem(player.getItemOnCursor(), false, amount[0]));
} else if (ServerUtils.hasSpecificUpdate("1_9") && this.isSimilar(player, PlayerHandler.getOffHandItem(player))) {
PlayerHandler.setOffHandItem(player, ItemHandler.modifyItem(PlayerHandler.getOffHandItem(player), false, amount[0]));
} else if (PlayerHandler.isCraftingInv(player.getOpenInventory())) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/RockinChaos/itemjoin/item/ItemUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ private void clearItems(final TriggerType type, final Player player, final Strin
if (this.canClear(inventory.getBoots(), "Boots", i, clearType)) {
inventory.setBoots(new ItemStack(Material.AIR));
}
if (this.canClear(player.getItemOnCursor(), "Cursor", i, clearType)) {
player.setItemOnCursor(new ItemStack(Material.AIR));
}
if (ServerUtils.hasSpecificUpdate("1_9") && this.canClear(inventory.getItemInOffHand(), "OffHand", i, clearType)) {
PlayerHandler.setOffHandItem(player, new ItemStack(Material.AIR));
}
Expand Down

0 comments on commit 0dfcfc5

Please sign in to comment.