mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-24 20:07:34 +01:00
Fixed /giverandombook with full inventory
This commit is contained in:
parent
56bdd44b50
commit
64ae9f3de2
@ -53,7 +53,9 @@ public class CommandGiverandombook extends AbstractCommand {
|
||||
meta.addStoredEnchant(enchantment, level, true);
|
||||
itemStack.setItemMeta(meta);
|
||||
|
||||
player.getInventory().addItem(itemStack);
|
||||
for (ItemStack stack : player.getInventory().addItem(itemStack).values()) {
|
||||
player.getWorld().dropItem(player.getLocation(), stack);
|
||||
}
|
||||
|
||||
String message = this.getPlugin().getLangYml().getMessage("gave-random-book");
|
||||
message = message.replace("%enchantment%", EnchantmentCache.getEntry(enchantment).getName() + " " + NumberUtils.toNumeral(level) + "§r");
|
||||
|
Loading…
Reference in New Issue
Block a user