Skip to content

Feat/add builders workbench#55

Merged
The-Code-Monkey merged 1 commit intofeat/add-farmers-workbenchfrom
feat/add-builders-workbench
Feb 26, 2026
Merged

Feat/add builders workbench#55
The-Code-Monkey merged 1 commit intofeat/add-farmers-workbenchfrom
feat/add-builders-workbench

Conversation

@The-Code-Monkey
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added two new workbenches: Farmers Workbench and Builders Workbench with dedicated crafting recipes
    • Added numerous decorative blocks including moss variants, vines, ivy, ropes, and terrain blocks
    • Expanded crafting recipes for farmers and builders workbenches to produce new decorative and functional items
    • Improved recipe book integration and crafting interface for all workbenches

Walkthrough

This PR introduces two new workbench types (Farmers and Builders) with complete implementations including client-side GUI screens with recipe book integration, server-side block entities with persistence, menu containers, recipe definitions, and registry registrations. Existing workbench systems are generalized to support multiple recipe types via a new RecipeType parameter.

Changes

Cohort / File(s) Summary
Client Screens
BuildersWorkbenchScreen.java, FarmersWorkbenchScreen.java, ArmorersWorkbenchScreen.java, WorkbenchWorkbenchScreen.java
New screens for Builders/Farmers workbenches with recipe book integration, craft buttons, and ingredient checking; existing screens refactored to use persistent recipe selection memory via lastKnownSelectedId instead of live per-frame selection
Server Block Entities
BuildersWorkbenchEntity.java, FarmersWorkbenchEntity.java
New block entities for Farmers/Builders workbenches with state persistence (tier, scan radius, inventory), UI menu creation, and recipe type tracking
Menu/Container Types
AbstractWorkbenchContainerMenu.java, BuildersWorkbenchMenu.java, FarmersWorkbenchMenu.java, ArmorersWorkbenchMenu.java, CampfireWorkbenchMenu.java, FurnaceWorkbenchMenu.java, WorkbenchWorkbenchMenu.java
Introduced RecipeType parameter to base AbstractWorkbenchContainerMenu; new menu implementations for Farmers/Builders with player inventory and networked nearby-item integration for recipe-book calculations
Recipe Definitions
BuilderRecipes.java, FarmerRecipes.java, WorkbenchRecipes.java
Activated recipe definitions for new workbenches (rope variants for Builders; 40+ plant/decoration recipes for Farmers) with proper unlock conditions and categories
Registry Entries
ModBlocks.java, ModItems.java, ModMenuTypes.java, ModRecipes.java, ModRecipeDisplay.java, ModBlockEntities.java
Registered new workbench blocks, menu types, recipe types, block entities, and 40+ new decorative/terrain blocks (moss variants, vines, ropes, grass types); removed MOSS item registration
Server Packet Handler
MineTale.java
Generalized CraftRequestPayload handler to support multiple workbench types via AbstractWorkbenchContainerMenu.getRecipeType() instead of specific menu type checks
Client Initialization
MineTaleClient.java
Registered FarmersWorkbenchScreen and BuildersWorkbenchScreen with their respective ModMenuTypes

Sequence Diagram

sequenceDiagram
    participant Client as Client
    participant RecipeBook as Recipe Book
    participant Inventory as Inventory System
    participant Menu as Workbench Menu
    participant Network as Network
    participant Server as Server
    participant ServerInv as Server Inventory

    Client->>RecipeBook: Select recipe
    RecipeBook->>Menu: Store selected recipe ID
    Client->>Inventory: Check player items
    Client->>Inventory: Check nearby networked items
    Inventory-->>Client: Available ingredients
    Client->>Client: Validate canCraft()
    alt Sufficient ingredients
        Client->>Network: Send CraftRequestPayload
        Network->>Server: Receive craft request
        Server->>Server: Lookup recipe by type
        Server->>ServerInv: Validate ingredients exist
        ServerInv-->>Server: Validation result
        Server->>ServerInv: Consume ingredients
        Server->>ServerInv: Grant output item
        Server->>Network: Broadcast container update
        Network->>Client: Update inventory display
    else Insufficient ingredients
        Client->>Client: Disable craft button
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • PR #53 — Directly overlaps with plant-fibre workbench recipe definitions across BuilderRecipes, FarmerRecipes, and WorkbenchRecipes files.
  • PR #28 — Introduces recipe-book/recipe-type system changes that this PR relies on for recipe type generalization and filtering.
  • PR #46 — Modifies ModBlocks/ModItems registrations with overlapping block/item declaration patterns.

