Fix RayTracer with non EntityPlayerMP instances on server worlds.

This commit is contained in:
Chicken-Bomes committed 2013-10-30 12:23:03 +10:00
1 parent a7637ca787
commit dd297d6e42
1 file changed
+3 -2
+3 -2
View File
@@ -209,7 +209,7 @@ public class RayTracer
public static MovingObjectPosition reTrace(World world, EntityPlayer player)
{
return reTrace(world, player, world.isRemote ? getBlockReachDistance_client() : getBlockReachDistance_server((EntityPlayerMP) player));
return reTrace(world, player, getBlockReachDistance(player));
}
public static MovingObjectPosition reTrace(World world, EntityPlayer player, double reach)
@@ -238,7 +238,8 @@ public class RayTracer
public static double getBlockReachDistance(EntityPlayer player)
{
return player.worldObj.isRemote ? getBlockReachDistance_client() : getBlockReachDistance_server((EntityPlayerMP) player);
return player.worldObj.isRemote ? getBlockReachDistance_client() :
player instanceof EntityPlayerMP ? getBlockReachDistance_server((EntityPlayerMP) player) : 5D;
}
public static Vec3 getEndVec(EntityPlayer player)