Examples of Vec3


Examples of net.minecraft.util.Vec3

    Vector3d look = Util.getLookVecEio(player);

    Vector3d sample = new Vector3d(look);
    sample.scale(Config.travelStaffMaxBlinkDistance);
    sample.add(eye);
    Vec3 eye3 = Vec3.createVectorHelper(eye.x, eye.y, eye.z);
    Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);

    double playerHeight = player.yOffset;
    //if you looking at you feet, and your player height to the max distance, or part there of
    double lookComp = -look.y * playerHeight;
    double maxDistance = Config.travelStaffMaxBlinkDistance + lookComp;
View Full Code Here

Examples of net.minecraft.util.Vec3

  private boolean canTeleportTo(EntityPlayer player, TravelSource source, BlockCoord bc, World w) {
    if(bc.y < 1) {
      return false;
    }
    if(source == TravelSource.STAFF_BLINK && !Config.travelStaffBlinkThroughSolidBlocksEnabled) {
      Vec3 start = Util.getEyePosition(player);
      Vec3 target = Vec3.createVectorHelper(bc.x + 0.5f, bc.y + 0.5f, bc.z + 0.5f);
      if(!canBlinkTo(bc, w, start, target)) {
        return false;
      }
    }  
View Full Code Here

Examples of net.minecraft.util.Vec3

      EntityPlayer entityPlayer) {
    List<RaytraceResult> allHits = doRayTraceAll(world, x, y, z, entityPlayer);
    if(allHits == null) {
      return null;
    }
    Vec3 origin = Util.getEyePosition(entityPlayer);
    return RaytraceResult.getClosestHit(origin, allHits);
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

    double dirY = -Math.sin(pitch);
    double dirZ = Math.cos(yaw) * Math.cos(pitch);

    double reachDistance = EnderIO.proxy.getReachDistanceForPlayer(entityPlayer);

    Vec3 origin = Util.getEyePosition(entityPlayer);
    Vec3 direction = origin.addVector(dirX * reachDistance, dirY *
        reachDistance, dirZ * reachDistance);
    return doRayTraceAll(world, x, y, z, origin, direction,
        entityPlayer);
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

            }
        }
        else
        {
            ++this.ticksInAir;
            Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
            Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
            // TODO 1.7 May need to call overload with extra params
            MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31, false);
            vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
            vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
View Full Code Here

Examples of net.minecraft.util.Vec3

      this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
      this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0D / Math.PI);
    }
   
    ++this.ticksInAir;
    Vec3 pos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
    Vec3 nextPos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
    MovingObjectPosition hit = this.worldObj.rayTraceBlocks_do_do(pos, nextPos, false, true);
    pos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
    nextPos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
   
    if(hit != null)
View Full Code Here