Suggested labels

enhancement

Suggested reviewers

  • AnyaPizza

Poem

🐰 Two benches hop into the world so bright,
Where farmers plant and builders build with might!
With recipes gathered and items all neat,
The workbenches sing—what a crafty feat! ✨🛠️

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author; the pull request lacks any details about the changes, objectives, or rationale for the builders workbench implementation. Add a pull request description explaining the purpose of the builders workbench, key components added (screen, menu, entity, recipes), and any relevant implementation notes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feat/add builders workbench' clearly describes the main addition in the changeset: a new builders workbench feature with corresponding screens, menus, entities, recipes, and blocks.
Docstring Coverage ✅ Passed Docstring coverage is 82.93% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Docstrings were successfully generated.
  • 📝 Docstrings were successfully committed to branch.
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-builders-workbench

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 February 26, 2026 08:55
@coderabbitai coderabbitai bot added the enhancement New feature or request label Feb 26, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Note

Docstrings generation - SKIPPED
Skipped regeneration as there are no new commits. Docstrings already generated for this pull request at #56.

coderabbitai bot added a commit that referenced this pull request Feb 26, 2026
Docstrings generation was requested by @The-Code-Monkey.

* #55 (comment)

The following files were modified:

* `src/client/java/com/tcm/MineTale/MineTaleClient.java`
* `src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java`
* `src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java`
* `src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java`
* `src/client/java/com/tcm/MineTale/block/workbenches/screen/WorkbenchWorkbenchScreen.java`
* `src/client/java/com/tcm/MineTale/datagen/recipes/BuilderRecipes.java`
* `src/client/java/com/tcm/MineTale/datagen/recipes/FarmerRecipes.java`
* `src/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/BuildersWorkbench.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/FarmersWorkbench.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/entity/BuildersWorkbenchEntity.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/entity/FarmersWorkbenchEntity.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/AbstractWorkbenchContainerMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/ArmorersWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/BuildersWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/CampfireWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/FarmersWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.java`
* `src/main/java/com/tcm/MineTale/block/workbenches/menu/WorkbenchWorkbenchMenu.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: 3

🧹 Nitpick comments (13)
src/client/java/com/tcm/MineTale/block/workbenches/screen/WorkbenchWorkbenchScreen.java (1)

139-145: Consider removing or gating debug System.out.println statements.

Multiple debug print statements remain in production code (lines 139, 145, 250, 269, 275, 279). These will clutter logs and impact performance slightly. Consider removing them or using a proper logging framework with configurable log levels.

🔧 Example fix for one location
-                    System.out.println("Persistent Selection Success: " + results.get(0));
+                    // Remove or use: MineTale.LOGGER.debug("Persistent Selection Success: {}", results.get(0));

Also applies to: 250-250, 269-269, 275-275, 279-279

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

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/WorkbenchWorkbenchScreen.java`
around lines 139 - 145, Replace the debug System.out.println calls in
WorkbenchWorkbenchScreen (the printlns around the persistent selection/recipe
request logic and the other occurrences) with a proper logging call or remove
them entirely; locate the uses of System.out.println in the class (e.g., the
message "Persistent Selection Success: " and "Request failed: No recipe was ever
selected!" and the other printlns later) and either delete them or swap them for
a logger with an appropriate level (e.g., LOGGER.debug or LOGGER.trace) behind a
configurable log level so debug output can be enabled in development but omitted
in production.
src/main/java/com/tcm/MineTale/block/workbenches/menu/WorkbenchWorkbenchMenu.java (2)

90-92: Debug System.out.println should be removed or use proper logging.

Same pattern as other menu classes - consider removing or using a logging framework.

🤖 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/WorkbenchWorkbenchMenu.java`
around lines 90 - 92, Remove the debug System.out.println call in
WorkbenchWorkbenchMenu (the block checking nearbyItems and
playerInventory.player.level().isClientSide()) and either delete it entirely or
replace it with the project's logging framework (e.g., use a class logger such
as LOGGER.debug/trace with a clear message and include nearbyItems.size());
ensure you reference WorkbenchWorkbenchMenu and the nearbyItems check so the
change targets that exact debug print.

77-97: Consider extracting fillCraftSlotsStackedContents to base class.

The implementation in WorkbenchWorkbenchMenu and ArmorersWorkbenchMenu is nearly identical (accounting for player inventory, container slots, and networked nearby items). This could be extracted to AbstractWorkbenchContainerMenu to reduce duplication.

🤖 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/WorkbenchWorkbenchMenu.java`
around lines 77 - 97, Both WorkbenchWorkbenchMenu.fillCraftSlotsStackedContents
and ArmorersWorkbenchMenu implement the same logic (account playerInventory,
container slots, and networked nearby items); extract this logic into a
protected method on AbstractWorkbenchContainerMenu (e.g., protected void
fillCraftSlotsStackedContents(StackedItemContents contents)) and move the body
there: call this.playerInventory.fillStackedContents(contents), iterate
this.container.getContainerSize() / this.container.getItem(i), then
getNetworkedNearbyItems() and accountStack for each. Make sure
AbstractWorkbenchContainerMenu exposes/provides accessors or protected fields
for playerInventory, container, and getNetworkedNearbyItems() (or make that
method protected in the base) so subclasses can call it, then replace the
duplicate implementations in WorkbenchWorkbenchMenu and ArmorersWorkbenchMenu
with a single call to super.fillCraftSlotsStackedContents(contents).
src/main/java/com/tcm/MineTale/block/workbenches/menu/ArmorersWorkbenchMenu.java (1)

91-93: Debug System.out.println should be removed or use proper logging.

Similar to other files in this PR, this debug statement will clutter production logs.

🔧 Suggested fix
         if (!nearbyItems.isEmpty() && this.playerInventory.player.level().isClientSide()) {
-            System.out.println("DEBUG: Recipe Book is now accounting for " + nearbyItems.size() + " stacks from the packet!");
+            // Consider using a proper logger: MineTale.LOGGER.debug(...)
         }
🤖 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/ArmorersWorkbenchMenu.java`
around lines 91 - 93, Remove the debug System.out.println in
ArmorersWorkbenchMenu (the block checking nearbyItems and
playerInventory.player.level().isClientSide()) and either delete it or replace
it with the project's logging framework (e.g., use a LOGGER.debug/trace call) so
it does not print to stdout in production; locate the statement inside the
ArmorersWorkbenchMenu class and update that method accordingly to use the
established logger or remove the line entirely.
src/main/java/com/tcm/MineTale/registry/ModRecipes.java (1)

43-48: Javadoc is outdated.

The method documentation only mentions furnace, campfire, and workbench types, but the method now also registers armorers, farmers, and builders types.

📝 Suggested update
     /**
      * Registers the mod's recipe types and their serializers into the game's built-in registries.
      *
-     * Specifically registers the furnace (FURNACE_T1_TYPE), campfire (CAMPFIRE_TYPE),
-     * and workbench (WORKBENCH_TYPE) recipe types with their corresponding serializers.
+     * Registers all workbench recipe types (furnace, campfire, workbench, armorers, farmers, builders)
+     * with their corresponding serializers.
      */
🤖 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 43 -
48, The Javadoc on ModRecipes is outdated: update the method/class comment that
currently mentions only FURNACE_T1_TYPE, CAMPFIRE_TYPE and WORKBENCH_TYPE to
also document the additional registered recipe types and serializers
(ARMORER_TYPE, FARMER_TYPE, BUILDER_TYPE and their corresponding serializer
constants/registrations). Edit the Javadoc block above the registering method in
ModRecipes to list all six recipe types and briefly note that each is registered
into the game's registries, referencing the constants FURNACE_T1_TYPE,
CAMPFIRE_TYPE, WORKBENCH_TYPE, ARMORER_TYPE, FARMER_TYPE and BUILDER_TYPE so the
doc matches the actual registration behavior.
src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java (2)

130-146: Remove debug print statements before release.

The System.out.println calls on lines 139 and 145 should be removed or converted to proper logging with an appropriate level (e.g., MineTale.LOGGER.debug()).

🧹 Suggested cleanup
                 if (!results.isEmpty()) {
-                    System.out.println("Persistent Selection Success: " + results.get(0));
                     ClientPlayNetworking.send(new CraftRequestPayload(results.get(0), amount));
                     return;
                 }
             }
         }
-        System.out.println("Request failed: No recipe was ever selected!");
+        MineTale.LOGGER.debug("Craft request failed: No recipe was selected");
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java`
around lines 130 - 146, In handleCraftRequest(int amount) remove the two
System.out.println debug prints and replace them with proper logger calls (use
MineTale.LOGGER.debug(...)) or delete them entirely; specifically update the
println in the success branch that prints "Persistent Selection Success: " +
results.get(0) and the failure branch printing "Request failed: No recipe was
ever selected!" to use MineTale.LOGGER.debug with the same or clearer messages
so debugging remains available without using System.out.

249-281: Remove debug print statements from ingredient checking.

Multiple System.out.println debug calls exist in hasIngredientAmount. These should be removed or converted to proper logging before release.

🧹 Suggested cleanup
     private boolean hasIngredientAmount(Inventory inventory, Ingredient ingredient, int totalRequired) {
-        System.out.println("DEBUG: Searching inventory + nearby for " + totalRequired + "...");
         if (totalRequired <= 0) return true;
         
         int found = 0;
 
         // 1. Check Player Inventory
         for (int i = 0; i < inventory.getContainerSize(); i++) {
             ItemStack stack = inventory.getItem(i);
             if (!stack.isEmpty() && ingredient.test(stack)) {
                 found += stack.getCount();
             }
         }
 
         // 2. CHECK THE NETWORKED ITEMS FROM CHESTS
         if (this.menu instanceof AbstractWorkbenchContainerMenu workbenchMenu) {
             for (ItemStack stack : workbenchMenu.getNetworkedNearbyItems()) {
                 if (!stack.isEmpty() && ingredient.test(stack)) {
                     found += stack.getCount();
-                    System.out.println("DEBUG: Found " + stack.getCount() + " in nearby networked list. Total: " + found);
                 }
             }
         }
         
-        if (found >= totalRequired) {
-            System.out.println("DEBUG: Requirement MET with " + found + "/" + totalRequired);
-            return true;
-        }
-        
-        System.out.println("DEBUG: FAILED. Only found: " + found + "/" + totalRequired);
-        return false;
+        return found >= totalRequired;
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java`
around lines 249 - 281, The hasIngredientAmount method contains multiple
System.out.println debug statements; remove those println calls (or replace them
with the appropriate logger debug calls if a logging facility exists) inside
hasIngredientAmount and the block that iterates
workbenchMenu.getNetworkedNearbyItems so the method no longer prints to stdout
in production. Ensure only meaningful logging via the project's logger (e.g.,
LOGGER.debug(...) if available) is used, and leave the logic and return behavior
of hasIngredientAmount and use of workbenchMenu.getNetworkedNearbyItems
unchanged.
src/main/java/com/tcm/MineTale/block/workbenches/entity/FarmersWorkbenchEntity.java (1)

28-62: Consider simplifying ContainerData for slotless workbench.

The ContainerData implementation returns getCount() = 4 but the get() method returns 0 for all indices. Since FarmersWorkbenchMenu uses DATA_SIZE = 0, this data is unused. Consider simplifying to match the actual usage or documenting why 4 is returned.

♻️ Suggested simplification
     protected final ContainerData data = new ContainerData() {
         `@Override`
         public int get(int index) {
-            return switch (index) {
-                default -> 0;
-            };
+            return 0;
         }
 
         `@Override`
         public void set(int index, int value) {
             // Not required on WorkbenchEntity
         }
 
         `@Override`
         public int getCount() {
-            return 4;
+            return 0; // Slotless workbench - no synced 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/block/workbenches/entity/FarmersWorkbenchEntity.java`
around lines 28 - 62, The ContainerData implementation in FarmersWorkbenchEntity
named data exposes getCount() == 4 while get() always returns 0 and
FarmersWorkbenchMenu uses DATA_SIZE = 0; update the entity to match actual usage
by either removing the unused ContainerData field or changing its getCount() to
return 0 (and keep get/set as no-ops) so the workbench is slotless and
consistent with FarmersWorkbenchMenu.DATA_SIZE; modify the data field in
FarmersWorkbenchEntity (or adjust FarmersWorkbenchMenu.DATA_SIZE if intentional)
to ensure the two symbols ContainerData data and FarmersWorkbenchMenu.DATA_SIZE
agree.
src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java (2)

139-139: Remove debug print statements in handleCraftRequest.

These System.out.println calls should be removed or replaced with proper logging for production.

🧹 Proposed fix
             if (entry != null) {
                 List<ItemStack> results = entry.resultItems(SlotDisplayContext.fromLevel(this.minecraft.level));
                 if (!results.isEmpty()) {
-                    System.out.println("Persistent Selection Success: " + results.get(0));
                     ClientPlayNetworking.send(new CraftRequestPayload(results.get(0), amount));
                     return;
                 }
             }
         }
-        System.out.println("Request failed: No recipe was ever selected!");
     }

