mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix enchant not working with offhand
This commit is contained in:
parent
58eea1724f
commit
ae1f1583c2
@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
|
|||||||
import com.earth2me.essentials.Enchantments;
|
import com.earth2me.essentials.Enchantments;
|
||||||
import com.earth2me.essentials.MetaItemStack;
|
import com.earth2me.essentials.MetaItemStack;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.craftbukkit.Inventories;
|
|
||||||
import com.earth2me.essentials.utils.StringUtil;
|
import com.earth2me.essentials.utils.StringUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -57,7 +56,7 @@ public class Commandenchant extends EssentialsCommand {
|
|||||||
final MetaItemStack metaStack = new MetaItemStack(stack);
|
final MetaItemStack metaStack = new MetaItemStack(stack);
|
||||||
final Enchantment enchantment = metaStack.getEnchantment(user, args[0]);
|
final Enchantment enchantment = metaStack.getEnchantment(user, args[0]);
|
||||||
metaStack.addEnchantment(user.getSource(), ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchantments.allowunsafe"), enchantment, level);
|
metaStack.addEnchantment(user.getSource(), ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchantments.allowunsafe"), enchantment, level);
|
||||||
Inventories.setItemInMainHand(user.getBase(), metaStack.getItemStack());
|
stack.setItemMeta(metaStack.getItemStack().getItemMeta());
|
||||||
user.getBase().updateInventory();
|
user.getBase().updateInventory();
|
||||||
final String enchantName = enchantment.getName().toLowerCase(Locale.ENGLISH).replace('_', ' ');
|
final String enchantName = enchantment.getName().toLowerCase(Locale.ENGLISH).replace('_', ' ');
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user