Examples of net.minecraft.util.Vec3

      }
    }
   
    if(!worldObj.isRemote)
    {
      Vec3 pos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
      Vec3 nextPos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
      MovingObjectPosition hit = this.worldObj.rayTraceBlocks_do_do(pos, nextPos, false, true);
      pos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
      nextPos = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
     
      if(hit != null)
      {
        nextPos = this.worldObj.getWorldVec3Pool().getVecFromPool(hit.hitVec.xCoord, hit.hitVec.yCoord,  hit.hitVec.zCoord);
      }
     
      Entity entityHit = null;
      List<?> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,  this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
      double closestRange = 0.0D;
      double collisionRange = 0.3D;
     
      for(int i = 0, end = list.size(); i < end; ++i)
      {
        Entity e = (Entity)list.get(i);
       
        if(e.canBeCollidedWith() && (e != _owner))
        {
          AxisAlignedBB entitybb = e.boundingBox.expand(collisionRange, collisionRange, collisionRange);
          MovingObjectPosition entityHitPos = entitybb.calculateIntercept(pos, nextPos);
         
          if(entityHitPos != null)
          {
            double range = pos.distanceTo(entityHitPos.hitVec);
           
            if((range < closestRange) | closestRange == 0D)
            {
              entityHit = e;
              closestRange = range;
            }
          }
        }
      }
     
      if(entityHit != null)
      {
        hit = new MovingObjectPosition(entityHit);
      }
     
      if(hit != null && hit.entityHit != null && hit.entityHit instanceof EntityPlayer)
      {
        EntityPlayer entityplayer = (EntityPlayer)hit.entityHit;
       
        if(entityplayer.capabilities.disableDamage || (_owner instanceof EntityPlayer && !((EntityPlayer)_owner).func_96122_a(entityplayer)))
        {
          hit = null;
        }
      }
     
      if(hit != null && !worldObj.isRemote)
      {
        if(hit.entityHit != null)
        { // why not spawn explosion at nextPos x/y/z?
          worldObj.newExplosion(this, hit.entityHit.posX, hit.entityHit.posY, hit.entityHit.posZ, 4.0F, true, true);
        }
        else
        {
          worldObj.newExplosion(this, hit.blockX, hit.blockY, hit.blockZ, 4.0F, true, true);
        }
        setDead();
      }
    }
   
    if(_target != null)
    {
      // At this point, I suspect literally no one on this project actually understands what this does or how it works
     
      Vec3 targetVector = worldObj.getWorldVec3Pool().getVecFromPool(_target.posX - posX, _target.posY - posY, _target.posZ - posZ);
      float targetYaw = clampAngle(360 - (float)(Math.atan2(targetVector.xCoord, targetVector.zCoord) * 180.0D / Math.PI), 360, false);
      float targetPitch = clampAngle(-(float)(Math.atan2(targetVector.yCoord, Math.sqrt(targetVector.xCoord * targetVector.xCoord + targetVector.zCoord * targetVector.zCoord)) * 180.0D / Math.PI), 360, false);
     
      float yawDifference = clampAngle(targetYaw - rotationYaw, 3, true);
      float pitchDifference = clampAngle(targetPitch - rotationPitch, 3, true);
View Full Code Here

Examples of net.minecraft.util.Vec3

 
  private int getPartClicked(EntityPlayer player, double reachDistance, TileEntityRedNetCable cable)
  {
    AxisAlignedBB[] wireparts = getParts(cable);
   
    Vec3 playerPosition = Vec3.createVectorHelper(player.posX - cable.xCoord, player.posY - cable.yCoord + player.getEyeHeight(), player.posZ - cable.zCoord);
    Vec3 playerLook = player.getLookVec();
   
    Vec3 playerViewOffset = Vec3.createVectorHelper(playerPosition.xCoord + playerLook.xCoord * reachDistance, playerPosition.yCoord + playerLook.yCoord * reachDistance, playerPosition.zCoord + playerLook.zCoord * reachDistance);
    int closest = -1;
    double closestdistance = Double.MAX_VALUE;
   
    for(int i = 0; i < wireparts.length; i++)
    {
View Full Code Here

Examples of net.minecraft.util.Vec3

    {
      return null;
    }
   
    double range = 64;
    Vec3 playerPos = Minecraft.getMinecraft().renderViewEntity.getPosition(1.0F);
   
    Vec3 playerLook = Minecraft.getMinecraft().renderViewEntity.getLook(1.0F);
    Vec3 playerLookRel = playerPos.addVector(playerLook.xCoord * range, playerLook.yCoord * range, playerLook.zCoord * range);
    List<?> list = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(Minecraft.getMinecraft().renderViewEntity,
        Minecraft.getMinecraft().renderViewEntity.boundingBox.addCoord(playerLook.xCoord * range, playerLook.yCoord * range, playerLook.zCoord * range)
            .expand(1, 1, 1));
   
    double entityDistTotal = range;
View Full Code Here

Examples of net.minecraft.util.Vec3

    }
   
    double range = MFRConfig.spyglassRange.getInt();
    MovingObjectPosition objHit = Minecraft.getMinecraft().renderViewEntity.rayTrace(range, 1.0F);
    double blockDist = range;
    Vec3 playerPos = Minecraft.getMinecraft().renderViewEntity.getPosition(1.0F);
   
    if(objHit != null)
    {
      blockDist = objHit.hitVec.distanceTo(playerPos);
    }
   
    Vec3 playerLook = Minecraft.getMinecraft().renderViewEntity.getLook(1.0F);
    Vec3 playerLookRel = playerPos.addVector(playerLook.xCoord * range, playerLook.yCoord * range, playerLook.zCoord * range);
    List<?> list = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(
        Minecraft.getMinecraft().renderViewEntity,
        Minecraft.getMinecraft().renderViewEntity.boundingBox.addCoord(playerLook.xCoord * range, playerLook.yCoord * range, playerLook.zCoord * range).expand(1, 1, 1));
   
    double entityDistTotal = blockDist;
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.