Skip to content

Add various mod items to ModItems registry#41

Merged
The-Code-Monkey merged 5 commits into1.21from
mass-item-setup-1
Feb 15, 2026
Merged

Add various mod items to ModItems registry#41
The-Code-Monkey merged 5 commits into1.21from
mass-item-setup-1

Conversation

@The-Code-Monkey
Copy link
Contributor

@The-Code-Monkey The-Code-Monkey commented Feb 14, 2026

Summary by CodeRabbit

  • New Features

    • Added dozens of new items across materials, metals, mob drops, textiles, seeds/crops, magical essences, and flower petals.
    • All new items are automatically included in the mod’s creative inventory tab for easy access.
  • Documentation / Localization

    • Added comprehensive English translation entries for the new blocks and items, organized by category.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Added many new item declarations to the ModItems registry and wired their registration to automatically add them to the ModCreativeTab via ItemGroupEvents.modifyEntriesEvent; also added numerous English translation entries in ModLangProvider. No public method signatures were changed.

Changes

Cohort / File(s) Summary
Item Registry
src/main/java/com/tcm/MineTale/registry/ModItems.java
Added many new public Item constants (natural materials, minerals/refined metals, hides/leathers, fabrics, seeds, magical/alchemical items, flora petals). Registration now records created items into a REGISTERED_ITEMS list and hooks ItemGroupEvents.modifyEntriesEvent to add them to the ModCreativeTab.
Language Provider
src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java
Removed some Javadoc and added numerous English translation entries organized by category (blocks, materials, minerals, hides, fabrics, seeds, magical components, flora). Method signatures unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 I hopped through crates of code and light,
Plucked petals, shards, and ingots bright,
I placed each trinket in the tab with care,
A burrowed trove of goods to share,
Hop—inventory full, I dance in moonlight ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add various mod items to ModItems registry' directly and accurately describes the main change: adding numerous new item declarations to the ModItems registry class.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into 1.21

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mass-item-setup-1

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java (1)

57-125: Consider deriving translation keys from item references to prevent drift.

All translation keys are hardcoded strings (e.g., "item.minetale.plant_fiber"). If an item's registry name changes in ModItems, the translation here silently becomes orphaned. Using ModItems.PLANT_FIBER.getDescriptionId() (or the TranslationBuilder.add(ItemLike, String) overload if available) would keep them in sync at compile time.

This is low-risk for now given the items were just added together, but worth considering as the list grows.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/main/java/com/tcm/MineTale/registry/ModItems.java`:
- Line 66: The LETTUCE item is registered with default Item.Properties() so it
isn't edible; if it should be consumable, update the registration for LETTUCE to
supply a Food object via Item.Properties().food(...) (e.g., create a
Food.Builder with the desired nutrition/saturation/effects and pass it into the
LETTUCE registration), otherwise leave it as-is if it is only a crafting
ingredient; locate the LETTUCE constant and modify its Item.Properties() call in
the register("lettuce", Item::new, ...) invocation accordingly.
🧹 Nitpick comments (2)
src/main/java/com/tcm/MineTale/registry/ModItems.java (2)

75-80: Consider adding rarity or stack-size limits to magical/unique items.

Items like ESSENCE_OF_THE_VOID and VOID_HEART are semantically rare or powerful. You may want to set .rarity(Rarity.RARE) or .stacksTo(16) on their properties to reflect that in-game. Fine to defer if this is a placeholder pass.


67-73: Seed bags and bulbs may need planting behavior.

These are all plain Item instances. If any seed bag or ONION_BULB should be plantable on farmland, they'd typically extend or configure an ItemNameBlockItem (or similar) linked to a crop block. Fine to defer if crop blocks aren't implemented yet.

The-Code-Monkey and others added 3 commits February 14, 2026 20:06
Automatically add registered items to the creative tab.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java (1)

19-23: ⚠️ Potential issue | 🟡 Minor

Add missing translation for workbench_workbench_block.

ModBlocks.WORKBENCH_WORKBENCH_BLOCK is registered and added to the creative tab (line 22 in ModCreativeTab.java), but lacks a corresponding translation entry in ModLangProvider.java. Add the translation for block.minetale.workbench_workbench_block.

🤖 Fix all issues with AI agents
In `@src/main/java/com/tcm/MineTale/registry/ModItems.java`:
- Around line 103-106: The current code in ModItems registers an
ItemGroupEvents.modifyEntriesEvent listener per item (using
entries.accept(item)), which creates ~58 listeners; instead, in ModItems.collect
all item Instances into a List (e.g., a private static List<Item> items or
similar during each item registration) and then in ModItems.initialize()
register a single
ItemGroupEvents.modifyEntriesEvent(ModCreativeTab.MINETALE_CREATIVE_TAB_KEY)
listener that iterates the list and calls entries.accept(item) for each item;
update any per-item registration sites to add the created Item to that list (not
register the event), and remove the per-item ItemGroupEvents.register calls so
only the single bulk listener in initialize() remains.

@The-Code-Monkey The-Code-Monkey merged commit 6c73c8d into 1.21 Feb 15, 2026
3 checks passed
This was referenced Feb 15, 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.

1 participant