Skip to content
RobertoTornelPublic

About

NEI autocrafting for EMI: recursive crafting, tool-aware matching and AE2 terminals for Minecraft 1.20.1.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

MaEMI

MaEMI adds Not Enough Items-style crafting conveniences to Minecraft 1.20.1 on top of EMI. It does not replace EMI: EMI still owns the item index, search, recipe screens and recipe book, and there is no separate MaEMI panel to configure away. MaEMI supplies the parts EMI does not:

  • recursive autocrafting from the hovered item
  • tool-aware matching that reuses tools instead of demanding a fresh copy
  • tag-aware ingredient planning
  • AE2 terminal support, including ME network stock and the terminal crafting grid
  • a calculator built into EMI's search bar
  • extra tooltips, a data dump and a small settings screen

Features

Recursive autocrafting

  • Press C on an item in EMI or in a container to plan and run the craft.
  • The planner walks the recipe tree, crafts intermediates first and orders the steps so every ingredient is produced before it is consumed.
  • Cycles are detected, planning depth is bounded, and failed branches are abandoned after a bounded number of attempts.
  • If a craft cannot be completed, the message names the real missing ingredient rather than the item you asked for.
  • A craft that is already satisfied still adds the requested amount instead of silently doing nothing.
  • Every recursive step is restricted to recipes the currently open screen can fill, not just the first step.
  • Plans run on the client tick with a short delay between steps; pressing the key again replaces the current plan after returning anything left in the grid.
  • The current plan can be cancelled by opening another screen or by starting a new craft.

Craft amounts

Keys Amount
C 1
Ctrl + C 32
Shift + C 64
Ctrl + Shift + C as many as the current stock supports

Ctrl+Shift+C is bounded by the autocraft.maxCrafts setting (default 512) and the planner's step limit. The amount is read from the modifiers held when C is pressed.

Tools and damageable items

  • GregTech tools and other damageable items carry generated NBT such as tool stats and damage.
  • MaEMI compares those items without their NBT, so a used or specialised tool matches the plain tool a recipe asks for.
  • A tool is a requirement, not a consumed ingredient: one copy can satisfy every step in the plan.
  • Tool recipes with multiple batches are split into single crafts so the planner never asks for one tool per batch.
  • Candidate ingredients already in stock, or directly craftable from stock, are preferred over obscure variants.

Tags and ingredient choice

  • Recipes that accept a tag such as #minecraft:planks or #forge:tools/hammers are matched against every member of the tag.
  • Candidates are scored by whether they are in stock, whether their own recipe is shallow-craftable from stock, and then by recipe order.
  • This avoids choosing an obscure modded variant when a stocked, ordinary ingredient is available.

Leftovers and cleanup

  • When a plan finishes, fails, is cancelled or is replaced, items left in the crafting grid are quick-moved back to the player inventory.
  • Items held on the cursor are placed back into an empty player-inventory slot.
  • Vanilla crafting grids and AE2 crafting-terminal grids are handled.

AE2 terminals

  • Hovering an item in an AE2 storage or crafting terminal works even when EMI has no cached hover: MaEMI falls back to the focused slot and then to the slot under the cursor.
  • The ME network counts as stock even when AE2's expose network inventory to EMI option is off (the default). MaEMI reads the terminal's synced client repo directly.
  • Items in the terminal's own crafting grid count as stock.
  • Autocrafting in an AE2 crafting terminal transfers each recipe into the grid, takes the output, and repeats for the requested amount. This uses AE2's own terminal handler rather than injecting items.
  • AE2 is optional. If it is absent, none of this is loaded and nothing else changes.
  • Autocrafting needs a terminal with a crafting grid. A storage terminal can be hovered, but pressing C there reports that the screen cannot fill a recipe; use a crafting terminal or a wireless crafting terminal.

Screens and mod support

  • Vanilla crafting table, player inventory and crafting-station screens accept recipes that fit their grid.
  • Machine and terminal screens accept recipes that their own EMI recipe handler can fill; open the machine and press C there.
  • EMI's recipe browser is not a crafting screen. Pressing C there reports the wrong screen instead of pretending to craft.
  • Any mod that supplies a standard EMI recipe handler can be used; the screen decides what is possible.

Hover and tooltips

  • Hover lookup checks EMI's cached hover, the scaled cursor position, vanilla's focused slot, and finally the container slot under the cursor.
  • Extra tooltip lines show the registry id, mod name, stack count, tags and selected NBT data.
  • Tooltip limits and individual line groups are configurable.

Calculator in the search bar

  • Type arithmetic into EMI's search box and the value is drawn at the right edge of the field, in a dim colour, while you type. The field keeps every keystroke and click; the result is display only.
  • Click the value to pin the calculation and open the floating window; the search bar is cleared so the pinned calculation stands alone.
  • Supports + - * / %, parentheses, unary minus, decimals, and ^ or ** for powers, with the usual precedence. ((232134/23)*29+2.3)-90000000000000 answers itself.
  • Results are computed in BigDecimal and grouped for reading: that expression shows -89,999,999,707,307.004347826087 rather than -9.0E13. Scientific notation appears only when a value is genuinely too long to read.
  • Anything that is not a complete expression — 1/0, a half-typed 2+, an item name — simply yields no result. It never throws and never interferes with searching.
  • The parser is hand-written, with no script engine: it runs on the render thread on every keystroke, so input length, nesting depth and exponents are all bounded, and it cannot execute code.