Also applies to: 145-145

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

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java`
at line 139, In BuildersWorkbenchScreen.handleCraftRequest remove the debug
System.out.println calls (e.g., "Persistent Selection Success: " +
results.get(0)) and replace them with proper logging or delete them entirely;
locate the println occurrences inside the handleCraftRequest method and either
call the class's logger (or add an SLF4J/Minecraft logger) with an appropriate
log level (info/debug) and contextual message, or remove the lines if no runtime
logging is desired.

249-281: Remove debug print statements in hasIngredientAmount.

Multiple debug System.out.println calls will spam the console during normal gameplay. Remove them or use a proper logger with debug level.

🧹 Proposed fix
     private boolean hasIngredientAmount(Inventory inventory, Ingredient ingredient, int totalRequired) {
-        System.out.println("DEBUG: Searching inventory + nearby for " + totalRequired + "...");
         if (totalRequired <= 0) return true;
         
         int found = 0;

         // 1. Check Player Inventory
         for (int i = 0; i < inventory.getContainerSize(); i++) {
             ItemStack stack = inventory.getItem(i);
             if (!stack.isEmpty() && ingredient.test(stack)) {
                 found += stack.getCount();
             }
         }

         // 2. CHECK THE NETWORKED ITEMS FROM CHESTS
         // This is the list we sent via the packet!
         if (this.menu instanceof AbstractWorkbenchContainerMenu workbenchMenu) {
             for (ItemStack stack : workbenchMenu.getNetworkedNearbyItems()) {
                 if (!stack.isEmpty() && ingredient.test(stack)) {
                     found += stack.getCount();
-                    System.out.println("DEBUG: Found " + stack.getCount() + " in nearby networked list. Total: " + found);
                 }
             }
         }
         
-        if (found >= totalRequired) {
-            System.out.println("DEBUG: Requirement MET with " + found + "/" + totalRequired);
-            return true;
-        }
-        
-        System.out.println("DEBUG: FAILED. Only found: " + found + "/" + totalRequired);
-        return false;
+        return found >= totalRequired;
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java`
around lines 249 - 281, The hasIngredientAmount method contains multiple
System.out.println debug statements that should be removed (or replaced with a
proper logger at debug level); open the hasIngredientAmount method and delete
the println calls that announce "DEBUG: Searching inventory...", "DEBUG: Found
... in nearby networked list...", "DEBUG: Requirement MET...", and "DEBUG:
FAILED..." or replace them with calls to a class logger (e.g.,
LOGGER.debug(...)) guarded by the logger's isDebugEnabled check; the relevant
symbols to edit are the hasIngredientAmount(Inventory, Ingredient, int) method,
the menu field check (this.menu instanceof AbstractWorkbenchContainerMenu
workbenchMenu), and use workbenchMenu.getNetworkedNearbyItems() as-is.
src/main/java/com/tcm/MineTale/block/workbenches/menu/BuildersWorkbenchMenu.java (1)

