001    package net.minecraft.src;
002    
003    public class MovingObjectPosition
004    {
005        /** What type of ray trace hit was this? 0 = block, 1 = entity */
006        public EnumMovingObjectType typeOfHit;
007    
008        /** x coordinate of the block ray traced against */
009        public int blockX;
010    
011        /** y coordinate of the block ray traced against */
012        public int blockY;
013    
014        /** z coordinate of the block ray traced against */
015        public int blockZ;
016    
017        /**
018         * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West
019         * = 3, North = 4, South = 5.
020         */
021        public int sideHit;
022    
023        /** The vector position of the hit */
024        public Vec3 hitVec;
025    
026        /** The hit entity */
027        public Entity entityHit;
028        
029        /** Used to determine what sub-segment is hit */
030        public int subHit = -1;
031    
032        public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3 par5Vec3)
033        {
034            this.typeOfHit = EnumMovingObjectType.TILE;
035            this.blockX = par1;
036            this.blockY = par2;
037            this.blockZ = par3;
038            this.sideHit = par4;
039            this.hitVec = par5Vec3.myVec3LocalPool.getVecFromPool(par5Vec3.xCoord, par5Vec3.yCoord, par5Vec3.zCoord);
040        }
041    
042        public MovingObjectPosition(Entity par1Entity)
043        {
044            this.typeOfHit = EnumMovingObjectType.ENTITY;
045            this.entityHit = par1Entity;
046            this.hitVec = par1Entity.worldObj.func_82732_R().getVecFromPool(par1Entity.posX, par1Entity.posY, par1Entity.posZ);
047        }
048    }