Fixed not being able to use pick block on gems

This commit is contained in:
Sollace 2019-02-21 19:26:40 +02:00
parent b11c3b5935
commit ce77b6f140

View file

@ -28,6 +28,7 @@ import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
@ -115,10 +116,9 @@ public class EntitySpell extends EntityCreature implements IMagicals, ICaster<En
dataManager.register(AFFINITY, SpellAffinity.NEUTRAL.ordinal());
}
public ItemStack onPlayerMiddleClick(EntityPlayer player) {
ItemStack stack = new ItemStack(getItem(), 1);
SpellRegistry.instance().enchantStack(stack, getEffect().getName());
return stack;
@Override
public ItemStack getPickedResult(RayTraceResult target) {
return SpellRegistry.instance().enchantStack(new ItemStack(getItem()), getEffect().getName());
}
protected Item getItem() {