Skip to content

Commit

Permalink
Added check for FakePlayer, thanks to @Ipsis and others #9
Browse files Browse the repository at this point in the history
  • Loading branch information
mchorse committed Jan 14, 2017
1 parent 40a241c commit 475fb7f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/mchorse/metamorph/api/MorphHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
Expand Down Expand Up @@ -82,7 +82,12 @@ public void onPlayerKillEntity(LivingDeathEvent event)
Entity source = event.getSource().getEntity();
Entity target = event.getEntity();

if (target.worldObj.isRemote || !(source instanceof EntityPlayerMP) || target instanceof EntityPlayer || Metamorph.proxy.config.prevent_kill_acquire)
if (target.worldObj.isRemote || source instanceof FakePlayer)
{
return;
}

if (!(source instanceof EntityPlayer) || target instanceof EntityPlayer || Metamorph.proxy.config.prevent_kill_acquire)
{
return;
}
Expand Down

0 comments on commit 475fb7f

Please sign in to comment.