Dagger of Sacrifice should not work for FakePlayers
(cherry picked from commit c4f9270
)
This commit is contained in:
parent
45faf42167
commit
6ac31ba1e8
|
@ -12,6 +12,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
@ -37,6 +38,9 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
|
|||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if (attacker instanceof FakePlayer)
|
||||
return false;
|
||||
|
||||
if (target == null || attacker == null || attacker.getEntityWorld().isRemote || (attacker instanceof EntityPlayer && !(attacker instanceof EntityPlayerMP)))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue