Skip to content

Blacksmith an stuff#66

Merged
The-Code-Monkey merged 6 commits into1.21from
Blacksmith-an-stuff
Mar 5, 2026
Merged

Blacksmith an stuff#66
The-Code-Monkey merged 6 commits into1.21from
Blacksmith-an-stuff

Conversation

@The-Code-Monkey
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 177279c1-f19a-472b-b0f1-10cc55994578

📥 Commits

Reviewing files that changed from the base of the PR and between dfdc081 and 82cb8e3.

📒 Files selected for processing (3)
  • src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AbstractWorkbenchEntity.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java

📝 Walkthrough

A Most Peculiar Journey Through the Annals of the Alchemists' Workshop — Revised Edition

Hail, traveller of code and craft; the workbench's runes have been tended, a few new portals opened, and the ember-checking rites simplified — the ledger below chronicles the changes.

AlchemistsWorkbench.java — New Doorways, Ticking Charm, and the MapCodec Tome

  • Added two constructors:
    • public AlchemistsWorkbench(Properties properties)
    • public AlchemistsWorkbench(Properties properties, Supplier<BlockEntityType<? extends AlchemistsWorkbenchEntity>> supplier)
      These provide a default supplier-backed construction and an injectable block-entity-type supplier.
  • Added an overridden codec() returning CODEC to expose the MapCodec for (de)serialisation.
  • Overrode getTicker(...) to supply a BlockEntityTicker that delegates to AbstractWorkbenchEntity::tick when the block-entity type matches.
  • Minor Javadoc added/clarified; RenderShape and VoxelShape behaviour remains explicit.

Net effect: straightforward API additions for construction, ticking and codec wiring.

AbstractWorkbenchEntity.java — The Central Tome (unchanged in behaviour)

  • No behavioural signature changes detected in the current tree.
  • Core tick logic, inventory helpers (canFitOutputs, findOutputSlot, craft, etc.) remain as-is and documented.

AlchemistsWorkbenchEntity.java — Inventory Sorcery and a Decided Fuel Policy

  • saveAdditional now collects inventory ItemStacks via IntStream.range(...).mapToObj(inventory::getItem).toList() and stores them with ItemStack.OPTIONAL_CODEC.listOf().
  • loadAdditional clears the existing inventory before repopulating from saved stacks to avoid stale items when the saved list is shorter.
  • hasFuel() simplified to always return true (behavioural change; removes previous checks).
  • Data container and menu creation remain; createMenu now ensures a nearby-sync to the opening player.

Risk & Review Notes (in haltingly grand tone)

  • The change to hasFuel() is the largest behavioural alteration — it makes the workbench ignore fuel constraints; confirm this is intended for gameplay balance.
  • Inventory clearing on load fixes stale-state bugs but ensure persisted lists still cover expected slots.
  • Constructor, ticker and codec additions are low-risk and aid integration with serialisation and ticking systems.

May your anvils ring true and your fuel checks be as intentional as the stars.

Walkthrough

Adds two public constructors and a protected codec() override to AlchemistsWorkbench, clarifies getTicker Javadoc; refactors AlchemistsWorkbenchEntity inventory (stream-based save, clear before load) and makes hasFuel() always return true; minor Javadoc formatting change in AbstractWorkbenchEntity. (≈44 words)

Changes

Cohort / File(s) Summary
AlchemistsWorkbench (constructors & codec)
src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java
Added two public constructors (Properties and Properties, Supplier<BlockEntityType<...>>), added protected MapCodec<? extends AlchemistsWorkbench> codec() returning CODEC, and updated Javadoc for getTicker (clarification only).
AlchemistsWorkbenchEntity (serialization & fuel logic)
src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java
Switched inventory save to IntStream.range(...).mapToObj(inventory::getItem).toList(), clear inventory before restoring on load, simplified hasFuel() to always return true, added IntStream import.
Javadoc formatting only
src/main/java/com/tcm/MineTale/block/workbenches/entity/AbstractWorkbenchEntity.java
Reformatted Javadoc return documentation for hasFuel() (inline code markup changed to {@code}); no behavioural or signature changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Behold this tiny patch, forged between a tea break and hyperspace,
Two constructors stride out, codec tucked in like a polite hobbit,
The entity now streams its spoils and clears old crumbs, ever hungry,
Fuel declared eternal — sus but simple — vibes kept tidy. ✨🔧

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Blacksmith an stuff' is vague and non-descriptive, using generic placeholder language that fails to convey meaningful information about the changeset. Revise the title to clearly describe the actual changes, such as 'Add constructors and codec method to AlchemistsWorkbench' or similar.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the purpose, motivation, and scope of these workbench-related changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 97.06% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Blacksmith-an-stuff

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 coderabbitai bot requested a review from AnyaPizza March 4, 2026 20:30
@AnyaPizza
Copy link
Collaborator

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Mar 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Note