The calculator window

  • The last result also appears in a small floating window, so a value can stay on screen after the search field loses focus.
  • Drag the title bar to move it; the position is clamped to the screen so it cannot be lost off-screen. Click the close button to hide it.
  • Click the pin button (next to close) to keep the calculation on screen until you explicitly close it. A pinned calculation is not replaced by new search-bar input.
  • Click the value to show or hide the expression beneath it.
  • Dragging the title bar reveals an inline editable label, so the window can be renamed in place.
  • Name, position, open state, pinned state and expression visibility are saved to config/nei.json under calculator, so the window comes back as you left it. The search-bar result can be switched off in settings.

Configuration and diagnostics

  • P opens the settings screen.
  • Cloth Config 11+ provides the normal config UI when installed; without it MaEMI opens a built-in fallback screen.
  • Settings live in config/nei.json and include autocraft depth, maximum craft amount, tooltip options, compatibility report logging and general toggles.
  • F8 writes a data dump for bug reports to config/nei-dump/: item ids, recipes, tags and related metadata.
  • A compatibility report is printed to the log at startup by default, naming detected and missing supported mods.

Loader support

  • One jar per loader: Fabric and Forge.
  • The Fabric jar is client-only metadata.
  • The Forge jar is runtime-guarded to the client; it does not add server content.
  • No blocks, items, entities, world generation, networking or server-side recipes are added.

Supported Minecraft versions

MaEMI is built for every Minecraft version EMI itself ships a build for. Each version lives on its own branch; every branch compiles and produces its own jars.

Minecraft Fabric Forge Branch
1.18.2 supported — 1.18.2
1.19.2 supported supported 1.19.2
1.19.3 supported supported 1.19.3
1.19.4 supported supported 1.19.4
1.20 supported supported 1.20
1.20.1 supported supported main, 1.20.1
1.20.2 supported supported 1.20.2
1.20.4 supported — 1.20.4
1.20.6 supported — 1.20.6
1.21 supported — 1.21
1.21.1 supported — 1.21.x, 1.21.1

Bold rows are the two lines with the most testing. Forge exists only through Minecraft 1.20.2; from 1.20.4 on the loaders are Fabric and NeoForge, and MaEMI ships Fabric there.

To build every version on one machine:

scripts/build-all-versions.sh          # all versions -> dist/<mc>/
scripts/upload-dist.sh                 # publish those jars to Modrinth

See version support notes for the full matrix and branch layout.

Dependencies

Required

Dependency Version Notes
Minecraft 1.18.2 – 1.21.1 One branch per version, see the table above
Java 17 or newer 21 for the 1.20.5+ branches
EMI The build for your Minecraft version Required; nothing works without it
Fabric Loader 0.15.0 or newer Fabric jars
Fabric API Matching your Minecraft version Fabric jars
Forge 43.x – 48.x Forge jars, Minecraft 1.19.2 – 1.20.2 only

EMI is the only mod MaEMI cannot run without. MaEMI is client-side; installing it on a dedicated server does nothing useful.

Optional

Dependency Version Purpose
Cloth Config Matching your version Normal settings UI
Mod Menu Matching your version Fabric mod-list config entry
Applied Energistics 2 Matching your version AE2 terminal stock, hover and crafting-grid support

Without Cloth Config, MaEMI uses its built-in fallback settings screen. Mod Menu is only a shortcut to the settings screen on Fabric. AE2 support is entirely optional.

Detected mod integrations

These are optional detection targets, not hard dependencies. A module is enabled only when the target mod is present; missing modules are skipped and listed in the startup compatibility report. They do not change the requirement that EMI must be installed.

Mod Detected id(s)
GregTech CEu gtceu
Applied Energistics 2 ae2
Create create
Mekanism mekanism
Thermal thermal, thermal_extra
Immersive Engineering immersiveengineering
Botania botania
Ars Nouveau ars_nouveau
Tinkers' Construct tconstruct
Farmer's Delight farmersdelight
Modern Industrialization modern_industrialization
Powah powah
Ad Astra ad_astra

Keybinds

Key Action
C Autocraft 1 of the hovered item
Ctrl + C Autocraft 32
Shift + C Autocraft 64
Ctrl + Shift + C Autocraft as many as possible
P Open MaEMI settings
F8 Write the data dump
Close calculator (unbound by default) Close the calculator window and unpin

The retired MaEMI panel, bookmark and hide actions are not registered, so they cannot steal keys from EMI or other mods.

Installation

  1. Install EMI, plus Fabric API on Fabric.
  2. Download the jar for your loader:
    • maemi-fabric-1.0.4.jar for Fabric
    • maemi-forge-1.0.4.jar for Forge
  3. Put exactly one of them in mods/. Do not install both loader jars in one instance.
  4. Launch the game. The first launch creates config/nei.json.
  5. Optionally install Cloth Config for the normal settings UI and Mod Menu for the Fabric config button.

Building

Requirements: Java 21 and the Gradle wrapper.

./gradlew build

The loader jars are written to:

  • fabric/build/libs/maemi-fabric-1.0.4.jar
  • forge/build/libs/maemi-forge-1.0.4.jar

Limitations

  • Autocrafting uses the open screen's EMI handler. A recipe that the screen cannot fill is not planned, even if another machine elsewhere could make it.
  • Machines are not automated remotely; the player must open the machine or terminal and press C.
  • AE2 stock and output handling depend on AE2's client terminal APIs. AE2 is optional and is not required to use MaEMI.
  • MaEMI does not add server-side recipe processing, items or world content.
  • The data dump is diagnostic output, not an import format.

Links

License

MaEMI is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). See LICENSE.

About

NEI autocrafting for EMI: recursive crafting, tool-aware matching and AE2 terminals for Minecraft 1.20.1.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages