Skip to content

Commit

Permalink
Fix the plugin not removing all items from inventory when changing sp…
Browse files Browse the repository at this point in the history
…awners using a spawn egg (#886)
  • Loading branch information
OmerBenGera committed Feb 1, 2024
1 parent 15c5a4a commit 70548b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,12 @@ public void onSpawnerChange(PlayerInteractEvent e) {
return;
}

ItemStack inHand = e.getItem().clone();

Executor.sync(() -> {
stackedSpawner.updateName();
if (e.getPlayer().getGameMode() != GameMode.CREATIVE && plugin.getSettings().eggsStackMultiply)
ItemUtils.removeItemFromHand(e.getPlayer().getInventory(), e.getItem(), stackedSpawner.getStackAmount() - 1);
ItemUtils.removeItemFromHand(e.getPlayer().getInventory(), inHand, stackedSpawner.getStackAmount() - 1);
}, 2L);
}

Expand Down

0 comments on commit 70548b4

Please sign in to comment.