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 actionPerformed(GuiButton button) {
    if (!button.enabled) {
      return;
    }

    int next;

    switch (button.id) {
      case 0:
        next = -1;
        break;
      case 1:
        next = 1;
        break;
      default:
        return;
    }

    CraftingEX.NETWORK.sendToServer(new NextRecipeMessage(next));

    container.nextRecipe(next);
  }