Skip to content

Fix dedicated server crash in TooltipHelper.getEnergyText (I18n is client-only) - #875

Merged
Rearth merged 1 commit into
Rearth:26.1from
GnomoMuitoLoco:fix/server-energy-text-i18n
Nov 18, 2026
Merged

Rearth merged 1 commit into
Rearth:26.1from
GnomoMuitoLoco:fix/server-energy-text-i18n

Conversation

@GnomoMuitoLoco

Copy link
Copy Markdown
Contributor

Fixes #874.

TooltipHelper.getEnergyText used I18n.get for the k/M/B/T abbreviations. Since exp13 the Addon Splicer preview is built on the server (AddonSplicerBlockEntity.refreshOperation -> SplicerPreview.of -> HeartOfTheMachineAddonBlock.getShrinkTooltip -> getFormattedEnergyChangeTooltip), so this method now runs on a dedicated server and crashes it with NoClassDefFoundError: net/minecraft/client/resources/language/I18n as soon as a machine with addons loads.

This replaces the four I18n.get(key) calls with Component.translatable(key).getString(), which resolves through the current Language on both sides and produces the same text on the client.

Tested on a dedicated server (All the Mods 11 0.15.0-beta, NeoForge 26.1.2.126) by applying the same change to getEnergyText through a mixin.

I18n is client-only. Since the Addon Splicer preview is built on the server
(AddonSplicerBlockEntity.refreshOperation), getEnergyText is now reached on a
dedicated server and crashes it with NoClassDefFoundError. Fixes Rearth#874.
@Rearth

Rearth commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Hi, huge thanks for testing and validating this.

@Rearth
Rearth merged commit 52adc6a into Rearth:26.1 Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dedicated server crash: NoClassDefFoundError I18n in TooltipHelper.getEnergyText via Addon Splicer preview (2.0.0-exp13)

2 participants