Package com.flansmod.common.driveables

Examples of com.flansmod.common.driveables.EntityDriveable


  @Override
  public void handleServerSide(EntityPlayerMP playerEntity)
  {
    if(playerEntity.ridingEntity != null && playerEntity.ridingEntity instanceof EntitySeat)
    {
      EntityDriveable d = ((EntitySeat)playerEntity.ridingEntity).driveable;
      switch(guiID)
      {
      case 0 : //Guns
        playerEntity.openGui(FlansMod.INSTANCE, 6, playerEntity.worldObj, d.chunkCoordX, d.chunkCoordY, d.chunkCoordZ); break;
      case 1 : //Bombs / Mines
View Full Code Here


    {
      Object obj = worldObj.loadedEntityList.get(i);
      //Get driveables
      if(obj instanceof EntityDriveable)
      {
        EntityDriveable driveable = (EntityDriveable)obj;
       
        if(driveable.isDead() || driveable.isPartOfThis(owner))
          continue;
       
        //If this bullet is within the driveable's detection range
        if(getDistanceToEntity(driveable) <= driveable.getDriveableType().bulletDetectionRadius + speed)
        {
          //Raytrace the bullet
          ArrayList<BulletHit> driveableHits = driveable.attackFromBullet(origin, motion);
          hits.addAll(driveableHits);
        }
      }
      //Get players
      else if(obj instanceof EntityPlayer)
View Full Code Here

        for(int i = 0; i < world.loadedEntityList.size(); i++)
        {
          Object obj = world.loadedEntityList.get(i);
          if(obj instanceof EntityDriveable)
          {
            EntityDriveable driveable = (EntityDriveable)obj;
            //Raytrace
            DriveablePart part = driveable.raytraceParts(new Vector3f(posVec), Vector3f.sub(new Vector3f(lookVec), new Vector3f(posVec), null));
            //If we hit something that is healable
            if(part != null && part.maxHealth > 0)
            {
              //If its broken and the tool is inifinite or has durability left
              if(part.health < part.maxHealth && (type.toolLife == 0 || itemstack.getItemDamage() < itemstack.getMaxDamage()))
View Full Code Here

  }

  @Override
  public void handleServerSide(EntityPlayerMP playerEntity)
  {
    EntityDriveable driveable = null;
    for(Object obj : playerEntity.worldObj.loadedEntityList)
    {
      if(obj instanceof EntityDriveable && ((Entity)obj).getEntityId() == entityId)
      {
        driveable = (EntityDriveable)obj;
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void handleClientSide(EntityPlayer clientPlayer)
  {
    if(clientPlayer == null || clientPlayer.worldObj == null)
      return;
    EntityDriveable driveable = null;
    for(Object obj : clientPlayer.worldObj.loadedEntityList)
    {
      if(obj instanceof EntityDriveable && ((Entity)obj).getEntityId() == entityId)
      {
        driveable = (EntityDriveable)obj;
View Full Code Here

  }

  @Override
  public void handleServerSide(EntityPlayerMP playerEntity)
  {
    EntityDriveable driveable = null;
    for(Object obj : playerEntity.worldObj.loadedEntityList)
    {
      if(obj instanceof EntityDriveable && ((Entity)obj).getEntityId() == entityId)
      {
        driveable = (EntityDriveable)obj;
View Full Code Here

  @Override
  @SideOnly(Side.CLIENT)
  public void handleClientSide(EntityPlayer clientPlayer)
  {
    EntityDriveable driveable = null;
    for(Object obj : clientPlayer.worldObj.loadedEntityList)
    {
      if(obj instanceof EntityDriveable && ((Entity)obj).getEntityId() == entityId)
      {
        driveable = (EntityDriveable)obj;
View Full Code Here

  @Override
  @SideOnly(Side.CLIENT)
  public void handleClientSide(EntityPlayer clientPlayer)
  {
    EntityDriveable driveable = null;
    for(Object obj : clientPlayer.worldObj.loadedEntityList)
    {
      if(obj instanceof EntityDriveable && ((Entity)obj).getEntityId() == entityId)
      {
        driveable = (EntityDriveable)obj;
        break;
      }
    }
    if(driveable != null)
    {
          for(int i = 0; i < EnumDriveablePart.values().length; i++)
          {
            EnumDriveablePart ep = EnumDriveablePart.values()[i];
            DriveablePart part = driveable.getDriveableData().parts.get(ep);
            part.health = health[i];
            part.onFire = onFire[i];
          }
    }
  }
View Full Code Here

      }
     
      //DEBUG vehicles
      if(FlansMod.DEBUG && mc.thePlayer.ridingEntity instanceof EntitySeat)
      {
        EntityDriveable ent = ((EntitySeat)mc.thePlayer.ridingEntity).driveable;
        mc.fontRenderer.drawString("MotionX : " + ent.motionX, 2, 2, 0xffffff);
        mc.fontRenderer.drawString("MotionY : " + ent.motionY, 2, 12, 0xffffff);
        mc.fontRenderer.drawString("MotionZ : " + ent.motionZ, 2, 22, 0xffffff);
        mc.fontRenderer.drawString("Throttle : " + ent.throttle, 2, 32, 0xffffff);
        mc.fontRenderer.drawString("Break Blocks : " + TeamsManager.driveablesBreakBlocks, 2, 42, 0xffffff);
View Full Code Here

      MouseHelper mouse = mc.mouseHelper;
      Entity ridden = mc.thePlayer.ridingEntity;

      if (ridden instanceof EntityDriveable)
      {
        EntityDriveable entity = (EntityDriveable) ridden;
        entity.onMouseMoved(mouse.deltaX, mouse.deltaY);
      }
    }
   
    FlansModClient.renderTick(smoothing);
  }
View Full Code Here

TOP

Related Classes of com.flansmod.common.driveables.EntityDriveable

Copyright © 2018 www.massapicom. 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.