Fix conjured items not disappearing in offhand (actually fixes #493)

This commit is contained in:
Electroblob77
2021-01-04 00:18:37 +00:00
parent f81ad670ed
commit 0e815c676d
8 changed files with 40 additions and 8 deletions
@@ -5,6 +5,7 @@ import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.EntityUtils;
import electroblob.wizardry.util.InventoryUtils;
import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType;
import net.minecraft.entity.Entity;
@@ -83,7 +84,7 @@ public class ItemFrostAxe extends ItemAxe implements IConjuredItem {
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
int damage = stack.getItemDamage();
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
if(damage > stack.getMaxDamage()) InventoryUtils.replaceItemInInventory(entity, slot, stack, ItemStack.EMPTY);
stack.setItemDamage(damage + 1);
}