Package com.flansmod.common.driveables

Examples of com.flansmod.common.driveables.DriveablePart


   
    if(toggleTimer == 0 && autoRepair())
    {
      for(EnumDriveablePart part: EnumDriveablePart.values())
      {
        DriveablePart thisPart = data.parts.get(part);
        boolean hasCreativePlayer = seats != null && seats[0] != null && seats[0].riddenByEntity instanceof EntityPlayer && ((EntityPlayer)seats[0].riddenByEntity).capabilities.isCreativeMode;
        if(thisPart != null && thisPart.health < thisPart.maxHealth && (hasCreativePlayer || data.fuelInTank >= 10F))
        {
          thisPart.health += 1;
          if(!hasCreativePlayer)
View Full Code Here


    private void updateButtons()
    {
      int y = 43;
      for(int i = 0; i < partsToDraw.size(); i++)
      {
        DriveablePart part = partsToDraw.get(i);
        GuiButton button = (GuiButton)buttonList.get(i);
        button.xPosition = guiOriginX + 9;
        button.yPosition = part.health <= 0 ? guiOriginY + y : -1000;
        y += part.health <= 0 ? 40 : 20;
      }
View Full Code Here

          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

      health = new short[EnumDriveablePart.values().length];
      onFire = new boolean[EnumDriveablePart.values().length];
      for(int i = 0; i < EnumDriveablePart.values().length; i++)
      {
        EnumDriveablePart ep = EnumDriveablePart.values()[i];
        DriveablePart part = driveable.getDriveableData().parts.get(ep);
        health[i] = (short)part.health;
        onFire[i] = part.onFire;
      }
  }
View Full Code Here

    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

TOP

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

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.