91-93: Remove debug print statement before merging.

Same issue as in FarmersWorkbenchMenu - this debug logging will spam the console in production.

🧹 Proposed fix
-        if (!nearbyItems.isEmpty() && this.playerInventory.player.level().isClientSide()) {
-            System.out.println("DEBUG: Recipe Book is now accounting for " + nearbyItems.size() + " stacks from the packet!");
-        }
🤖 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/BuildersWorkbenchMenu.java`
around lines 91 - 93, In BuildersWorkbenchMenu remove the temporary
System.out.println debug statement that prints nearbyItems size (the line inside
the if checking nearbyItems.isEmpty() &&
this.playerInventory.player.level().isClientSide()); either delete it outright
or replace it with a proper logger.debug call consistent with
FarmersWorkbenchMenu's approach so production won't be spammed—ensure the
nearbyItems/level check remains unchanged and only the Console print is removed
or converted to debug logging.
src/main/java/com/tcm/MineTale/block/workbenches/menu/FarmersWorkbenchMenu.java (1)

91-93: Remove debug print statement before merging.

This System.out.println call will spam the console in production. Consider using a proper logger with a debug level or removing it entirely.

🧹 Proposed fix
-        if (!nearbyItems.isEmpty() && this.playerInventory.player.level().isClientSide()) {
-            System.out.println("DEBUG: Recipe Book is now accounting for " + nearbyItems.size() + " stacks from the packet!");
-        }
🤖 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/FarmersWorkbenchMenu.java`
around lines 91 - 93, Remove the debug System.out.println in
FarmersWorkbenchMenu where it logs nearbyItems size; either delete the line or
replace it with a proper logger.debug call (using the project's logging
framework) and guard it with the existing condition (nearbyItems.isEmpty() check
and playerInventory.player.level().isClientSide()). Update references in
FarmersWorkbenchMenu so the log uses a logger instance (e.g., a private static
final Logger) and a clear message like "Recipe Book accounting for {} stacks"
with the nearbyItems.size() parameter.
src/main/java/com/tcm/MineTale/registry/ModBlocks.java (1)

