Skip to content

Add loads more blocks#46

Merged
The-Code-Monkey merged 9 commits into1.21from
feat/add-items
Feb 15, 2026
Merged

Add loads more blocks#46
The-Code-Monkey merged 9 commits into1.21from
feat/add-items

Conversation

@The-Code-Monkey
Copy link
Contributor

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

Summary by CodeRabbit

  • New Features

    • Many new environment-specific ore blocks and corresponding ore items (e.g., thorium, cobalt, adamantite, mithril) added and available in-game.
  • Changes

    • Seven log types removed: Ash, Aspen, Azure, Cedar, Dry, Blue Fig, Petrified.
    • Steel ingot item removed from the item list.
  • UI

    • Creative tab updated to show new ores and reflect removed log blocks.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Removes seven log block declarations and their tag/model/creative registrations; adds many ore block declarations; introduces a REGISTERED_BLOCKS collection and helper registration methods to populate the creative tab via ModBlocks.initialize.

Changes

Cohort / File(s) Summary
Block registry & new ores
src/main/java/com/tcm/MineTale/registry/ModBlocks.java
Removed seven public log block declarations; added numerous public ore block declarations; added REGISTERED_BLOCKS, registerOreBlock(...), adjusted register(...) and initialize() to collect/register blocks for the creative tab.
Creative tab registration
src/main/java/com/tcm/MineTale/item/ModCreativeTab.java
Removed explicit displayItems(...) lambda that enumerated many blocks; creative tab population moved to ModBlocks via REGISTERED_BLOCKS.
Data generation — tags & models
src/client/java/com/tcm/MineTale/datagen/ModBlockTagProvider.java, src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java
Removed tag and blockstate/model registrations for the seven removed logs (ASH, ASPEN, AZURE, CEDAR, DRY, BLUE_FIG, PETRIFIED); remaining log registrations unchanged; minor comment/whitespace edits.
Items
src/main/java/com/tcm/MineTale/registry/ModItems.java
Removed STEEL_INGOT; added ore item declarations: THORIUM_ORE, COBALT_ORE, ADAMANTITE_ORE, MITHRIL_ORE.

Sequence Diagram(s)

sequenceDiagram
  participant ModBlocks as ModBlocks (code)
  participant Registry as Game Registry
  participant Registered as REGISTERED_BLOCKS (list)
  participant Creative as ModCreativeTab

  ModBlocks->>Registry: register(name, Block, optionally Item)
  Registry-->>ModBlocks: registration result
  ModBlocks->>Registered: add(block reference)
  ModBlocks->>Creative: initialize(MINETALE_CREATIVE_TAB_KEY)
  Creative->>Registered: iterate registered blocks
  Registered-->>Creative: provide block entries
  Creative->>Registry: add blocks/items to creative tab group
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • AnyaPizza

Poem

🐰 I hopped through code with whiskers bright,
Seven old logs trimmed out of sight,
New ores glint where my paws did tread,
I cheered and munched a carrot instead—
Dig deep, dear coder, into the night ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Add loads more blocks' is vague and generic, using informal language ('loads more') that doesn't convey specific information about the actual changes made. Use a more descriptive title such as 'Add ore blocks and remove log blocks' or 'Refactor block registry with ore block support' to clearly indicate the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 feat/add-items

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #48

Docstrings generation was requested by @The-Code-Monkey.

* #46 (comment)

The following files were modified:

* `src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java`
@The-Code-Monkey
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

✅ Actions performed

Full review triggered.

Docstrings generation was requested by @The-Code-Monkey.

* #46 (comment)

The following files were modified:

* `src/main/java/com/tcm/MineTale/registry/ModBlocks.java`
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: 2

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/ModModelProvider.java (1)

42-69: ⚠️ Potential issue | 🟠 Major

Add model/blockstate generation for all 48 ore blocks.

The ore blocks (COPPER, ONYXIUM, THORIUM, ADAMANTITE, MITHRIL, COBALT, IRON, GOLD, SILVER variants across different base rocks) have no corresponding generateBlockStateModels entries. Without blockstate and model definitions, these blocks will render as missing-texture purple/black cubes in-game.

Use blockStateModelGenerator.createTrivialCube(ModBlocks.COPPER_ORE_BASALT) (or similar) for each ore block, or create a helper loop to iterate over the ore block constants to reduce verbosity.

