Example #1
0
  public ItemStack getCraftedStack() {
    CraftRecipe recipe = getRecipe();
    if (recipe == null) return null;

    InventoryCrafting grid = handler.generateTemporaryCraftingGridFor(recipe, player, false);
    ItemStack craftedItem = handler.getRecipeResult(recipe, grid);

    return Utils.copyOf(craftedItem);
  }
Example #2
0
  @Override
  public void onPickupFromSlot(EntityPlayer player, ItemStack craftedItem) {
    if (player.capabilities.isCreativeMode && ConfigurationManager.ENABLE_FREECRAFTING
        || craftedItem == null) {
      FMLCommonHandler.instance().firePlayerCraftingEvent(player, craftedItem, matrix);
      super.onCrafting(craftedItem);
      return;
    }

    CraftRecipe recipe = getRecipe();
    if (recipe == null) return;

    handler.doCraft(recipe, player, craftedItem);
    FMLCommonHandler.instance().firePlayerCraftingEvent(player, craftedItem, matrix);
    super.onCrafting(craftedItem);
  }