Пример #1
0
  /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */
  @Override
  public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    super.drawScreen(mouseX, mouseY, partialTicks);
    boolean var4 = mc.thePlayer.capabilities.isCreativeMode;
    int var5 = field_147075_G.func_178147_e();

    for (int var6 = 0; var6 < 3; ++var6) {
      int var7 = field_147075_G.enchantLevels[var6];
      int var8 = field_147075_G.field_178151_h[var6];
      int var9 = var6 + 1;

      if (func_146978_c(60, 14 + 19 * var6, 108, 17, mouseX, mouseY) && var7 > 0 && var8 >= 0) {
        ArrayList<Object> var10 = Lists.newArrayList();
        String var11;
        if (var8 >= 0 && Enchantment.enchantmentsList[var8 & 255] != null) {
          var11 = Enchantment.enchantmentsList[var8 & 255].getTranslatedName((var8 & 65280) >> 8);
          var10.add(
              EnumChatFormatting.WHITE.toString()
                  + EnumChatFormatting.ITALIC.toString()
                  + I18n.format("container.enchant.clue", new Object[] {var11}));
        }

        if (!var4) {
          if (var8 >= 0) var10.add("");

          if (mc.thePlayer.experienceLevel < var7)
            var10.add(
                EnumChatFormatting.RED.toString()
                    + "Level Requirement: "
                    + field_147075_G.enchantLevels[var6]);
          else {
            var11 = "";

            if (var9 == 1) var11 = I18n.format("container.enchant.lapis.one", new Object[0]);
            else
              var11 =
                  I18n.format("container.enchant.lapis.many", new Object[] {Integer.valueOf(var9)});

            if (var5 >= var9) var10.add(EnumChatFormatting.GRAY.toString() + "" + var11);
            else var10.add(EnumChatFormatting.RED.toString() + "" + var11);

            if (var9 == 1) var11 = I18n.format("container.enchant.level.one", new Object[0]);
            else
              var11 =
                  I18n.format("container.enchant.level.many", new Object[] {Integer.valueOf(var9)});

            var10.add(EnumChatFormatting.GRAY.toString() + "" + var11);
          }
        }

        drawHoveringText(var10, mouseX, mouseY, fontRendererObj);
        break;
      }
    }
  }
Пример #2
0
 @SideOnly(Side.CLIENT)
 @Override
 public void addInformation(ItemStack is, EntityPlayer ep, List li, boolean verbose) {
   int i = is.getItemDamage();
   if (i < MaterialRegistry.matList.length) {
     if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
       MaterialRegistry mat = MaterialRegistry.matList[i];
       double torque = mat.getMaxShaftTorque();
       double speed = mat.getMaxShaftSpeed();
       li.add(
           String.format(
               "Max Speed: %.3f %srad/s",
               ReikaMathLibrary.getThousandBase(speed), ReikaEngLibrary.getSIPrefix(speed)));
       li.add(
           String.format(
               "Max Torque: %.3f %sNm",
               ReikaMathLibrary.getThousandBase(torque), ReikaEngLibrary.getSIPrefix(torque)));
     } else {
       StringBuilder sb = new StringBuilder();
       sb.append("Hold ");
       sb.append(EnumChatFormatting.GREEN.toString());
       sb.append("Shift");
       sb.append(EnumChatFormatting.GRAY.toString());
       sb.append(" for load data");
       li.add(sb.toString());
     }
   }
 }
  private void addContentsToCellDescription(
      HandlerItemEssentiaCell cellHandler, List displayList, EntityPlayer player) {
    // Get the list of stored aspects
    List<AspectStack> cellAspects = cellHandler.getAvailableAspects();

    // Sort the list
    Collections.sort(cellAspects, new AspectStackComparator());

    for (AspectStack currentStack : cellAspects) {
      if (currentStack != null) {
        // Get the chat color
        String aspectChatColor = currentStack.getChatColor();

        // Does this aspect have color?
        if (aspectChatColor != null) {
          // Add the color header
          aspectChatColor = GuiHelper.CHAT_COLOR_HEADER + aspectChatColor;
        } else {
          // It does not, set to gray
          aspectChatColor = EnumChatFormatting.GRAY.toString();
        }

        // Build the display string
        String aspectInfo =
            String.format(
                "%s%s%s x %d",
                aspectChatColor,
                currentStack.getAspectName(player),
                EnumChatFormatting.GRAY.toString(),
                currentStack.amount);

        // Add to the list
        displayList.add(aspectInfo);
      }
    }
  }