OSDN Git Service

いろいろした
[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 /**
11  * @author ponkotate
12  */
13 public class FalseItem {
14
15         protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) {
16                 float var4 = 1.0F;
17                 float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
18                 float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
19                 double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
20                 double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
21                 double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
22                 Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
23                 float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
24                 float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
25                 float var16 = -MathHelper.cos(-var5 * 0.017453292F);
26                 float var17 = MathHelper.sin(-var5 * 0.017453292F);
27                 float var18 = var15 * var16;
28                 float var20 = var14 * var16;
29                 double var21 = 5.0D;
30                 if (par2EntityPlayer instanceof EntityPlayerMP) {
31                         var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
32                 }
33                 Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
34                 return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
35         }
36
37 }