From 903e2462aa962c678ea07e6d2cefc4dd082fc67c Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 5 Mar 2019 15:15:34 +0200 Subject: [PATCH] Render the correct itemstack for thrown spells --- .../com/minelittlepony/unicopia/spell/ITossedEffect.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/spell/ITossedEffect.java b/src/main/java/com/minelittlepony/unicopia/spell/ITossedEffect.java index 3043f625..9a9100ef 100644 --- a/src/main/java/com/minelittlepony/unicopia/spell/ITossedEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/spell/ITossedEffect.java @@ -5,6 +5,7 @@ import com.minelittlepony.unicopia.init.UItems; import com.minelittlepony.unicopia.tossable.ITossable; import net.minecraft.entity.Entity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.SoundCategory; import net.minecraft.world.World; @@ -21,7 +22,9 @@ public interface ITossedEffect extends IMagicEffect, ITossable> { if (!world.isRemote) { EntityProjectile projectile = new EntityProjectile(world, caster.getOwner()); - projectile.setItem(new ItemStack(UItems.spell)); + Item item = this.getAffinity() == SpellAffinity.BAD ? UItems.curse : UItems.spell; + + projectile.setItem(SpellRegistry.instance().enchantStack(new ItemStack(item), getName())); projectile.setThrowDamage(getThrowDamage(caster)); projectile.setOwner(caster.getOwner()); projectile.setEffect(this);