Examples of rayTraceBlocks()


Examples of net.minecraft.world.World.rayTraceBlocks()

      Vec3 from = Vec3.createVectorHelper( tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5 );
      from = from.addVector( s.offsetX * 0.501, s.offsetY * 0.501, s.offsetZ * 0.501 );
      Vec3 to = from.addVector( s.offsetX, s.offsetY, s.offsetZ );

      Block blk = w.getBlock( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );
      MovingObjectPosition mop = w.rayTraceBlocks( from, to, true );

      TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );

      if ( te == null )
        continue;
View Full Code Here

Examples of net.minecraft.world.World.rayTraceBlocks()

    Vec3 vec = null;

    if ( hitBlocks )
    {
      vec = Vec3.createVectorHelper( d0, d1, d2 );
      pos = w.rayTraceBlocks( vec3, vec31, true );
    }

    if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest )
    {
      pos = new MovingObjectPosition( entity );
View Full Code Here

Examples of net.minecraft.world.World.rayTraceBlocks()

                if(leftoverStack == null || leftoverStack.stackSize == 0) {
                    entity.setDead();
                }
            } else {
                Vec3 entityVec = Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ);
                MovingObjectPosition trace = worldObj.rayTraceBlocks(entityVec, tileVec);
                if(trace != null && trace.blockX == xCoord && trace.blockY == yCoord && trace.blockZ == zCoord) {
                    double d1 = (entity.posX - xCoord - 0.5D) / d0;
                    double d2 = (entity.posY - yCoord - 0.5D) / d0;
                    double d3 = (entity.posZ - zCoord - 0.5D) / d0;
                    double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.