Skip to content

NeoForge 1.21.1 port#86

Closed
F0x06 wants to merge 4 commits into
SmashingMods:1.20.1from
F0x06:1.21.1
Closed

NeoForge 1.21.1 port#86
F0x06 wants to merge 4 commits into
SmashingMods:1.20.1from
F0x06:1.21.1

Conversation

@F0x06

@F0x06 F0x06 commented May 11, 2026

Copy link
Copy Markdown

Ports ChemLib from Forge 1.20.1 to NeoForge 1.21.1 (Java 21). No gameplay, recipe, or content changes — same elements, same compounds, same behavior.

@Dark-Arcana Dark-Arcana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items to address before merge:

  1. RecipeGenerator.buildRecipes is empty. The method body was deleted. Recipes still load at runtime because the previously-generated JSONs were renamed (from recipes/ to recipe/) and updated ("item" to "id") directly under src/generated/resources/. However, ./gradlew runData no longer regenerates them. Any future change to recipe shape requires editing approximately 385 JSON files manually. Restore the recipe generation code. The 1.21 API is buildRecipes(RecipeOutput), used with ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ...).save(output, ResourceLocation.fromNamespaceAndPath(...)).

  2. Config.loadConfig is dead code. NeoForge 1.21's ModContainer.registerConfig(ModConfig.Type, IConfigSpec) handles config file creation, loading, and reload events automatically. The previous manual loading code is no longer required, and the empty method body confirms this. Delete the empty loadConfig method and remove the Config.loadConfig(...) call from the ChemLib constructor.

  3. Attribute-modifier tooltips removed from FluidEffectsTooltipUtility.addTooltipEffects. The old code iterated over MobEffect.getAttributeModifiers() and added lines such as "+5 Max Health" to chemical-fluid bucket tooltips. The new code removes this section. The 1.21 replacement API is MobEffectInstance.forEachModifier(EquipmentSlotGroup, BiConsumer). Port the modifier-tooltip logic to the new API. The current code is a behavior regression.

  4. Mod-namespace tooltip line removed from chemical, element, and compound item tooltips and from bucket tooltips. The old appendHoverText overloads in ChemicalItem, CompoundItem, ElementItem, and ForgeEventHandler.gatherTooltipComponents added a styled "Chemlib" line at the bottom of tooltips using MOD_ID_TEXT_STYLE. All four locations were removed. NeoForge 1.21 does not automatically add a mod-source line to item tooltips. JEI and REI add it themselves, but vanilla and NeoForge do not. Restore the line in all four locations.

  5. ForgeEventHandler class name is misleading after the port. The class now subscribes to EventBusSubscriber.Bus.GAME and no longer uses the Forge event bus. Rename the class to GameEventHandler.

  6. Release notes for downstream consumers (Alchemistry):

    • Element.getGroupName() becomes getGroupKey(). The return value is a translation key, not a literal display string. Consumers must pass the value through Component.translatable(...).
    • BlockTagGenerator and ItemTagGenerator migrate tags from the forge: namespace to c:. This follows NeoForge 1.21's adoption of the cross-loader Common namespace (also used by Fabric). Any datapack that references #forge:dusts/iron, #forge:storage_blocks/iron, and similar tags must update its references to #c:....
    • ChemicalLiquidBlock constructor signature changes from Supplier<? extends FlowingFluid> to FlowingFluid.

  - Restore RecipeGenerator.buildRecipes against 1.21 RecipeOutput API
  - Drop dead Config.loadConfig and its call site
  - Restore attribute-modifier tooltips on chemical fluid buckets
  - Restore "Chemlib" namespace tooltip line on item and bucket hovers
  - Rename ForgeEventHandler to GameEventHandler
  - Add MIGRATION.md for downstream consumers
@F0x06 F0x06 closed this Jun 11, 2026
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.

2 participants