Applied Flux

Applied Flux

9M Downloads

Add Mass Pattern Copy and Paste Functionality to Pattern Modifier

IL0co opened this issue · 2 comments

commented

Problem

Creating multiple identical ME Pattern Providers, each containing numerous recipes, is a tedious and time-consuming task when done manually. For example, replicating 24 ME Pattern Providers with 22 recipes each requires repetitive actions that are inefficient with current methods.

Proposal

Introduce a new functionality to the Pattern Modifier that allows for quick copying and pasting of all processing patterns from one ME Pattern Provider to another using simple keyboard shortcuts:

  • Shift + Right-Click on an ME Pattern Provider to copy all its patterns into the Pattern Modifier's memory.
  • Right-Click on another ME Pattern Provider to paste the copied patterns into it.

Implementation Details

Copying Patterns (Shift + Right-Click)

  1. Copy Operation: When the player Shift + Right-Clicks on an ME Pattern Provider, all its processing patterns—including any NBT data like Advanced Pattern Templates from AdvancedAE—are copied into the Pattern Modifier's memory.
  2. Pattern Limit: To prevent potential crashes from copying excessive data (e.g., patterns from large multiblocks like the Assembly Line that can hold over 1,000 patterns), a limit on the number of patterns that can be copied should be set. This limit could be a static number like 64 or match the slot count of the largest ME Pattern Provider in the game.

Pasting Patterns (Right-Click)

Before initiating the paste operation, the player can select a paste mode:

  • Full Replacement: Existing patterns in the target ME Pattern Provider are removed.
  • Add to Existing (No Duplicates): Copied patterns are added to the existing patterns without creating duplicates.
  1. Pasting Operation:

    • Full Replacement Mode:

      • Existing patterns in the target ME Pattern Provider are converted into empty patterns and temporarily stored in the Pattern Modifier's memory until the operation is complete.
      • The copied patterns are then pasted into the ME Pattern Provider from the Pattern Modifier's memory.
    • Add to Existing Mode:

      • The copied patterns are compared with the existing ones in the target ME Pattern Provider.
      • Only patterns not already present are added to the ME Pattern Provider.
      • If a template in the target ME template provider has the same output material but different inputs, the template will be duplicated.
  2. Resource Usage:

    • Empty patterns are utilized in the following order:
      • From the patterns saved during the removal of existing patterns (if in Full Replacement mode).
      • From the Copy Mode in Pattern Modifier (CMPM) slots.
      • From empty patterns available in the player's inventory.
  3. Insufficient Resources Handling:

    • If there aren't enough empty patterns, the operation proceeds partially, and the player receives a notification.
    • If the ME Pattern Provider doesn't have enough free slots, partial pasting occurs with a corresponding notification.

Benefits

  • Efficiency: Significantly reduces the time required to replicate ME Pattern Providers with multiple recipes, streamlining the automation setup process.
  • User-Friendly: Simplifies the workflow by minimizing manual operations, making it more intuitive and less labor-intensive, especially when dealing with numerous ME Pattern Providers.

Applicability

This feature could be extended beyond ME Pattern Providers to any machinery that supports patterns, such as Molecular Assemblers and similar devices, enhancing its utility across various components of the automation system.

Note

  • CMPM — Copy Mode in Pattern Modifier.
commented

i have to remind you that ae's memory card can copy and paste patterns between pattern providers

commented

Yes, I just checked and it works, but it doesn't work if we insert more patterns than the ME Pattern Provider can accommodate. For example, if we try to insert 12 patterns from another 36-slot ME Pattern Provider into a basic 9-slot ME Pattern Provider.

Before writing the proposal, the day before I checked it on the second case. 🤦‍♂️