Applied-Energistics-2 icon indicating copy to clipboard operation
Applied-Energistics-2 copied to clipboard

Rework Storage Disassembly system to be based on Custom Recipes / Impl #6934

Open Kanzaji opened this issue 4 months ago • 0 comments

Resolves: #6934

This PR Implements a Quick-Switch feature from a suggestion #6934, and reworks the disassembly of storage components to be data-driven!

Disassembly system rework

The system uses two new recipe types - crafting_unit_transform and storage_cell_disassembly, schemas below, that handle the Upgrade (Crafting Units only) and disassembly results.

Schema for crafting_unit_transform recipes:

{
  "type": "ae2:crafting_unit_transform",
  "block": "ae2:16k_crafting_storage", // Has to be instance of AbstractCraftingUnitBlock<?>.
  "disassembly_items": [
    {
      "count": 1,
      "id": "ae2:cell_component_16k"
    }
  ],
  "upgrade_items": [
    "ae2:cell_component_16k" // List of acceptable items to upgrade to the specified block
  ],
  "disassembly_loot_table": "ae2:some/loot_table" // disassembly_items takes priority!
}

Schema for storage_cell_disassembly recipes:

{
  "type": "ae2:storage_cell_disassembly",
  "cell": "ae2:fluid_storage_cell_256k",
  "cell_disassembly_items": [
    // return itemstacks for cell
  ]
}

The disassembly process returns items based on the recipes. If the recipe is missing - disassembly is disabled and default action is executed.

Quick-Switch Crafting Unit types.

This feature allows for hot-swapping a type of Crafting Unit, by right-clicking the block with a correct upgrade item, or disassembling the block with Shift + Right Click.

The upgrade / disassembly will be aborted (and warning will be issued to the player) if the cluster of the Crafting Unit to be upgraded/disassembled is currently working on a crafting job, to avoid accidentally aborting a crafting job, and dropping all the items on the floor!

obraz

Bug Fixes

  • Fixed a crash when Portable Cell recipe was missing.
  • Fixed Storage Cell Upgrade in Crafting Grid voiding the old component.

Kanzaji avatar Oct 07 '24 12:10 Kanzaji