跳到正文

Pondus inventory & TFMG Fix

作者:WarDreg

Fixes the TFMG Blast Stove crash when Pondus Inventory queries a fluid handler without a side (MC 1.21.1 / NeoForge). Not needed on TFMG Community Edition 1.3.0+. Open source, MIT.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

🇬🇧 English · 🇷🇺 Русский

This description is bilingual: the English version comes first, the Russian one is below the divider at the
«Русский» heading. Full docs: README.md
(English) · README.ru.md
(Русский).

A small NeoForge 1.21.1 addon that removes the Create: The Factory Must Grow (TFMG) crash caused by
Pondus Inventory querying a Blast Stove for its fluid handler without a side.

Open source (MIT): https://github.com/smirnovmihail1357-netizen/pondus-inventory-tfmg-fix

Do I still need this addon?

  • TFMG Community Edition 1.3.0 and newer (1.3.0, 1.3.1, 1.3.2, 1.3.2a, 1.3.3) — the bug is fixed by the fork itself: the Blast Stove answers an unsided query with a dedicated combined handler. The addon is not needed, you can delete it from mods/.
  • Official TFMG (latest build 1.2.0, 2026-01-07, the project has not been updated since) — the bug is not fixed, the addon is needed.
  • TFMG Community Edition 1.2.3a, 1.2.4, 1.2.4a, 1.2.4b — the fork exists, but this specific null check was not there yet: the addon is needed.
  • Pondus Inventory 0.10-Beta … 0.15-Beta (latest, 2026-07-04) — the unsided query was never changed, so no Pondus release fixes it on its side.

Everything above was verified by decompiling the corresponding jars (CFR 0.152) and reading bytecode with
javap, not by reading changelogs.

What crashes

InventoryMassCalculator / ModdedInventoryHelper (Pondus 0.15-Beta) call the fluid capability with null
instead of a Direction, and the Blast Stove provider dereferences it:

// tfmg-1.2.0.jar, BlastStoveBlockEntity.registerCapabilities
if (context.getAxis() == Direction.Axis.Y) return be.primaryCapability;   // context == null -> NullPointerException

In TFMG 1.2.0 the Blast Stove is the only one of 31 registerBlockEntity(Capabilities…) providers that
dereferences the context without a null check.

How the fix works

A mixin redirects the Direction.getAxis() call inside the generated lambda provider and returns the vertical
axis when no side was requested — so Pondus gets exactly the handler TFMG already returns for the top/bottom
face of the multiblock, instead of a crash:

@Redirect(
    method = {"lambda$registerCapabilities$1", "lambda$registerCapabilities$0", "lambda$registerCapabilities$2"},
    at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Direction;getAxis()Lnet/minecraft/core/Direction$Axis;", remap = true),
    expect = 0, require = 0, remap = false
)
private static Direction.Axis warvior$resolveCapabilityAxis(Direction queriedSide) {
    return queriedSide == null ? warvior$UNSIDED_QUERY_AXIS : queriedSide.getAxis();
}

Since 1.2.0 the injection is optional (require = 0) and the tfmg dependency range is [1.1.0, 1.4), so
the jar also loads next to TFMG Community Edition instead of blocking startup. The mod logs which TFMG and
Pondus versions it found and whether the patch is actually required or inert.

Installation

NeoForge 21.1.230+ on Minecraft 1.21.1, plus Create, TFMG and Pondus Inventory. Put the jar into mods/.

Official TFMG is declared as an optional dependency here on purpose: TFMG Community Edition reuses the same
modId (tfmg) and marks the original project as incompatible, so modpacks should not be forced to install
both.

Older builds (1.0.1, 1.0.0) are unlisted: they only support official TFMG 1.2.0 and are superseded by 1.2.0.

Source and license

https://github.com/smirnovmihail1357-netizen/pondus-inventory-tfmg-fix — MIT. Build with ./gradlew build.
Docs: README.md
(English) / README.ru.md
(Русский).


Русский

Небольшой аддон для NeoForge 1.21.1, который убирает краш Create: The Factory Must Grow (TFMG), возникающий
из-за того, что Pondus Inventory запрашивает флюидный хэндлер Blast Stove без стороны.

Открытый код (MIT): https://github.com/smirnovmihail1357-netizen/pondus-inventory-tfmg-fix

Нужен ли аддон сейчас

  • TFMG Community Edition 1.3.0 и новее (1.3.0, 1.3.1, 1.3.2, 1.3.2a, 1.3.3) — баг исправлен самим форком: Blast Stove отвечает на запрос без стороны отдельным «комбинированным» хэндлером. Аддон не нужен, его можно удалить из mods/.
  • Официальный TFMG (последняя сборка 1.2.0 от 07.01.2026, проект с тех пор не обновлялся) — баг не исправлен, аддон нужен.
  • TFMG Community Edition 1.2.3a, 1.2.4, 1.2.4a, 1.2.4b — форк уже есть, но именно этой null-проверки в нём ещё нет: аддон нужен.
  • Pondus Inventory 0.10-Beta … 0.15-Beta (последняя от 04.07.2026) — способ запроса без стороны не изменён, со стороны Pondus починки нет ни в одной версии.

Всё перечисленное проверено декомпиляцией соответствующих jar-файлов (CFR 0.152) и байткодом через javap, а не
по changelog.

Что именно крашится

InventoryMassCalculator и ModdedInventoryHelper (Pondus 0.15-Beta) вызывают возможность флюидов с null
вместо Direction, а провайдер Blast Stove разворачивает этот контекст без проверки:

// tfmg-1.2.0.jar, BlastStoveBlockEntity.registerCapabilities
if (context.getAxis() == Direction.Axis.Y) return be.primaryCapability;   // context == null -> NullPointerException

В TFMG 1.2.0 Blast Stove — единственный из 31 вызова registerBlockEntity(Capabilities…), который разыменовывает
контекст без null-проверки.

Как лечит аддон

Mixin подменяет сам вызов Direction.getAxis() внутри сгенерированного лямбда-провайдера и возвращает
вертикальную ось, когда сторона не указана. Pondus получает ровно тот хэндлер, который TFMG и так отдаёт для
верхней/нижней грани многоблока, вместо исключения.

Начиная с 1.2.0 инъекция опциональна (require = 0), а диапазон зависимости tfmg расширен до
[1.1.0, 1.4) — мод загружается и рядом с Community Edition, а не блокирует запуск. В лог пишется, какие версии
TFMG и Pondus найдены и нужен ли патч в этом наборе.

Установка

NeoForge 21.1.230+ на Minecraft 1.21.1, плюс Create, TFMG и Pondus Inventory. Jar положить в mods/.

Официальный TFMG указан здесь как необязательная зависимость сознательно: Community Edition использует тот же
modId (tfmg) и помечает оригинальный проект несовместимым, поэтому модпаки не должны ставить оба сразу.

Старые сборки (1.0.1, 1.0.0) скрыты из списка (unlisted): они поддерживают только официальный TFMG 1.2.0 и
заменены версией 1.2.0.

Исходники и лицензия

https://github.com/smirnovmihail1357-netizen/pondus-inventory-tfmg-fix — MIT, сборка ./gradlew build.
Документация: README.md
(English) / README.ru.md
(Русский).

常见问题

Pondus inventory & TFMG Fix 支持哪些 Minecraft 版本?

Pondus inventory & TFMG Fix 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

Pondus inventory & TFMG Fix 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

WarDreg 的其他作品

查看全部 →