80-92: Consider using _block suffix for consistency with other workbenches.

Other workbench registrations use the _block suffix (e.g., campfire_workbench_block, armorers_workbench_block), but these use farmers_workbench and builders_workbench. This affects resource locations for textures, models, and language files.

🎨 Proposed fix for naming consistency
 	public static final Block FARMERS_WORKBENCH_BLOCK = register(
-		"farmers_workbench",
+		"farmers_workbench_block",
 		FarmersWorkbench::new,
 		BlockBehaviour.Properties.of().sound(SoundType.WOOD),
 		true
 	);

 	public static final Block BUILDERS_WORKBENCH_BLOCK = register(
-		"builders_workbench",
+		"builders_workbench_block",
 		BuildersWorkbench::new,
 		BlockBehaviour.Properties.of().sound(SoundType.WOOD),
 		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/registry/ModBlocks.java` around lines 80 - 92,
The block registration names for FARMERS_WORKBENCH_BLOCK and
BUILDERS_WORKBENCH_BLOCK currently use "farmers_workbench" and
"builders_workbench", causing inconsistent resource locations; update the
register(...) calls to use "farmers_workbench_block" and
"builders_workbench_block" respectively (keep the same constructors
FarmersWorkbench::new and BuildersWorkbench::new and existing
BlockBehaviour.Properties), and then ensure any corresponding resource keys
(textures/models/lang entries) are renamed to match the new registration IDs.
🤖 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/BuildersWorkbenchScreen.java`:
- Around line 220-230: The code uses the deprecated Ingredient.items() call
inside BuildersWorkbenchScreen to build keys for aggregatedRequirements and
holderToIngredient; update this by replacing direct enumeration with a stable,
non-deprecated keying strategy (e.g., compute a deterministic key from
Ingredient.toDisplay() or a normalized representation produced by testing a
canonical ItemStack) so you no longer rely on Ingredient.items(); specifically,
in the loop that currently references Ingredient.items() and creates
List<Holder<Item>> key, produce a stable key (string or custom object) derived
from Ingredient.toDisplay() or a canonical test-based representation, then use
that key when updating aggregatedRequirements and holderToIngredient and ensure
hasIngredientAmount uses the same keying method.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java`:
- Around line 220-230: The loop in FarmersWorkbenchScreen that builds keys for
aggregatedRequirements and holderToIngredient uses the deprecated
Ingredient.items(); replace that call with ing.getValues() (which returns the
HolderSet<Item>) and call toList() on it to produce the List<Holder<Item>> key,
then remove the `@SuppressWarnings`("deprecation") annotation; update references
in the same block where aggregatedRequirements.put(...) and
holderToIngredient.putIfAbsent(...) are used so the logic remains unchanged but
the deprecated method is eliminated.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/FarmersWorkbenchEntity.java`:
- Around line 164-175: The hasFuel() method currently calls
this.getItem(Constants.FUEL_SLOT) which can throw IndexOutOfBoundsException
because FarmersWorkbenchMenu uses EMPTY_SIZE = 0 (slotless); change hasFuel() in
FarmersWorkbenchEntity to avoid accessing inventory slots (do not call getItem
with Constants.FUEL_SLOT) — since this workbench doesn't use fuel simply return
true (or otherwise return a constant boolean) and remove or leave commented the
fuel-slot checks; ensure the method signature remains protected boolean
hasFuel() and no inventory access is performed.

---

Nitpick comments:
In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java`:
- Line 139: In BuildersWorkbenchScreen.handleCraftRequest remove the debug
System.out.println calls (e.g., "Persistent Selection Success: " +
results.get(0)) and replace them with proper logging or delete them entirely;
locate the println occurrences inside the handleCraftRequest method and either
call the class's logger (or add an SLF4J/Minecraft logger) with an appropriate
log level (info/debug) and contextual message, or remove the lines if no runtime
logging is desired.
- Around line 249-281: The hasIngredientAmount method contains multiple
System.out.println debug statements that should be removed (or replaced with a
proper logger at debug level); open the hasIngredientAmount method and delete
the println calls that announce "DEBUG: Searching inventory...", "DEBUG: Found
... in nearby networked list...", "DEBUG: Requirement MET...", and "DEBUG:
FAILED..." or replace them with calls to a class logger (e.g.,
LOGGER.debug(...)) guarded by the logger's isDebugEnabled check; the relevant
symbols to edit are the hasIngredientAmount(Inventory, Ingredient, int) method,
the menu field check (this.menu instanceof AbstractWorkbenchContainerMenu
workbenchMenu), and use workbenchMenu.getNetworkedNearbyItems() as-is.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java`:
- Around line 130-146: In handleCraftRequest(int amount) remove the two
System.out.println debug prints and replace them with proper logger calls (use
MineTale.LOGGER.debug(...)) or delete them entirely; specifically update the
println in the success branch that prints "Persistent Selection Success: " +
results.get(0) and the failure branch printing "Request failed: No recipe was
ever selected!" to use MineTale.LOGGER.debug with the same or clearer messages
so debugging remains available without using System.out.
- Around line 249-281: The hasIngredientAmount method contains multiple
System.out.println debug statements; remove those println calls (or replace them
with the appropriate logger debug calls if a logging facility exists) inside
hasIngredientAmount and the block that iterates
workbenchMenu.getNetworkedNearbyItems so the method no longer prints to stdout
in production. Ensure only meaningful logging via the project's logger (e.g.,
LOGGER.debug(...) if available) is used, and leave the logic and return behavior
of hasIngredientAmount and use of workbenchMenu.getNetworkedNearbyItems
unchanged.

