Update BloodArsenalEventHooks.java

FakePlayer extends EntityPlayerMP (http://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.7.10-10.13.2.1291/index.html)
and thus this method will try to give FakePlayers (In our case the ExtraUtilities EnderQuarry) the potion effect, that will cause an NPE and crash
This commit is contained in:
Stefan Thomanek authored and GitHub committed 2016-11-30 20:59:23 +01:00
1 parent e49b052d76
commit 2444b67b04
1 file changed
+2 -1
@@ -24,6 +24,7 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.common.util.FakePlayer;
import java.util.Random;
@@ -208,7 +209,7 @@ public class BloodArsenalEventHooks
EntityPlayer player = event.harvester;
Random random = new Random();
if (player != null && player instanceof EntityPlayerMP)
if (player != null && player instanceof EntityPlayerMP && !(player instanceof FakePlayer))
{
if (!event.world.isRemote && !event.isSilkTouching)
{