mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed gems dropping an item of the wrong affinity
This commit is contained in:
parent
4033b48e24
commit
c06c6c6a05
1 changed files with 7 additions and 2 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.entity.EntityLiving;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
|
@ -99,11 +100,15 @@ public class EntitySpell extends EntityLiving implements IMagicals, ICaster<Enti
|
|||
}
|
||||
|
||||
public ItemStack onPlayerMiddleClick(EntityPlayer player) {
|
||||
ItemStack stack = new ItemStack(UItems.spell, 1);
|
||||
ItemStack stack = new ItemStack(getItem(), 1);
|
||||
SpellRegistry.instance().enchantStack(stack, getEffect().getName());
|
||||
return stack;
|
||||
}
|
||||
|
||||
protected Item getItem() {
|
||||
return getAffinity() == SpellAffinity.BAD ? UItems.curse : UItems.spell;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking() {
|
||||
return false;
|
||||
|
@ -226,7 +231,7 @@ public class EntitySpell extends EntityLiving implements IMagicals, ICaster<Enti
|
|||
if (world.getGameRules().getBoolean("doTileDrops")) {
|
||||
int level = getCurrentLevel();
|
||||
|
||||
ItemStack stack = new ItemStack(UItems.spell, level + 1);
|
||||
ItemStack stack = new ItemStack(getItem(), level + 1);
|
||||
if (hasEffect()) {
|
||||
SpellRegistry.instance().enchantStack(stack, getEffect().getName());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue