mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-18 03:25:03 +00:00
fix negative enchantment levels
This commit is contained in:
1 parent
190b2e1767
commit
d826972d4b
1 file changed
+6
-1
@@ -164,7 +164,12 @@ public class RitualEffectEnchant extends RitualEffect {
|
||||
if (stageTicks >= 100) {
|
||||
for (EnchantmentData d : enchants) {
|
||||
if (EnchantmentHelper.getEnchantmentLevel(d.enchant, enchantItem) == 0) {
|
||||
enchantItem.addEnchantment(Enchantment.enchantmentsList[d.enchant], d.level);
|
||||
if (enchantItem.stackTagCompound == null) enchantItem.setTagCompound(new NBTTagCompound());
|
||||
if (!enchantItem.stackTagCompound.hasKey("ench", 9)) enchantmentItem.setTag("ench", new NBTTagList());
|
||||
NBTTagCompound ench = new NBTTagCompound();
|
||||
ench.setShort("id", (short)Enchantment.enchantmentsList[d.enchant].effectId);
|
||||
ench.setShort("lvl", (short)d.level);
|
||||
enchantItem.stackTagCompound.getTagList("ench", 10).appendTag(ench);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user