Docstrings generation - SUCCESS
Generated docstrings and committed to branch Blacksmith-an-stuff (commit: 82cb8e3868e92ae716cfb5b4a029ac9b5aafd217)

coderabbitai bot added a commit that referenced this pull request Mar 4, 2026
Docstrings generation was requested by @AnyaPizza.

* #66 (comment)

The following files were modified:

* `src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.java`
* `src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java`
* `src/client/java/com/tcm/MineTale/datagen/recipes/AlchemistRecipes.java`
* `src/client/java/com/tcm/MineTale/datagen/recipes/BlacksmithRecipes.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/registry/ModRecipes.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: 10

🧹 Nitpick comments (4)
src/client/java/com/tcm/MineTale/datagen/recipes/ForgeRecipes.java (1)

8-8: Replace this lore-style note with an actionable TODO.

Line 8 is giving “we’ll do it later, trust me bro” energy. By the stars and Gandalf’s beard, please make it traceable (e.g., TODO + issue/PR reference + owner), so future folk know what “in development” actually means and where to continue.

🛠️ Suggested tweak
-    /// FORGE STILL IN DEVELOPMENT IN HYTALE
+    // TODO(#<issue-or-pr>): Implement Forge recipe generation once Forge feature parity is finalised.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client/java/com/tcm/MineTale/datagen/recipes/ForgeRecipes.java` at line
8, Replace the vague comment "/// FORGE STILL IN DEVELOPMENT IN HYTALE" inside
the ForgeRecipes class with an actionable TODO that includes a clear owner and
tracking reference; e.g., change it to a TODO with Issue/PR ID and assignee (for
example "TODO: implement Forge recipe registration — see `#1234`, assign
`@username`") so maintainers can find the work and continue it; update the comment
located in the ForgeRecipes class to follow this pattern and optionally include
expected deliverables (e.g., "register mod recipes, add tests").
src/main/java/com/tcm/MineTale/registry/ModBlocks.java (1)

243-243: This TODO is useful, but don’t let it become ancient runes in the codebase.

Please track the bed functionality gap in an issue with acceptance criteria, otherwise this debt will spawn side quests forever.

If you want, I can draft the issue text and a small implementation checklist.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java` at line 243, Create a
tracked issue for the bed functionality gap referenced by the TODO in ModBlocks
(bed/decorative blocks) that includes clear acceptance criteria (e.g., beds must
allow sleeping, set player spawn, handle dimension restrictions, play correct
sounds/animations, prevent sleeping in hostile conditions, and include
unit/integration tests and manual QA steps); then update the TODO comment in
ModBlocks.java to include the new issue ID/URL and a short one-line summary so
the code clearly links to the ticket.
src/main/java/com/tcm/MineTale/registry/ModRecipes.java (1)

55-60: Tidy the JavaDoc list so the lore matches reality.

The registration docs still omit the new alchemists pair, so future readers get fed stale map data.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/tcm/MineTale/registry/ModRecipes.java` around lines 55 -
60, Update the JavaDoc in ModRecipes to reflect the actual registered recipe
pair by adding the alchemists entry to the list; specifically mention the
ALCHEMISTS_TYPE (and its corresponding serializer, e.g., ALCHEMISTS_SERIALIZER
or whatever symbol names you used) alongside FURNACE_T1_TYPE, CAMPFIRE_TYPE,
WORKBENCH_TYPE, ARMORERS_TYPE, FARMERS_TYPE, BUILDERS_TYPE, BLACKSMITHS_TYPE and
FURNITURE_TYPE so the documentation matches the implemented registrations.
src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java (1)

33-35: Tiny clarity buff: use DATA_SIZE in the client constructor.

Line 34 currently uses EMPTY_SIZE for SimpleContainerData. It works (both are 0), but DATA_SIZE better signals intent and avoids future drift.

♻️ Proposed tidy-up
-        this(syncId, playerInventory, new SimpleContainerData(EMPTY_SIZE), null);
+        this(syncId, playerInventory, new SimpleContainerData(DATA_SIZE), null);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java`
around lines 33 - 35, Constructor call in AlchemistsWorkbenchMenu uses
EMPTY_SIZE; replace it with DATA_SIZE to convey intended container data length.
In the AlchemistsWorkbenchMenu(int syncId, Inventory playerInventory)
constructor, change new SimpleContainerData(EMPTY_SIZE) to new
SimpleContainerData(DATA_SIZE) (keeping the rest of the delegation the same) and
ensure the DATA_SIZE constant referenced is the intended constant used by this
menu.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.java`:
- Around line 139-145: Remove the System.out.println calls in
AlchemistsWorkbenchScreen (the render-time craft check and the block handling
persistent selection results) and replace them with a proper logger usage
(declare a private static final Logger LOGGER in AlchemistsWorkbenchScreen),
then change prints to LOGGER.debug(...) or LOGGER.trace(...) and guard with
LOGGER.isDebugEnabled() so logs are not emitted every render; alternatively
remove logging entirely for normal success paths and only log exceptional cases
once (e.g., first failure) to avoid hot-path spam — update the print sites
around the persistent selection handling (the block that sends
CraftRequestPayload and the code referenced around lines 257-287) accordingly.
- Around line 193-199: The "All" button activation is off-by-one because it uses
canCraft(this.minecraft.player, selectedEntry, 2); change the check to call
canCraft with the "all" sentinel (e.g. -1) or with 1 depending on canCraft's
contract so that an available single craft still enables craftAllBtn;
specifically update the boolean canCraftMoreThanOne assignment (referencing
canCraft, selectedEntry, minecraft.player, and craftAllBtn) to use
canCraft(this.minecraft.player, selectedEntry, -1) (or canCraft(..., 1) if the
implementation expects a positive minimum) so the "All" button is active when at
least one craft can be performed.

In `@src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java`:
- Line 275: The translation key used in translationBuilder.add is misspelled
("item.minetale.antitode") and doesn't match the actual item id "antidote", so
update the key to "item.minetale.antidote" in the call to translationBuilder.add
(the method in ModLangProvider) so the localisation maps to the correct item id
and the in-game name resolves properly.

In `@src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java`:
- Around line 137-139: ModModelProvider is missing a generateFlatItem call for
the BOOM_POWDER item, causing it to show the missing-texture placeholder; add a
call to itemModelGenerators.generateFlatItem(ModItems.BOOM_POWDER,
ModelTemplates.FLAT_HANDHELD_ITEM) in the same item model generation block
(where generateFlatItem is used for EMPTY_POTION_BOTTLE, ANTIDOTE,
POPBERRY_BOMB) so BOOM_POWDER gets a proper flat handheld model; verify
ModItems.BOOM_POWDER is the correct identifier used elsewhere (e.g.,
AlchemistRecipes, ModLangProvider) before adding.

In `@src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java`:
- Around line 29-42: The JavaDoc for the constructor in AlchemistsWorkbench
incorrectly references "ArmorersWorkbench"; update the Javadoc text to the
correct class name "AlchemistsWorkbench" and correct any parameter descriptions
to match this class (e.g., the second constructor's supplier description).
Search for other occurrences in this file (notably the block around the second
constructor at the lines referenced) and replace "ArmorersWorkbench" with
"AlchemistsWorkbench" so all docs consistently name the class and its
parameters.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`:
- Around line 119-123: The load logic in AlchemistsWorkbenchEntity that calls
valueInput.read(..., ItemStack.OPTIONAL_CODEC.listOf()) and then sets items via
inventory.setItem(...) can leave stale items if the saved list is shorter than
inventory.getContainerSize(); before applying loaded stacks, clear the inventory
(e.g., set each slot to ItemStack.EMPTY or call the container's
clearContent/clear method) or after copying saved stacks explicitly clear any
remaining slots up to inventory.getContainerSize() so no ghost items remain.
Ensure you modify the same block that calls valueInput.read(...) and uses
inventory.setItem and inventory.getContainerSize.
- Around line 26-59: The workbench never progresses because
AlchemistsWorkbenchMenu constructs a SimpleContainer with EMPTY_SIZE = 0 so
hasFuel() (which calls getItem(Constants.FUEL_SLOT)) always reads a non-existent
slot and returns EMPTY; fix by ensuring the menu/inventory passed to the entity
contains a real fuel slot: update AlchemistsWorkbenchMenu to construct the
container with the correct non-zero size (include the fuel slot), or adjust the
EMPTY_SIZE constant to the actual inventory size used by
AlchemistsWorkbenchEntity, and verify Constants.FUEL_SLOT index falls within
that size; alternatively, if the workbench should not require fuel, override
hasFuel() in AlchemistsWorkbenchEntity to return true or to check a valid
existing slot instead.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java`:
- Around line 97-99: Replace the System.out.println debug line in
AlchemistsWorkbenchMenu (the one printing nearbyItems.size() in the
constructor/handler where this.playerInventory.player.level().isClientSide() is
checked) by using the project's logger: call MineTale.LOGGER.debug with the same
message (include context like nearbyItems.size()), or remove the statement
entirely if no longer needed; also scan for other System.out.println usages
across workbench menu classes, entity handlers, screen classes, and registries
and either delete them or convert them to MineTale.LOGGER at an appropriate
level to eliminate stdout spam and centralize logging.

In `@src/main/java/com/tcm/MineTale/registry/ModItems.java`:
- Around line 203-214: Several weapon Item registrations (CRUDE_BUILDERS_HAMMER,
CRUDE_HATCHET, CRUDE_BATTLEAXE, CRUDE_DAGGERS, CRUDE_SHORTBOW, CRUDE_SWORD,
CRUDE_LONGSWORD, COPPER_HATCHET, COPPER_DAGGERS, COPPER_BATTLEAXE,
COPPER_LONGSWORD, COPPER_SHORTBOW) are created with Item::new and lack the
DataComponents.TOOL and DataComponents.WEAPON components used by
CRUDE_MACE/COPPER_MACE; update each register(...) call to attach the same
.component(DataComponents.TOOL, ...) and .component(DataComponents.WEAPON, ...)
configuration (matching the component parameters used by CRUDE_MACE/COPPER_MACE)
so these items provide tool/weapon behavior and stats instead of being inert
items.

In `@src/main/java/com/tcm/MineTale/registry/ModMenuTypes.java`:
- Around line 55-58: The Alchemists workbench MenuType is only registered
server-side; add a client-side registration by calling MenuScreens.register for
ModMenuTypes.ALCHEMISTS_WORKBENCH_MENU mapped to AlchemistsWorkbenchScreen in
the MineTaleClient class alongside the other MenuScreens.register(...) calls so
the client knows how to render the menu.

---

Nitpick comments:
In `@src/client/java/com/tcm/MineTale/datagen/recipes/ForgeRecipes.java`:
- Line 8: Replace the vague comment "/// FORGE STILL IN DEVELOPMENT IN HYTALE"
inside the ForgeRecipes class with an actionable TODO that includes a clear
owner and tracking reference; e.g., change it to a TODO with Issue/PR ID and
assignee (for example "TODO: implement Forge recipe registration — see `#1234`,
assign `@username`") so maintainers can find the work and continue it; update the
comment located in the ForgeRecipes class to follow this pattern and optionally
include expected deliverables (e.g., "register mod recipes, add tests").

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java`:
- Around line 33-35: Constructor call in AlchemistsWorkbenchMenu uses
EMPTY_SIZE; replace it with DATA_SIZE to convey intended container data length.
In the AlchemistsWorkbenchMenu(int syncId, Inventory playerInventory)
constructor, change new SimpleContainerData(EMPTY_SIZE) to new
SimpleContainerData(DATA_SIZE) (keeping the rest of the delegation the same) and
ensure the DATA_SIZE constant referenced is the intended constant used by this
menu.

In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java`:
- Line 243: Create a tracked issue for the bed functionality gap referenced by
the TODO in ModBlocks (bed/decorative blocks) that includes clear acceptance
criteria (e.g., beds must allow sleeping, set player spawn, handle dimension
restrictions, play correct sounds/animations, prevent sleeping in hostile
conditions, and include unit/integration tests and manual QA steps); then update
the TODO comment in ModBlocks.java to include the new issue ID/URL and a short
one-line summary so the code clearly links to the ticket.

In `@src/main/java/com/tcm/MineTale/registry/ModRecipes.java`:
- Around line 55-60: Update the JavaDoc in ModRecipes to reflect the actual
registered recipe pair by adding the alchemists entry to the list; specifically
mention the ALCHEMISTS_TYPE (and its corresponding serializer, e.g.,
ALCHEMISTS_SERIALIZER or whatever symbol names you used) alongside
FURNACE_T1_TYPE, CAMPFIRE_TYPE, WORKBENCH_TYPE, ARMORERS_TYPE, FARMERS_TYPE,
BUILDERS_TYPE, BLACKSMITHS_TYPE and FURNITURE_TYPE so the documentation matches
the implemented registrations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98a4aec1-fb2f-4da0-98b4-dd88efe3b8af

📥 Commits

Reviewing files that changed from the base of the PR and between 97a1923 and 79f8f5d.

📒 Files selected for processing (18)
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.java
  • src/client/java/com/tcm/MineTale/datagen/ModBlockTagProvider.java
  • src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java
  • src/client/java/com/tcm/MineTale/datagen/ModLootTableProvider.java
  • src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/AlchemistRecipes.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/BlacksmithRecipes.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/ForgeRecipes.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.java
  • src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/registry/ModBlockEntities.java
  • src/main/java/com/tcm/MineTale/registry/ModBlocks.java
  • src/main/java/com/tcm/MineTale/registry/ModItems.java
  • src/main/java/com/tcm/MineTale/registry/ModMenuTypes.java
  • src/main/java/com/tcm/MineTale/registry/ModRecipeDisplay.java
  • src/main/java/com/tcm/MineTale/registry/ModRecipes.java

Comment on lines +203 to +214
public static final Item CRUDE_BUILDERS_HAMMER = register("crude_builders_hammer", Item::new, new Item.Properties());
public static final Item CRUDE_HATCHET = register("crude_hatchet", Item::new, new Item.Properties());
public static final Item CRUDE_BATTLEAXE = register("crude_battleaxe", Item::new, new Item.Properties());
public static final Item CRUDE_DAGGERS = register("crude_daggers", Item::new, new Item.Properties());
public static final Item CRUDE_SHORTBOW = register("crude_shortbow", BowItem::new, new Item.Properties());
public static final Item CRUDE_SWORD = register("crude_sword", Item::new, new Item.Properties());
public static final Item CRUDE_LONGSWORD = register("crude_longsword", Item::new, new Item.Properties());
public static final Item COPPER_HATCHET = register("copper_hatchet", Item::new, new Item.Properties());
public static final Item COPPER_DAGGERS = register("copper_daggers", Item::new, new Item.Properties());
public static final Item COPPER_BATTLEAXE = register("copper_battleaxe", Item::new, new Item.Properties());
public static final Item COPPER_LONGSWORD = register("copper_longsword", Item::new, new Item.Properties());
public static final Item COPPER_SHORTBOW = register("copper_shortbow", BowItem::new, new Item.Properties());
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 4, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for references to the new weapon/tool items and component assignments
echo "=== Searching for item references and component assignments ==="
rg -nP --type=java --type=json \
  'DataComponents\.(WEAPON|TOOL|DAMAGE|ARMOR)|attribute_modifiers|attack_damage|attack_speed|crude_builders_hammer|crude_hatchet|crude_battleaxe|crude_daggers|copper_hatchet|copper_daggers|copper_battleaxe|copper_longsword' \
  -A 2 -B 2

echo -e "\n=== Searching for JSON data files that might define item components ==="
find . -type f \( -name "*.json" \) | grep -E '(item|component|data)' | head -20

echo -e "\n=== Looking for item model or component definitions in JSON ==="
rg -l 'crude_builders_hammer|crude_hatchet|copper_hatchet' --type=json 2>/dev/null || echo "No matches found"

echo -e "\n=== Checking ModItems.java for any component setup patterns ==="
rg -n 'setDefaultModelData|withDamage|withMaxStackSize|component|Component' src/main/java/com/tcm/MineTale/registry/ModItems.java || echo "No component patterns found"

Repository: CodeMonkeysMods/MineTale

Length of output: 13019


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Checking if there's a pattern for weapon item registration in the file ==="
rg -n 'public static final Item' src/main/java/com/tcm/MineTale/registry/ModItems.java | head -30

echo -e "\n=== Checking for any data-driven component setup or JSON resource packs ==="
find ./src -type f -name '*.json' -path '*/data/*' | grep -iE 'component|item' | head -20

echo -e "\n=== Looking for item component definitions in any JSON resources ==="
rg -l 'components.*weapon|components.*tool' --type=json || echo "No component JSON found"

Repository: CodeMonkeysMods/MineTale

Length of output: 3459


Ye cursed and utterly non-functional gear—these weapon-named items lack all combat components, which is deeply grievous and most uncouth.

Behold: COPPER_MACE and CRUDE_MACE (lines 181–201) are festooned with .component(DataComponents.TOOL, ...) and .component(DataComponents.WEAPON, ...), as befits any respectable implement of battle. Yet these twelve entries at lines 203–214—thy CRUDE_BUILDERS_HAMMER, CRUDE_HATCHET, CRUDE_BATTLEAXE, CRUDE_DAGGERS, CRUDE_SWORD, CRUDE_LONGSWORD, COPPER_HATCHET, COPPER_DAGGERS, COPPER_BATTLEAXE, COPPER_LONGSWORD, plus both shortbows—are registered as bare Item::new with no components whatsoever. The recipes exist (verified in thy WorkbenchRecipes and BlacksmithRecipes), but the items themselves? Utterly no cap, they're just decorative sticks. Players craft them and get... nothing. This is giving broken quest item energy, and it's absolutely mid.

Wire up .component(DataComponents.TOOL, ...) and .component(DataComponents.WEAPON, ...) as the maces do, or these alleged weapons shall forever be non-functional dreck. Not giving what they're supposed to give, fr fr.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/tcm/MineTale/registry/ModItems.java` around lines 203 -
214, Several weapon Item registrations (CRUDE_BUILDERS_HAMMER, CRUDE_HATCHET,
CRUDE_BATTLEAXE, CRUDE_DAGGERS, CRUDE_SHORTBOW, CRUDE_SWORD, CRUDE_LONGSWORD,
COPPER_HATCHET, COPPER_DAGGERS, COPPER_BATTLEAXE, COPPER_LONGSWORD,
COPPER_SHORTBOW) are created with Item::new and lack the DataComponents.TOOL and
DataComponents.WEAPON components used by CRUDE_MACE/COPPER_MACE; update each
register(...) call to attach the same .component(DataComponents.TOOL, ...) and
.component(DataComponents.WEAPON, ...) configuration (matching the component
parameters used by CRUDE_MACE/COPPER_MACE) so these items provide tool/weapon
behavior and stats instead of being inert items.

Copy link
Collaborator

Choose a reason for hiding this comment

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

These are placeholders for now until we make classes for these weapons/tools

Copy link
Contributor

Choose a reason for hiding this comment

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

@AnyaPizza Understood, bestie — no cap, that's a totally valid approach. Placeholders it is, until the custom weapon/tool classes are forged in the fires of Mount Doom (or, y'know, your IDE). We shall trouble thee no further on this matter. 🧙‍♂️


✏️ Learnings added
Learnt from: AnyaPizza
Repo: CodeMonkeysMods/MineTale PR: 66
File: src/main/java/com/tcm/MineTale/registry/ModItems.java:203-214
Timestamp: 2026-03-04T21:31:06.885Z
Learning: In `src/main/java/com/tcm/MineTale/registry/ModItems.java`, the following items are intentional placeholders registered as bare `Item::new` with no `DataComponents.TOOL` or `DataComponents.WEAPON` components: `CRUDE_BUILDERS_HAMMER`, `CRUDE_HATCHET`, `CRUDE_BATTLEAXE`, `CRUDE_DAGGERS`, `CRUDE_SHORTBOW`, `CRUDE_SWORD`, `CRUDE_LONGSWORD`, `COPPER_HATCHET`, `COPPER_DAGGERS`, `COPPER_BATTLEAXE`, `COPPER_LONGSWORD`, `COPPER_SHORTBOW`. They are awaiting dedicated custom item classes in a future PR. Do not flag these as missing combat components.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 30
File: src/client/java/com/tcm/MineTale/datagen/builders/WorkbenchRecipeBuilder.java:120-131
Timestamp: 2026-02-14T08:07:02.386Z
Learning: In Minecraft 1.21, create an Ingredient from a TagKey<Item> by calling Ingredient.of(TagKey<Item>). There is no Ingredient.ofTag(...) or Ingredient.of(HolderSet<Item>) overload in this version. This guideline applies to Java code across the project; replace any usages of deprecated or non-existent overloads with Ingredient.of(tagKey) in all relevant files (not just this one).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add an issue to track this

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@coderabbitai make an issue to track this

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

gh issue create \
  --repo CodeMonkeysMods/MineTale \
  --title "Implement dedicated custom item classes for crude/copper weapon & tool placeholders" \
  --body "## Overview

Several weapon and tool items in \`src/main/java/com/tcm/MineTale/registry/ModItems.java\` are currently registered as bare \`Item::new\` placeholders with no \`DataComponents.TOOL\` or \`DataComponents.WEAPON\` components. These were intentionally left as stubs pending dedicated custom item classes.

## Items to implement

- \`CRUDE_BUILDERS_HAMMER\`
- \`CRUDE_HATCHET\`
- \`CRUDE_BATTLEAXE\`
- \`CRUDE_DAGGERS\`
- \`CRUDE_SHORTBOW\`
- \`CRUDE_SWORD\`
- \`CRUDE_LONGSWORD\`
- \`COPPER_HATCHET\`
- \`COPPER_DAGGERS\`
- \`COPPER_BATTLEAXE\`
- \`COPPER_LONGSWORD\`
- \`COPPER_SHORTBOW\`

## Acceptance Criteria

- Each item above should have a dedicated custom item class (similar to how \`MaceItem\` is used for \`COPPER_MACE\` / \`CRUDE_MACE\`).
- Each class should attach the appropriate \`DataComponents.TOOL\` and/or \`DataComponents.WEAPON\` components, attributes, durability, rarity, and repair material.
- Recipes in \`WorkbenchRecipes\` and \`BlacksmithRecipes\` already exist for these items.

## References

- PR: https://github.com/CodeMonkeysMods/MineTale/pull/66
- Comment: https://github.com/CodeMonkeysMods/MineTale/pull/66#discussion_r2886145819

Requested by `@The-Code-Monkey`." \
  --assignee The-Code-Monkey

Length of output: 53


@The-Code-Monkey, issue created and assigned to thee, as the One True Code Monkey of the Fellowship! 🧙‍♂️

#69 — Implement dedicated custom item classes for crude/copper weapon & tool placeholders

It tracks all twelve placeholder items (CRUDE_BUILDERS_HAMMER, CRUDE_HATCHET, CRUDE_BATTLEAXE, CRUDE_DAGGERS, CRUDE_SHORTBOW, CRUDE_SWORD, CRUDE_LONGSWORD, COPPER_HATCHET, COPPER_DAGGERS, COPPER_BATTLEAXE, COPPER_LONGSWORD, COPPER_SHORTBOW) with acceptance criteria and backlinks to this PR. No cap, it's giving organised dev energy. ✨


🧠 Learnings used
Learnt from: AnyaPizza
Repo: CodeMonkeysMods/MineTale PR: 66
File: src/main/java/com/tcm/MineTale/registry/ModItems.java:203-214
Timestamp: 2026-03-04T21:31:06.885Z
Learning: In `src/main/java/com/tcm/MineTale/registry/ModItems.java`, the following items are intentional placeholders registered as bare `Item::new` with no `DataComponents.TOOL` or `DataComponents.WEAPON` components: `CRUDE_BUILDERS_HAMMER`, `CRUDE_HATCHET`, `CRUDE_BATTLEAXE`, `CRUDE_DAGGERS`, `CRUDE_SHORTBOW`, `CRUDE_SWORD`, `CRUDE_LONGSWORD`, `COPPER_HATCHET`, `COPPER_DAGGERS`, `COPPER_BATTLEAXE`, `COPPER_LONGSWORD`, `COPPER_SHORTBOW`. They are awaiting dedicated custom item classes in a future PR. Do not flag these as missing combat components.

Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 30
File: src/client/java/com/tcm/MineTale/datagen/builders/WorkbenchRecipeBuilder.java:120-131
Timestamp: 2026-02-14T08:07:02.386Z
Learning: In Minecraft 1.21, create an Ingredient from a TagKey<Item> by calling Ingredient.of(TagKey<Item>). There is no Ingredient.ofTag(...) or Ingredient.of(HolderSet<Item>) overload in this version. This guideline applies to Java code across the project; replace any usages of deprecated or non-existent overloads with Ingredient.of(tagKey) in all relevant files (not just this one).

The-Code-Monkey and others added 3 commits March 5, 2026 05:15
Docstrings generation was requested by @The-Code-Monkey.

The following files were modified:

* `src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.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.

Caution

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

⚠️ Outside diff range comments (2)
src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java (2)

116-123: ⚠️ Potential issue | 🟡 Minor

Clear inventory unconditionally before reading, not only when the tag exists.

Right now, if "Inventory" is absent, old contents can linger like a cursed side-quest. Move inventory.clearContent() before read(...) so deserialisation always resets state.

🧼 Suggested fix
-        // Read the inventory list back
-        valueInput.read("Inventory", ItemStack.OPTIONAL_CODEC.listOf()).ifPresent(stacks -> {
-            // Fix: Clear existing items to prevent stale data if the saved list is smaller
-            inventory.clearContent(); 
-            
+        // Reset first, then read the inventory list back
+        inventory.clearContent();
+        valueInput.read("Inventory", ItemStack.OPTIONAL_CODEC.listOf()).ifPresent(stacks -> {
             for (int i = 0; i < stacks.size() && i < inventory.getContainerSize(); i++) {
                 inventory.setItem(i, stacks.get(i));
             }
         });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`
around lines 116 - 123, The inventory is only cleared when the "Inventory" tag
is present, allowing stale items to persist if the tag is absent; move the clear
so it always runs before deserialisation: in AlchemistsWorkbenchEntity, call
inventory.clearContent() immediately before invoking
valueInput.read("Inventory", ItemStack.OPTIONAL_CODEC.listOf()) (and then
iterate/set items from the optional list as you currently do) so the inventory
is reset regardless of whether the tag exists.

155-165: ⚠️ Potential issue | 🟡 Minor

Javadoc and implementation are now in different universes.

The method docs still claim fuel-slot checks, but Line 164 always returns true. That mismatch is giving Vogon-manual energy and will mislead future maintainers.

📝 Suggested doc update
     /**
-     * Determines whether the workbench currently has fuel available.
-     *
-     * Checks that the entity is in a loaded level and that the configured fuel slot contains an item.
-     *
-     * `@return` `true` if the entity is in a loaded level and the fuel slot contains an item, `false` otherwise.
+     * Alchemist workbenches do not consume fuel.
+     *
+     * `@return` always {`@code` true}
      */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`
around lines 155 - 165, The Javadoc and the hasFuel() implementation diverge:
instead of always returning true, update AlchemistsWorkbenchEntity.hasFuel() to
actually check the configured fuel slot; e.g., return whether the entity is in a
loaded level and the fuel slot contains an item by checking the inventory/fuel
access (use the class's inventory accessor such as getItem(FUEL_SLOT) or
inventory.getStack(FUEL_SLOT) and ensure level != null/loaded), or alternatively
change the Javadoc to match the current behavior—prefer implementing the real
check in hasFuel() to use the entity's fuel slot (reference:
AlchemistsWorkbenchEntity.hasFuel(), FUEL_SLOT or fuelSlot, and the inventory
getter method).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`:
- Around line 116-123: The inventory is only cleared when the "Inventory" tag is
present, allowing stale items to persist if the tag is absent; move the clear so
it always runs before deserialisation: in AlchemistsWorkbenchEntity, call
inventory.clearContent() immediately before invoking
valueInput.read("Inventory", ItemStack.OPTIONAL_CODEC.listOf()) (and then
iterate/set items from the optional list as you currently do) so the inventory
is reset regardless of whether the tag exists.
- Around line 155-165: The Javadoc and the hasFuel() implementation diverge:
instead of always returning true, update AlchemistsWorkbenchEntity.hasFuel() to
actually check the configured fuel slot; e.g., return whether the entity is in a
loaded level and the fuel slot contains an item by checking the inventory/fuel
access (use the class's inventory accessor such as getItem(FUEL_SLOT) or
inventory.getStack(FUEL_SLOT) and ensure level != null/loaded), or alternatively
change the Javadoc to match the current behavior—prefer implementing the real
check in hasFuel() to use the entity's fuel slot (reference:
AlchemistsWorkbenchEntity.hasFuel(), FUEL_SLOT or fuelSlot, and the inventory
getter method).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 96fe137d-4f2a-4895-9dad-a3fd4be8751c

📥 Commits

Reviewing files that changed from the base of the PR and between 3b76025 and dfdc081.

📒 Files selected for processing (2)
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AbstractWorkbenchEntity.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/AbstractWorkbenchEntity.java

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

The following files were modified:

* `src/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/entity/AbstractWorkbenchEntity.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`
@The-Code-Monkey The-Code-Monkey merged commit 8c1c970 into 1.21 Mar 5, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants