Examples of MachineType


Examples of com.google.api.services.compute.model.MachineType

          metadata.getItems().add(meta);
        }

        create.setImage(foundImage.getSelfLink());

        MachineType flavor = getClosestInstanceType(request);
        if (flavor == null) {
          throw new OpsException("Cannot determine machine type for request");
        }
        create.setMachineType(flavor.getSelfLink());

        if (request.securityGroups != null) {
          // TODO: Reimplement if needed
          throw new UnsupportedOperationException();
        }
View Full Code Here

Examples of com.google.api.services.compute.model.MachineType

      }

      candidates.add(flavor);
    }

    MachineType bestFlavor = findCheapest(candidates);
    if (bestFlavor == null) {
      return null;
    }

    return bestFlavor;
View Full Code Here

Examples of com.google.api.services.compute.model.MachineType

    return bestFlavor;
  }

  private MachineType findCheapest(List<MachineType> candidates) {
    MachineType bestFlavor = null;
    float bestPrice = Float.MAX_VALUE;

    for (MachineType candidate : candidates) {
      float price = computePrice(candidate);
      if (price < bestPrice) {
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  public boolean isProperMachine(ItemStack itemStack)
  {
    if(itemStack != null && itemStack.getItem() instanceof ItemBlockMachine)
    {
      MachineType type = MachineType.get(itemStack);

      if(type == MachineType.ENERGIZED_SMELTER || type == MachineType.ENRICHMENT_CHAMBER ||
          type == MachineType.CRUSHER || type == MachineType.OSMIUM_COMPRESSOR ||
          type == MachineType.COMBINER || type == MachineType.PURIFICATION_CHAMBER)
      {
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

    }

    GL11.glPushMatrix();
    GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);

    MachineType type = MachineType.get(block, metadata);

    if(type == MachineType.ELECTRIC_PUMP)
    {
      GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
      GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  @Override
  @SideOnly(Side.CLIENT)
  public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
  {
    MachineType type = MachineType.get(itemstack);

    if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
    {
      list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails") + ".");
      list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " and " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDesc") + ".");
    }
    else if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.modeSwitchKey))
    {
      if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
      {
        list.add(EnumColor.INDIGO + MekanismUtils.localize("tooltip.recipeType") + ": " + EnumColor.GREY + RecipeType.values()[getRecipeType(itemstack)].getName());
      }

      if(type == MachineType.ELECTRIC_CHEST)
      {
        list.add(EnumColor.INDIGO + MekanismUtils.localize("tooltip.auth") + ": " + EnumColor.GREY + LangUtils.transYesNo(getAuthenticated(itemstack)));
        list.add(EnumColor.INDIGO + MekanismUtils.localize("tooltip.locked") + ": " + EnumColor.GREY + LangUtils.transYesNo(getLocked(itemstack)));
      }
     
      if(type == MachineType.PORTABLE_TANK)
      {
        list.add(EnumColor.INDIGO + MekanismUtils.localize("tooltip.portableTank.bucketMode") + ": " + EnumColor.GREY + LangUtils.transYesNo(getBucketMode(itemstack)));
      }

      if(type.isElectric)
      {
        list.add(EnumColor.BRIGHT_GREEN + MekanismUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergyStored(itemstack)));
      }

      if(hasTank(itemstack))
      {
        if(getFluidStack(itemstack) != null)
        {
          list.add(EnumColor.PINK + FluidRegistry.getFluidName(getFluidStack(itemstack)) + ": " + EnumColor.GREY + getFluidStack(itemstack).amount + "mB");
        }
      }

      if(supportsUpgrades(itemstack))
      {
        list.add(EnumColor.PURPLE + MekanismUtils.localize("tooltip.upgrade.energy") + ": " + EnumColor.GREY + "x" + (getEnergyMultiplier(itemstack)+1));
        list.add(EnumColor.PURPLE + MekanismUtils.localize("tooltip.upgrade.speed") + ": " + EnumColor.GREY + "x" + (getSpeedMultiplier(itemstack)+1));
      }

      if(type != MachineType.CHARGEPAD && type != MachineType.LOGISTICAL_SORTER)
      {
        list.add(EnumColor.AQUA + MekanismUtils.localize("tooltip.inventory") + ": " + EnumColor.GREY + LangUtils.transYesNo(getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0));
      }
    }
    else {
      list.addAll(MekanismUtils.splitLines(type.getDescription()));
    }
  }
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  }
 
  @Override
    public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
    {
    MachineType type = MachineType.get(stack);
   
    if(type == MachineType.PORTABLE_TANK && getBucketMode(stack))
    {
      return false;
    }
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  @Override
  public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
  {
    boolean place = true;
   
    MachineType type = MachineType.get(stack);

    if(type == MachineType.DIGITAL_MINER)
    {
      for(int xPos = x-1; xPos <= x+1; xPos++)
      {
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  }

  @Override
  public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
  {
    MachineType type = MachineType.get(itemstack);
   
    if(type == MachineType.ELECTRIC_CHEST)
    {
      if(world != null && !world.isRemote)
      {
View Full Code Here

Examples of mekanism.common.block.BlockMachine.MachineType

  @Override
  public boolean supportsUpgrades(Object... data)
  {
    if(data[0] instanceof ItemStack)
    {
      MachineType type = MachineType.get((ItemStack)data[0]);

      return type.supportsUpgrades;
    }

    return false;
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.