Ejemplo n.º 1
0
  protected void resultSelected(ItemStack stack) {
    int prev = container.getCurrentIndex();

    container.resetCurrentIndex();

    for (int i = 0; i < container.getRecipeSize(); ++i) {
      if (ItemStack.areItemStacksEqual(stack, container.getNextRecipe(i))) {
        CraftingEX.NETWORK.sendToServer(new NextRecipeMessage(i));

        container.nextRecipe(i);

        return;
      }
    }

    container.nextRecipe(prev);
  }
Ejemplo n.º 2
0
  @Override
  protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    fontRendererObj.drawString(I18n.format("container.crafting") + " EX", 28, 6, 0x404040);
    fontRendererObj.drawString(I18n.format("container.inventory"), 8, ySize - 94, 0x404040);

    if (container.isRecipes()) {
      String str = container.getCurrentIndex() + 1 + " / " + container.getRecipeSize();
      recipesX = xSize - fontRendererObj.getStringWidth(str) - 10;
      recipesY = 6;
      fontRendererObj.drawString(str, recipesX, recipesY, 0x707070);
    }

    if (mouseX >= guiLeft && mouseX <= guiLeft + 20 && mouseY >= guiTop && mouseY <= guiTop + 20) {
      GlStateManager.pushMatrix();
      GlStateManager.scale(0.82F, 0.82F, 1.0F);
      RenderHelper.enableGUIStandardItemLighting();
      itemRender.zLevel = 100.0F;
      itemRender.renderItemAndEffectIntoGUI(CRAFTING_TABLE, 6, 6);
      itemRender.zLevel = 0.0F;
      RenderHelper.disableStandardItemLighting();
      GlStateManager.popMatrix();
    }
  }