🤖 Fix all issues with AI agents
In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java`:
- Around line 166-221: The commented-out blocks for sections 10–17 use
copy-pasted THORIUM identifiers; update each commented declaration so the Java
variable names and registry string IDs reflect the correct mineral (e.g.,
replace THORIUM_ORE_BASALT and "thorium_ore_basalt" with PRISMA_ORE_BASALT and
"prisma_ore_basalt" for section 10) and do the same for SAPPHIRE, TOPAZ, ZEPHYR,
DIAMOND, VOIDSTONE, and EMERALD; specifically edit the commented lines that call
registerOreBlock (look for occurrences of THORIUM_ORE_*, "thorium_ore_*", and
similar copy-pastes) to use the matching mineral constant names (e.g.,
PRISMA_ORE_BASALT, SAPPHIRE_ORE_STONE, TOPAZ_ORE_SANDSTONE, etc.) and their
corresponding lowercase registry IDs (e.g., "prisma_ore_basalt",
"sapphire_ore_stone"), leaving block properties and other arguments unchanged.
- Around line 260-273: The registerOreBlock method currently ignores baseBlock,
itemToDrop, and count; either remove these unused parameters or wire them into
block drop logic—update registerOreBlock (and callers) to either (A) simplify
the signature by removing baseBlock, itemToDrop, and count and stop re-calling
requiresCorrectToolForDrops(), or (B) implement custom drop behavior by
creating/using a Block subclass or loot table that drops itemToDrop with
quantity count (e.g., register an OreBlockWithCustomDrops that overrides
getDrops or register a loot table via a LootTableProvider keyed to blockKey),
ensure the BlockItem registration and REGISTERED_BLOCKS behavior stays the same,
and remove the redundant requiresCorrectToolForDrops() call if the callers
already set it.
🧹 Nitpick comments (1)
src/main/java/com/tcm/MineTale/registry/ModBlocks.java (1)

101-179: All ore blocks share identical properties — is this intentional?

Every ore type (copper through silver) uses strength(2) and Items.COPPER_ORE as the drop placeholder. For a mod with distinct ore tiers, you'd typically expect:

  • Different hardness/blast resistance per tier (e.g., adamantite harder than copper)
  • Different drop items per ore type (even though itemToDrop is currently unused)

If this is placeholder code to be fleshed out later, consider adding a // TODO to make that explicit.

Comment on lines +260 to 273
private static Block registerOreBlock(String name, Function<BlockBehaviour.Properties, Block> blockFactory, BlockBehaviour.Properties settings, Block baseBlock, Item itemToDrop, int count) {
ResourceKey<Block> blockKey = keyOfBlock(name);

Block block = blockFactory.apply(settings.requiresCorrectToolForDrops().setId(blockKey));

ResourceKey<Item> itemKey = keyOfItem(name);

BlockItem blockItem = new BlockItem(block, new Item.Properties().setId(itemKey).useBlockDescriptionPrefix());
Registry.register(BuiltInRegistries.ITEM, itemKey, blockItem);

REGISTERED_BLOCKS.add(block);

return Registry.register(BuiltInRegistries.BLOCK, blockKey, block);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

baseBlock, itemToDrop, and count parameters are accepted but never used.

These parameters appear intended to configure ore drops (e.g., copper ore dropping copper items), but the method body ignores them entirely. As a result, every ore block will use default drop behavior (dropping itself) rather than the intended item. This is likely a functional bug — if these ores are meant to drop specific items, the loot table or drop logic needs to be wired up.

Additionally, .requiresCorrectToolForDrops() is called on line 263 inside registerOreBlock, but every caller already includes it in the BlockBehaviour.Properties chain (e.g., line 102). The duplicate call is harmless but redundant.

Proposed cleanup (remove unused params or implement drop logic)

If drops should just be the block itself, simplify the signature:

-	private static Block registerOreBlock(String name, Function<BlockBehaviour.Properties, Block> blockFactory, BlockBehaviour.Properties settings, Block baseBlock, Item itemToDrop, int count) {
+	private static Block registerOreBlock(String name, Function<BlockBehaviour.Properties, Block> blockFactory, BlockBehaviour.Properties settings) {
 		ResourceKey<Block> blockKey = keyOfBlock(name);
-		Block block = blockFactory.apply(settings.requiresCorrectToolForDrops().setId(blockKey));
+		Block block = blockFactory.apply(settings.setId(blockKey));

Otherwise, if custom drops are intended, the parameters need to be wired to a loot table provider or a custom Block subclass that overrides drop behavior.

🤖 Prompt for AI Agents
In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java` around lines 260 -
273, The registerOreBlock method currently ignores baseBlock, itemToDrop, and
count; either remove these unused parameters or wire them into block drop
logic—update registerOreBlock (and callers) to either (A) simplify the signature
by removing baseBlock, itemToDrop, and count and stop re-calling
requiresCorrectToolForDrops(), or (B) implement custom drop behavior by
creating/using a Block subclass or loot table that drops itemToDrop with
quantity count (e.g., register an OreBlockWithCustomDrops that overrides
getDrops or register a loot table via a LootTableProvider keyed to blockKey),
ensure the BlockItem registration and REGISTERED_BLOCKS behavior stays the same,
and remove the redundant requiresCorrectToolForDrops() call if the callers
already set it.

…187d5d

📝 Add docstrings to `feat/add-items`
Removed the steel ingot item and added new ore items.
@The-Code-Monkey The-Code-Monkey merged commit d05fccf into 1.21 Feb 15, 2026
3 checks 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.

1 participant