In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/WorkbenchWorkbenchScreen.java`:
- Around line 139-145: Replace the debug System.out.println calls in
WorkbenchWorkbenchScreen (the printlns around the persistent selection/recipe
request logic and the other occurrences) with a proper logging call or remove
them entirely; locate the uses of System.out.println in the class (e.g., the
message "Persistent Selection Success: " and "Request failed: No recipe was ever
selected!" and the other printlns later) and either delete them or swap them for
a logger with an appropriate level (e.g., LOGGER.debug or LOGGER.trace) behind a
configurable log level so debug output can be enabled in development but omitted
in production.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/FarmersWorkbenchEntity.java`:
- Around line 28-62: The ContainerData implementation in FarmersWorkbenchEntity
named data exposes getCount() == 4 while get() always returns 0 and
FarmersWorkbenchMenu uses DATA_SIZE = 0; update the entity to match actual usage
by either removing the unused ContainerData field or changing its getCount() to
return 0 (and keep get/set as no-ops) so the workbench is slotless and
consistent with FarmersWorkbenchMenu.DATA_SIZE; modify the data field in
FarmersWorkbenchEntity (or adjust FarmersWorkbenchMenu.DATA_SIZE if intentional)
to ensure the two symbols ContainerData data and FarmersWorkbenchMenu.DATA_SIZE
agree.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/ArmorersWorkbenchMenu.java`:
- Around line 91-93: Remove the debug System.out.println in
ArmorersWorkbenchMenu (the block checking nearbyItems and
playerInventory.player.level().isClientSide()) and either delete it or replace
it with the project's logging framework (e.g., use a LOGGER.debug/trace call) so
it does not print to stdout in production; locate the statement inside the
ArmorersWorkbenchMenu class and update that method accordingly to use the
established logger or remove the line entirely.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/BuildersWorkbenchMenu.java`:
- Around line 91-93: In BuildersWorkbenchMenu remove the temporary
System.out.println debug statement that prints nearbyItems size (the line inside
the if checking nearbyItems.isEmpty() &&
this.playerInventory.player.level().isClientSide()); either delete it outright
or replace it with a proper logger.debug call consistent with
FarmersWorkbenchMenu's approach so production won't be spammed—ensure the
nearbyItems/level check remains unchanged and only the Console print is removed
or converted to debug logging.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/FarmersWorkbenchMenu.java`:
- Around line 91-93: Remove the debug System.out.println in FarmersWorkbenchMenu
where it logs nearbyItems size; either delete the line or replace it with a
proper logger.debug call (using the project's logging framework) and guard it
with the existing condition (nearbyItems.isEmpty() check and
playerInventory.player.level().isClientSide()). Update references in
FarmersWorkbenchMenu so the log uses a logger instance (e.g., a private static
final Logger) and a clear message like "Recipe Book accounting for {} stacks"
with the nearbyItems.size() parameter.

In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/WorkbenchWorkbenchMenu.java`:
- Around line 90-92: Remove the debug System.out.println call in
WorkbenchWorkbenchMenu (the block checking nearbyItems and
playerInventory.player.level().isClientSide()) and either delete it entirely or
replace it with the project's logging framework (e.g., use a class logger such
as LOGGER.debug/trace with a clear message and include nearbyItems.size());
ensure you reference WorkbenchWorkbenchMenu and the nearbyItems check so the
change targets that exact debug print.
- Around line 77-97: Both WorkbenchWorkbenchMenu.fillCraftSlotsStackedContents
and ArmorersWorkbenchMenu implement the same logic (account playerInventory,
container slots, and networked nearby items); extract this logic into a
protected method on AbstractWorkbenchContainerMenu (e.g., protected void
fillCraftSlotsStackedContents(StackedItemContents contents)) and move the body
there: call this.playerInventory.fillStackedContents(contents), iterate
this.container.getContainerSize() / this.container.getItem(i), then
getNetworkedNearbyItems() and accountStack for each. Make sure
AbstractWorkbenchContainerMenu exposes/provides accessors or protected fields
for playerInventory, container, and getNetworkedNearbyItems() (or make that
method protected in the base) so subclasses can call it, then replace the
duplicate implementations in WorkbenchWorkbenchMenu and ArmorersWorkbenchMenu
with a single call to super.fillCraftSlotsStackedContents(contents).

