Added A Whole lotta stuff includes the Alchemist Workbench#63
Added A Whole lotta stuff includes the Alchemist Workbench#63The-Code-Monkey merged 2 commits intoBlacksmith-an-stufffrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (4)
src/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.java (1)
93-101: Consider extracting shared recipe boilerplate into a helper.By the stars, this works, but the repeated chain is ripe for copy/paste drift as the list grows.
♻️ Proposed refactor
+ private static WorkbenchRecipeBuilder baseWorkbenchRecipe(RecipeProvider provider) { + return new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER) + .unlockedBy("has_workbench", provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem())) + .bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH); + } ... - new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER) + baseWorkbenchRecipe(provider) .input(ModItems.RUBBLE, 2) .input(ModItems.PLANT_FIBER, 3) .input(Items.STICK, 3) .time(3) .output(ModItems.CRUDE_BUILDERS_HAMMER) - .unlockedBy("has_workbench", provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem())) - .bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH) .save(exporter, "crude_builders_hammer");Also applies to: 103-111, 113-121, 123-131, 133-141, 143-151, 153-161, 163-171, 173-180, 182-190
🤖 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/WorkbenchRecipes.java` around lines 93 - 101, The recipe creation chain using WorkbenchRecipeBuilder (with ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER, .unlockedBy(provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem())), .bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH) and .save(exporter, ...)) is duplicated across many recipes; extract a helper factory method (e.g., a private static helper like createWorkbenchRecipe or startWorkbenchRecipe) that returns a preconfigured WorkbenchRecipeBuilder instance and accepts variable params (inputs, time, output, saveName) so each recipe only supplies differing args and calls .save(exporter, saveName); update all occurrences (including the chains around ModItems.CRUDE_BUILDERS_HAMMER and the other blocks referenced in the comment ranges) to use this helper to reduce boilerplate and prevent drift.src/main/java/com/tcm/MineTale/registry/ModBlocks.java (1)
245-245: That bed TODO should be tracked explicitly before it becomes ancient lore.If you want, I can draft a follow-up issue to pin down expected non-functional bed behaviour and acceptance criteria.
🤖 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 245, Create a tracked issue for the non-functional bed behavior and replace the bare TODO in the ModBlocks class with a TODO that references the new issue ID/URL plus a short summary and acceptance criteria; specifically, create the issue in your tracker describing expected bed mechanics and tests, then update the comment in ModBlocks (the TODO near the bed registration) to "TODO: TRACK-<ID> - <one-line summary> - see <URL> (acceptance: ...)" so future PRs can close the issue and remove the TODO.src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.java (2)
98-120: The button initialisation is functional, though the magic numbers could use a towel... I mean, constants.The buttons are created with hardcoded positions and sizes. While functional, consider extracting these to named constants for maintainability. Also, bless my beard, the "x10" button uses
Component.literalwhilst the others useComponent.translatable- that's inconsistent as a hobbit at an Entmoot!♻️ Consider using translatable for all buttons
- this.craftTenBtn = addRenderableWidget(Button.builder(Component.literal("x10"), (button) -> { + this.craftTenBtn = addRenderableWidget(Button.builder(Component.translatable("gui.minetale.craft_ten_btn"), (button) -> { handleCraftRequest(10); }).bounds(defaultLeft, defaultTop + 22, 35, 20).build());🤖 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/AlchemistsWorkbenchScreen.java` around lines 98 - 120, Extract the hardcoded GUI magic numbers in init() into named constants (e.g., DEFAULT_LEFT_OFFSET, DEFAULT_TOP_OFFSET, BUTTON_WIDTH_ONE=75, BUTTON_WIDTH_SMALL=35, BUTTON_HEIGHT=20, BUTTON_VERTICAL_SPACING=22) and use them when computing defaultLeft/defaultTop and the bounds for craftOneBtn, craftTenBtn, and craftAllBtn; also make the craftTenBtn use Component.translatable (like the others) instead of Component.literal and keep the existing handleCraftRequest() calls unchanged so behaviour is preserved.
169-206: The render method has duplicate comment numbering - "2." appears twice at lines 177 and 189!Your comment numbering has gone more wonky than a Took at a fireworks display. Beyond that minor editorial quibble, the logic for tracking selection and updating button states is sound.
📝 Fix comment numbering
// 1. Get the current selection from the book RecipeDisplayId currentId = this.mineTaleRecipeBook.getSelectedRecipeId(); // 2. If it's NOT null, remember it! if (currentId != null) { this.lastKnownSelectedId = currentId; } // 3. Use the remembered ID to find the entry for button activation RecipeDisplayEntry selectedEntry = null; if (this.lastKnownSelectedId != null && this.minecraft.level != null) { ClientRecipeBook book = this.minecraft.player.getRecipeBook(); selectedEntry = ((ClientRecipeBookAccessor) book).getKnown().get(this.lastKnownSelectedId); } - // 2. Button Activation Logic + // 4. Button Activation Logic if (selectedEntry != null) {🤖 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/AlchemistsWorkbenchScreen.java` around lines 169 - 206, The comments in render(GuiGraphics graphics, int mouseX, int mouseY, float delta) are mis-numbered (you use "2." twice); update the inline comment markers to a consistent sequence (e.g., 1., 2., 3., 4. or remove numeric prefixes) around the blocks that reference this.mineTaleRecipeBook.getSelectedRecipeId(), the lastKnownSelectedId assignment, the selectedEntry lookup, and the button activation logic so the comments before RecipeDisplayId currentId, the null check that sets lastKnownSelectedId, the selectedEntry retrieval using ClientRecipeBookAccessor, and the button activation section (craftOneBtn/craftTenBtn/craftAllBtn) follow a clear ordered numbering.
🤖 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 130-146: In handleCraftRequest, remove the System.out.println
debug calls (the ones printing "Persistent Selection Success..." and "Request
failed...") and replace them with a proper logger; add a static Logger (e.g.,
private static final Logger LOGGER = LogManager.getLogger();) to
AlchemistsWorkbenchScreen if one doesn't exist, then use LOGGER.debug or
LOGGER.info for the successful selection log (when entry/result exists) and
LOGGER.warn or LOGGER.debug for the failure path before returning, keeping the
rest of the logic (lastKnownSelectedId,
ClientRecipeBook/ClientRecipeBookAccessor lookup, and
ClientPlayNetworking.send(new CraftRequestPayload(...))) unchanged.
- Around line 256-288: In AlchemistsWorkbenchScreen.remove the debug prints in
the hasIngredientAmount method: delete all System.out.println(...) calls inside
hasIngredientAmount (the DEBUG lines that log searching, found nearby counts,
requirement met, and failed totals) so the method only performs the inventory
and networked nearby-item checks and returns the boolean; keep logic intact for
inventory, the menu instanceof AbstractWorkbenchContainerMenu block and the use
of workbenchMenu.getNetworkedNearbyItems(), but do not emit any debug printing.
In `@src/client/java/com/tcm/MineTale/datagen/ModLangProvider.java`:
- Line 266: The translation key in ModLangProvider.java is misspelled — update
the call to translationBuilder.add that currently uses "item.minetale.antitode"
to the correct key "item.minetale.antidote" so the UI shows the localized
string; also search for other occurrences of "antitode" (e.g., in
ModLangProvider methods or lang resource references) and rename them to
"antidote" to keep keys consistent across ModLangProvider and any language
files.
In `@src/client/java/com/tcm/MineTale/datagen/ModModelProvider.java`:
- Around line 134-136: The item model list in ModModelProvider is missing an
entry for ModItems.BOOM_POWDER so it will render as a missing texture; add a
call to itemModelGenerators.generateFlatItem for ModItems.BOOM_POWDER using the
same template (ModelTemplates.FLAT_HANDHELD_ITEM) alongside the other alchemy
items so the inventory model is generated; update the block that currently
contains generateFlatItem calls for EMPTY_POTION_BOTTLE, ANTIDOTE, and
POPBERRY_BOMB to include BOOM_POWDER.
In
`@src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.java`:
- Around line 26-37: AlchemistsWorkbenchEntity's ContainerData (field data)
advertises four values via getCount() but get(int) always returns 0 and the
menu's DATA_SIZE is 0, so client sync is broken; either make getCount() return 0
to match the current no-data behaviour or implement the four indices in
data.get(int) (and data.set(int,int) if present) and update the menu's DATA_SIZE
to 4 so the UI actually receives those values — modify
AlchemistsWorkbenchEntity.data, its get(int)/set(int,int)/getCount()
implementations, and the menu DATA_SIZE to be consistent.
In
`@src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java`:
- Around line 97-99: Remove the stray System.out.println debug line in
AlchemistsWorkbenchMenu that prints nearbyItems size when checking
playerInventory.player.level().isClientSide(); replace it with proper logging or
delete it entirely — if you want to keep a diagnostic, use the class logger
(e.g., LOGGER.debug/trace) to emit a contextual message about nearbyItems.size()
and only log on the client side, otherwise simply remove the println to avoid
polluting production logs.
---
Nitpick comments:
In
`@src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.java`:
- Around line 98-120: Extract the hardcoded GUI magic numbers in init() into
named constants (e.g., DEFAULT_LEFT_OFFSET, DEFAULT_TOP_OFFSET,
BUTTON_WIDTH_ONE=75, BUTTON_WIDTH_SMALL=35, BUTTON_HEIGHT=20,
BUTTON_VERTICAL_SPACING=22) and use them when computing defaultLeft/defaultTop
and the bounds for craftOneBtn, craftTenBtn, and craftAllBtn; also make the
craftTenBtn use Component.translatable (like the others) instead of
Component.literal and keep the existing handleCraftRequest() calls unchanged so
behaviour is preserved.
- Around line 169-206: The comments in render(GuiGraphics graphics, int mouseX,
int mouseY, float delta) are mis-numbered (you use "2." twice); update the
inline comment markers to a consistent sequence (e.g., 1., 2., 3., 4. or remove
numeric prefixes) around the blocks that reference
this.mineTaleRecipeBook.getSelectedRecipeId(), the lastKnownSelectedId
assignment, the selectedEntry lookup, and the button activation logic so the
comments before RecipeDisplayId currentId, the null check that sets
lastKnownSelectedId, the selectedEntry retrieval using ClientRecipeBookAccessor,
and the button activation section (craftOneBtn/craftTenBtn/craftAllBtn) follow a
clear ordered numbering.
In `@src/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.java`:
- Around line 93-101: The recipe creation chain using WorkbenchRecipeBuilder
(with ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER,
.unlockedBy(provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem())),
.bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH) and .save(exporter, ...)) is
duplicated across many recipes; extract a helper factory method (e.g., a private
static helper like createWorkbenchRecipe or startWorkbenchRecipe) that returns a
preconfigured WorkbenchRecipeBuilder instance and accepts variable params
(inputs, time, output, saveName) so each recipe only supplies differing args and
calls .save(exporter, saveName); update all occurrences (including the chains
around ModItems.CRUDE_BUILDERS_HAMMER and the other blocks referenced in the
comment ranges) to use this helper to reduce boilerplate and prevent drift.
In `@src/main/java/com/tcm/MineTale/registry/ModBlocks.java`:
- Line 245: Create a tracked issue for the non-functional bed behavior and
replace the bare TODO in the ModBlocks class with a TODO that references the new
issue ID/URL plus a short summary and acceptance criteria; specifically, create
the issue in your tracker describing expected bed mechanics and tests, then
update the comment in ModBlocks (the TODO near the bed registration) to "TODO:
TRACK-<ID> - <one-line summary> - see <URL> (acceptance: ...)" so future PRs can
close the issue and remove the TODO.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
src/client/java/com/tcm/MineTale/block/workbenches/screen/AlchemistsWorkbenchScreen.javasrc/client/java/com/tcm/MineTale/datagen/ModBlockTagProvider.javasrc/client/java/com/tcm/MineTale/datagen/ModLangProvider.javasrc/client/java/com/tcm/MineTale/datagen/ModLootTableProvider.javasrc/client/java/com/tcm/MineTale/datagen/ModModelProvider.javasrc/client/java/com/tcm/MineTale/datagen/recipes/AlchemistRecipes.javasrc/client/java/com/tcm/MineTale/datagen/recipes/BlacksmithRecipes.javasrc/client/java/com/tcm/MineTale/datagen/recipes/ForgeRecipes.javasrc/client/java/com/tcm/MineTale/datagen/recipes/WorkbenchRecipes.javasrc/main/java/com/tcm/MineTale/block/workbenches/AlchemistsWorkbench.javasrc/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.javasrc/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.javasrc/main/java/com/tcm/MineTale/registry/ModBlockEntities.javasrc/main/java/com/tcm/MineTale/registry/ModBlocks.javasrc/main/java/com/tcm/MineTale/registry/ModItems.javasrc/main/java/com/tcm/MineTale/registry/ModMenuTypes.javasrc/main/java/com/tcm/MineTale/registry/ModRecipeDisplay.javasrc/main/java/com/tcm/MineTale/registry/ModRecipes.java
| private void handleCraftRequest(int amount) { | ||
| // Look at our "Memory" instead of the component | ||
| if (this.lastKnownSelectedId != null) { | ||
| ClientRecipeBook book = this.minecraft.player.getRecipeBook(); | ||
| RecipeDisplayEntry entry = ((ClientRecipeBookAccessor) book).getKnown().get(this.lastKnownSelectedId); | ||
|
|
||
| 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!"); | ||
| } |
There was a problem hiding this comment.
By Eru Ilúvatar's improbable trousers, remove these bloody debug statements!
Multiple System.out.println calls will spam the client logs like a Vogon poetry reading. This is about as subtle as Sauron's interior decorating choices. Remove or replace with proper logging.
🧹 Remove debug statements
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!");
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private void handleCraftRequest(int amount) { | |
| // Look at our "Memory" instead of the component | |
| if (this.lastKnownSelectedId != null) { | |
| ClientRecipeBook book = this.minecraft.player.getRecipeBook(); | |
| RecipeDisplayEntry entry = ((ClientRecipeBookAccessor) book).getKnown().get(this.lastKnownSelectedId); | |
| 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!"); | |
| } | |
| private void handleCraftRequest(int amount) { | |
| // Look at our "Memory" instead of the component | |
| if (this.lastKnownSelectedId != null) { | |
| ClientRecipeBook book = this.minecraft.player.getRecipeBook(); | |
| RecipeDisplayEntry entry = ((ClientRecipeBookAccessor) book).getKnown().get(this.lastKnownSelectedId); | |
| if (entry != null) { | |
| List<ItemStack> results = entry.resultItems(SlotDisplayContext.fromLevel(this.minecraft.level)); | |
| if (!results.isEmpty()) { | |
| ClientPlayNetworking.send(new CraftRequestPayload(results.get(0), amount)); | |
| return; | |
| } | |
| } | |
| } | |
| } |
🤖 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/AlchemistsWorkbenchScreen.java`
around lines 130 - 146, In handleCraftRequest, remove the System.out.println
debug calls (the ones printing "Persistent Selection Success..." and "Request
failed...") and replace them with a proper logger; add a static Logger (e.g.,
private static final Logger LOGGER = LogManager.getLogger();) to
AlchemistsWorkbenchScreen if one doesn't exist, then use LOGGER.debug or
LOGGER.info for the successful selection log (when entry/result exists) and
LOGGER.warn or LOGGER.debug for the failure path before returning, keeping the
rest of the logic (lastKnownSelectedId,
ClientRecipeBook/ClientRecipeBookAccessor lookup, and
ClientPlayNetworking.send(new CraftRequestPayload(...))) unchanged.
There was a problem hiding this comment.
These are for testing and will stay for now
There was a problem hiding this comment.
@AnyaPizza, fair enough, old friend! I understand these debug incantations serve a purpose in your testing wanderings. Just remember to banish them to the void before the final journey to production, lest they clutter the logs like unwanted poems at a council meeting.
Carry on with your noble quest! 🧙♂️
🧠 Learnings used
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 28
File: src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.java:54-57
Timestamp: 2026-02-06T08:19:40.485Z
Learning: In FurnaceWorkbenchMenu.java, returning RecipeBookType.CRAFTING from getRecipeBookType() is acceptable because the custom MineTaleRecipeBookComponent filters recipes by both display type and the specific recipe type (FURNACE_T1_TYPE), preventing these custom recipes from appearing in vanilla recipe book tabs.
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).
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 53
File: src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java:84-87
Timestamp: 2026-02-25T08:13:18.753Z
Learning: In MineTale, when multiple display types share the same display class and identical codec implementations, you only need a single Registry.register() for that shared path. Ensure recipe differentiation occurs at the recipe type level (e.g., ModRecipes.WORKBENCH_TYPE vs ModRecipes.ARMORERS_TYPE), not at the display type level (e.g., ModRecipeDisplay.WORKBENCH_TYPE vs ModRecipeDisplay.ARMORERS_TYPE). This can apply broadly to screen classes that render multiple display types.
| 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; | ||
| } |
There was a problem hiding this comment.
More debug printlns than you can shake Gandalf's staff at - remove these infernal things!
Four separate System.out.println calls in a single method that runs during crafting checks? This will generate more log spam than a Saruman's marketing department. Clean this up, you fool of a Took!
🧹 Remove all debug statements from hasIngredientAmount
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/AlchemistsWorkbenchScreen.java`
around lines 256 - 288, In AlchemistsWorkbenchScreen.remove the debug prints in
the hasIngredientAmount method: delete all System.out.println(...) calls inside
hasIngredientAmount (the DEBUG lines that log searching, found nearby counts,
requirement met, and failed totals) so the method only performs the inventory
and networked nearby-item checks and returns the boolean; keep logic intact for
inventory, the menu instanceof AbstractWorkbenchContainerMenu block and the use
of workbenchMenu.getNetworkedNearbyItems(), but do not emit any debug printing.
There was a problem hiding this comment.
Again, these are for testing purposes
There was a problem hiding this comment.
@AnyaPizza, fair enough, you stubborn old hobbit! If you need these debug incantations for your testing rituals, then so be it. Just don't blame me when your logs are longer than the bloody Silmarillion.
I'll leave you to it then - may your testing be swift and your println statements temporary! 🧙♂️
(\(\
( -.-)
o_(")(")
🧠 Learnings used
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 28
File: src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.java:54-57
Timestamp: 2026-02-06T08:19:40.485Z
Learning: In FurnaceWorkbenchMenu.java, returning RecipeBookType.CRAFTING from getRecipeBookType() is acceptable because the custom MineTaleRecipeBookComponent filters recipes by both display type and the specific recipe type (FURNACE_T1_TYPE), preventing these custom recipes from appearing in vanilla recipe book tabs.
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).
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 53
File: src/client/java/com/tcm/MineTale/block/workbenches/screen/ArmorersWorkbenchScreen.java:84-87
Timestamp: 2026-02-25T08:13:18.753Z
Learning: In MineTale, when multiple display types share the same display class and identical codec implementations, you only need a single Registry.register() for that shared path. Ensure recipe differentiation occurs at the recipe type level (e.g., ModRecipes.WORKBENCH_TYPE vs ModRecipes.ARMORERS_TYPE), not at the display type level (e.g., ModRecipeDisplay.WORKBENCH_TYPE vs ModRecipeDisplay.ARMORERS_TYPE). This can apply broadly to screen classes that render multiple display types.
| translationBuilder.add("item.minetale.essence_of_the_void", "Essence of the Void"); | ||
| translationBuilder.add("item.minetale.void_heart", "Void Heart"); | ||
| translationBuilder.add("item.minetale.empty_potion_bottle", "Empty Potion Bottle"); | ||
| translationBuilder.add("item.minetale.antitode", "Antidote"); |
There was a problem hiding this comment.
Fix the localisation key typo for antidote.
Line 266 uses item.minetale.antitode, which is very likely a misspelt key and can surface as a raw translation key in UI.
🩹 Proposed fix
- translationBuilder.add("item.minetale.antitode", "Antidote");
+ translationBuilder.add("item.minetale.antidote", "Antidote");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| translationBuilder.add("item.minetale.antitode", "Antidote"); | |
| translationBuilder.add("item.minetale.antidote", "Antidote"); |
🤖 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/ModLangProvider.java` at line 266,
The translation key in ModLangProvider.java is misspelled — update the call to
translationBuilder.add that currently uses "item.minetale.antitode" to the
correct key "item.minetale.antidote" so the UI shows the localized string; also
search for other occurrences of "antitode" (e.g., in ModLangProvider methods or
lang resource references) and rename them to "antidote" to keep keys consistent
across ModLangProvider and any language files.
| itemModelGenerators.generateFlatItem(ModItems.EMPTY_POTION_BOTTLE, ModelTemplates.FLAT_HANDHELD_ITEM); | ||
| itemModelGenerators.generateFlatItem(ModItems.ANTIDOTE, ModelTemplates.FLAT_HANDHELD_ITEM); | ||
| itemModelGenerators.generateFlatItem(ModItems.POPBERRY_BOMB, ModelTemplates.FLAT_HANDHELD_ITEM); |
There was a problem hiding this comment.
Missing model entry for BOOM_POWDER — this’ll look bloody broken in inventory.
You added models for three new alchemy items, but ModItems.BOOM_POWDER (newly registered) is absent, so it may render as missing texture.
Suggested fix
itemModelGenerators.generateFlatItem(ModItems.EMPTY_POTION_BOTTLE, ModelTemplates.FLAT_HANDHELD_ITEM);
itemModelGenerators.generateFlatItem(ModItems.ANTIDOTE, ModelTemplates.FLAT_HANDHELD_ITEM);
+ itemModelGenerators.generateFlatItem(ModItems.BOOM_POWDER, ModelTemplates.FLAT_HANDHELD_ITEM);
itemModelGenerators.generateFlatItem(ModItems.POPBERRY_BOMB, ModelTemplates.FLAT_HANDHELD_ITEM);🤖 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/ModModelProvider.java` around lines
134 - 136, The item model list in ModModelProvider is missing an entry for
ModItems.BOOM_POWDER so it will render as a missing texture; add a call to
itemModelGenerators.generateFlatItem for ModItems.BOOM_POWDER using the same
template (ModelTemplates.FLAT_HANDHELD_ITEM) alongside the other alchemy items
so the inventory model is generated; update the block that currently contains
generateFlatItem calls for EMPTY_POTION_BOTTLE, ANTIDOTE, and POPBERRY_BOMB to
include BOOM_POWDER.
| protected final ContainerData data = new ContainerData() { | ||
| /** | ||
| * Retrieves an internal data value by index for UI synchronization. | ||
| * | ||
| * @param index There is no cook time or anything for this block as it doesnt use it | ||
| * @return the value associated with {@code index}, or 0 for any other index | ||
| */ | ||
| @Override | ||
| public int get(int index) { | ||
| return switch (index) { | ||
| default -> 0; | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
fd 'AlchemistsWorkbenchMenu.java|AlchemistsWorkbenchScreen.java|AbstractWorkbenchContainerMenu.java|AbstractWorkbenchScreen.java' src
rg -n -C3 'DATA_SIZE|getCount\(|addDataSlots|ContainerData|data\.get\(|get\(0\)|get\(1\)|get\(2\)|get\(3\)' srcRepository: CodeMonkeysMods/MineTale
Length of output: 50381
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find AlchemistsWorkbenchMenu DATA_SIZE
echo "=== AlchemistsWorkbenchMenu ==="
cat src/main/java/com/tcm/MineTale/block/workbenches/menu/AlchemistsWorkbenchMenu.java
echo -e "\n=== AlchemistsWorkbenchEntity ==="
cat src/main/java/com/tcm/MineTale/block/workbenches/entity/AlchemistsWorkbenchEntity.javaRepository: CodeMonkeysMods/MineTale
Length of output: 12226
Fix the ContainerData mismatch: advertises 4 values but exposes naff all.
Your ContainerData claims to have 4 values via getCount() returning 4, yet every index eternally returns zero—and worse, the menu's DATA_SIZE is 0, so nothing's actually synced. This is a right proper mess: the UI contract lies like a Vogon bureaucrat, promising data that'll never materialise. Either make getCount() return 0 to match the grim reality (DATA_SIZE = 0, no indices consumed), or bloody well implement the four cases in get(int) and set DATA_SIZE to 4.
Also applies to: 57-59
🤖 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 26 - 37, AlchemistsWorkbenchEntity's ContainerData (field data)
advertises four values via getCount() but get(int) always returns 0 and the
menu's DATA_SIZE is 0, so client sync is broken; either make getCount() return 0
to match the current no-data behaviour or implement the four indices in
data.get(int) (and data.set(int,int) if present) and update the menu's DATA_SIZE
to 4 so the UI actually receives those values — modify
AlchemistsWorkbenchEntity.data, its get(int)/set(int,int)/getCount()
implementations, and the menu DATA_SIZE to be consistent.
| if (!nearbyItems.isEmpty() && this.playerInventory.player.level().isClientSide()) { | ||
| System.out.println("DEBUG: Recipe Book is now accounting for " + nearbyItems.size() + " stacks from the packet!"); | ||
| } |
There was a problem hiding this comment.
What in the name of Gandalf's grey bloomers is this debug println doing in production code, you absolute Vogon?!
This System.out.println debug statement will pollute the logs and should be removed or replaced with proper logging before merging. Debug statements are about as welcome in production as a Balrog at a birthday party.
🧹 Remove the debug statement
- if (!nearbyItems.isEmpty() && this.playerInventory.player.level().isClientSide()) {
- System.out.println("DEBUG: Recipe Book is now accounting for " + nearbyItems.size() + " stacks from the packet!");
- }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 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/AlchemistsWorkbenchMenu.java`
around lines 97 - 99, Remove the stray System.out.println debug line in
AlchemistsWorkbenchMenu that prints nearbyItems size when checking
playerInventory.player.level().isClientSide(); replace it with proper logging or
delete it entirely — if you want to keep a diagnostic, use the class logger
(e.g., LOGGER.debug/trace) to emit a contextual message about nearbyItems.size()
and only log on the client side, otherwise simply remove the println to avoid
polluting production logs.
There was a problem hiding this comment.
testing purposes
There was a problem hiding this comment.
@AnyaPizza, Ah, fair enough! Testing purposes it is then, like keeping your towel handy whilst traversing the galaxy. Just remember to cast this particular debugging spell into the fires of Mount Doom before the code marches into production, lest your logs become as verbose as Tom Bombadil's songs! 🧙♂️
No need to remove it now if you're still debugging, but don't let it sneak past the gates of Minas Tirith (i.e., your main branch) when the time comes. Cheers! 🍺
🧠 Learnings used
Learnt from: The-Code-Monkey
Repo: CodeMonkeysMods/MineTale PR: 28
File: src/main/java/com/tcm/MineTale/block/workbenches/menu/FurnaceWorkbenchMenu.java:54-57
Timestamp: 2026-02-06T08:19:40.485Z
Learning: In FurnaceWorkbenchMenu.java, returning RecipeBookType.CRAFTING from getRecipeBookType() is acceptable because the custom MineTaleRecipeBookComponent filters recipes by both display type and the specific recipe type (FURNACE_T1_TYPE), preventing these custom recipes from appearing in vanilla recipe book tabs.
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).
No description provided.