OSDN Git Service

537e9be40a0a6c5b007ca44fd20eb765ad5c6175
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / compounds / FalseItem.java
1 package pcc.chemicraft.base.compounds;
2
3 import net.minecraft.entity.player.EntityPlayer;
4 import net.minecraft.entity.player.EntityPlayerMP;
5 import net.minecraft.util.MathHelper;
6 import net.minecraft.util.MovingObjectPosition;
7 import net.minecraft.util.Vec3;
8 import net.minecraft.world.World;
9
10 public class FalseItem
11 {
12
13         protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
14         {
15                 float var4 = 1.0F;
16                 float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
17                 float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
18                 double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
19                 double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
20                 double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
21                 Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
22                 float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
23                 float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
24                 float var16 = -MathHelper.cos(-var5 * 0.017453292F);
25                 float var17 = MathHelper.sin(-var5 * 0.017453292F);
26                 float var18 = var15 * var16;
27                 float var20 = var14 * var16;
28                 double var21 = 5.0D;
29                 if (par2EntityPlayer instanceof EntityPlayerMP) {
30                         var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
31                 }
32                 Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
33                 return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
34         }
35
36 }