In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java`:
- Around line 80-92: The block registration names for FARMERS_WORKBENCH_BLOCK
and BUILDERS_WORKBENCH_BLOCK currently use "farmers_workbench" and
"builders_workbench", causing inconsistent resource locations; update the
register(...) calls to use "farmers_workbench_block" and
"builders_workbench_block" respectively (keep the same constructors
FarmersWorkbench::new and BuildersWorkbench::new and existing
BlockBehaviour.Properties), and then ensure any corresponding resource keys
(textures/models/lang entries) are renamed to match the new registration IDs.

In `@src/main/java/com/tcm/MineTale/registry/ModRecipes.java`:
- Around line 43-48: The Javadoc on ModRecipes is outdated: update the
method/class comment that currently mentions only FURNACE_T1_TYPE, CAMPFIRE_TYPE
and WORKBENCH_TYPE to also document the additional registered recipe types and
serializers (ARMORER_TYPE, FARMER_TYPE, BUILDER_TYPE and their corresponding
serializer constants/registrations). Edit the Javadoc block above the
registering method in ModRecipes to list all six recipe types and briefly note
that each is registered into the game's registries, referencing the constants
FURNACE_T1_TYPE, CAMPFIRE_TYPE, WORKBENCH_TYPE, ARMORER_TYPE, FARMER_TYPE and
BUILDER_TYPE so the doc matches the actual registration behavior.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d06564 and a595d5c.

📒 Files selected for processing (26)
  • src/client/java/com/tcm/MineTale/MineTaleClient.java
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/FarmersWorkbenchScreen.java
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/WorkbenchWorkbenchScreen.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/BuilderRecipes.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/FarmerRecipes.java
  • src/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.java
  • src/main/java/com/tcm/MineTale/MineTale.java
  • src/main/java/com/tcm/MineTale/block/workbenches/BuildersWorkbench.java
  • src/main/java/com/tcm/MineTale/block/workbenches/FarmersWorkbench.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/BuildersWorkbenchEntity.java
  • src/main/java/com/tcm/MineTale/block/workbenches/entity/FarmersWorkbenchEntity.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/AbstractWorkbenchContainerMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/ArmorersWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/BuildersWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/CampfireWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/FarmersWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.java
  • src/main/java/com/tcm/MineTale/block/workbenches/menu/WorkbenchWorkbenchMenu.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
💤 Files with no reviewable changes (2)
  • src/main/java/com/tcm/MineTale/registry/ModItems.java
  • src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java

@The-Code-Monkey The-Code-Monkey changed the base branch from 1.21 to feat/add-farmers-workbench February 26, 2026 11:40
@The-Code-Monkey The-Code-Monkey merged commit e9a6514 into feat/add-farmers-workbench Feb 26, 2026
3 of 4 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.

1 participant