!prevent identified item hard-setting the amount of item to 1 when identified

This commit is contained in:
Blackdigits 2020-01-29 23:57:43 +07:00
parent a0839fe7f4
commit fffd9420f4

View File

@ -336,8 +336,12 @@ public class MMOItemsCommand implements CommandExecutor {
sender.sendMessage(MMOItems.plugin.getPrefix() + "The item you are holding is already identified.");
return true;
}
final int amount = player.getInventory().getItemInMainHand().getAmount();
ItemStack identifiedItem = new IdentifiedItem(item).identify();
identifiedItem.setAmount(amount);
player.getInventory().setItemInMainHand(new IdentifiedItem(item).identify());
player.getInventory().setItemInMainHand(identifiedItem);
sender.sendMessage(MMOItems.plugin.getPrefix() + "Successfully identified the item you are holding.");
}
// ==================================================================================================================================