JEI Bug Report Incorrect Display Of Potion Recipes
This document details a bug encountered in Just Enough Items (JEI) related to the display of potion recipes, specifically when multiple ingredients can be used to create the same potion type. This issue was observed while using the Natural Philosophy mod alongside JEI on NeoForge. This article explores the steps to reproduce the bug, the expected and actual behavior, and provides additional context for developers to understand and address the problem.
Understanding the Issue
At the heart of this bug lies JEI's handling of potion recipes. When multiple ingredients can be used to create the same potion effect, JEI should display all possible reagents. However, in the observed scenario, JEI only displays the first registered ingredient, effectively hiding alternative crafting methods from the user. This can lead to confusion and limit the player's ability to utilize all available resources within the game.
This article will explore the specific steps to replicate the bug, analyze the expected versus the actual behavior, and provide additional context for developers to effectively understand and address the issue. Understanding the intricacies of this bug is crucial for ensuring that JEI accurately represents all crafting possibilities within a modded Minecraft environment. The implications of this bug extend beyond mere inconvenience; it can significantly impact gameplay by concealing alternative crafting methods and potentially hindering player progression.
Steps to Reproduce the Bug
To reproduce this bug, follow these steps:
- Clone the Natural Philosophy mod: Obtain the source code for the Natural Philosophy mod from its GitHub repository. The repository can be found at this link: https://github.com/voidsong-dragonfly/naturalphilosophy.
- Run the Minecraft client using Gradle: Navigate to the cloned directory in your terminal and execute the command
./gradlew runClient
. This command will compile the mod and launch a Minecraft client with the mod loaded. - Inspect JEI for Water Breathing potion recipes: Once the game has launched, open your inventory and access the JEI interface. Search for the "Water Breathing" potion. Observe the ingredients displayed for crafting this potion.
Detailed Breakdown of the Reproduction Steps
The reproduction steps are designed to provide a clear and concise method for replicating the bug. Cloning the Natural Philosophy mod ensures that you have the exact codebase used when the bug was initially reported. This eliminates any discrepancies that might arise from different mod versions or configurations. The provided GitHub link leads directly to the mod's repository, making it easy to access the source code.
Running the Minecraft client using Gradle is the standard way to test and debug Minecraft mods during development. The ./gradlew runClient
command automates the process of compiling the mod, setting up the Minecraft environment, and launching the game. This eliminates the need for manual configuration and ensures that the mod is loaded correctly.
Finally, inspecting JEI for Water Breathing potion recipes is the crucial step in observing the bug. By searching for the potion and examining its crafting ingredients, you can directly compare the expected behavior (all ingredients displayed) with the actual behavior (only one ingredient displayed).
Expected Behavior
When examining the recipes for the Water Breathing
potion in JEI, the expected behavior is that all possible ingredients should be displayed. In the case of Natural Philosophy, the mod adds an alternative ingredient, Red Algae
, to the standard Pufferfish
ingredient for crafting this potion. Therefore, JEI should display both Pufferfish
and Red Algae
as valid ingredients for creating the Water Breathing
potion.
Expanding on the Expected Behavior
The core principle behind JEI is to provide a comprehensive overview of all crafting possibilities within the game. This includes displaying all valid ingredients for a particular recipe, regardless of the mod that introduces them. The expected behavior highlights the importance of JEI accurately representing the crafting landscape, ensuring that players are aware of all available options.
In the context of potion recipes, this means that JEI should not limit itself to the first registered ingredient. Instead, it should iterate through all registered recipes for a specific potion type and display all the unique ingredients that can be used. This ensures that players are not inadvertently misled into thinking that there is only one way to craft a particular potion.
The expected behavior also aligns with the design philosophy of modded Minecraft, where mods often introduce alternative crafting methods to enhance gameplay and provide players with more flexibility. JEI, as a vital tool for navigating the modded landscape, should accurately reflect this diversity of crafting options.
Actual Behavior
In contrast to the expected behavior, JEI only displays one ingredient for the Water Breathing
potion recipe: Pufferfish
. The alternative ingredient, Red Algae
from the Natural Philosophy mod, is not shown in the JEI interface. This behavior indicates a bug in JEI's handling of potion recipes when multiple ingredients are available.
Analyzing the Actual Behavior
This actual behavior has significant implications for players using Natural Philosophy and other mods that introduce alternative potion ingredients. By hiding the Red Algae
ingredient, JEI effectively conceals a valid crafting option from the player. This can lead to players believing that Pufferfish
is the only way to craft the Water Breathing
potion, potentially limiting their access to this potion if Pufferfish
is scarce or unavailable.
The underlying cause of this bug likely lies in how JEI iterates through and displays potion recipes. It appears that JEI may be stopping after encountering the first registered ingredient for a particular potion type, rather than continuing to search for and display all possible ingredients. This suggests a potential flaw in the logic used to process and display potion recipe information.
This bug also highlights the importance of thorough testing and quality assurance in mod development. While JEI is a widely used and highly regarded mod, bugs can still occur, especially when dealing with complex interactions between multiple mods. Reporting and addressing these bugs is crucial for maintaining the overall quality and usability of the modded Minecraft ecosystem.
Extra Notes
This bug was observed in both 19.21.0.247
and 19.21.2.313
versions of JEI on NeoForge. This indicates that the bug is not a recent regression but has been present across multiple versions of the mod. Providing this information helps developers narrow down the timeframe in which the bug was introduced and potentially identify the problematic code changes.
Importance of Version Information
The inclusion of specific JEI versions in the bug report is crucial for effective troubleshooting. By knowing that the bug exists in both 19.21.0.247
and 19.21.2.313
, developers can focus their efforts on code that is common to these versions. This can save time and resources by eliminating the need to investigate changes that were introduced in later versions.
Furthermore, the mention of NeoForge as the mod loader is also important. Mod loaders like NeoForge and Fabric can sometimes have subtle differences in how they handle mod interactions, so knowing the specific mod loader in use can help developers identify potential compatibility issues.
Providing detailed version information, including the mod version and the mod loader, is a best practice when reporting bugs in modded Minecraft. This information significantly aids developers in understanding the context of the bug and finding a solution.
Latest Log
The latest.log
file, which contains detailed information about the Minecraft client's activity, has been provided as a valuable resource for debugging. The log file can be accessed at this link: https://gist.github.com/voidsong-dragonfly/a653d59384638563374fc91cf514e9b4.
Leveraging the Log File for Debugging
The latest.log
file is a treasure trove of information for developers trying to diagnose bugs. It contains a chronological record of events that occurred during the Minecraft client's session, including mod loading, recipe registration, and any errors or warnings that were encountered. By analyzing the log file, developers can gain insights into the state of the game at the time the bug occurred and potentially pinpoint the source of the problem.
In this case, the log file may contain clues about how JEI is handling potion recipes and why it is only displaying one ingredient. It may reveal errors related to recipe registration, ingredient processing, or the display of recipe information in the JEI interface. Developers can use the log file to trace the execution flow of the relevant code and identify any unexpected behavior.
The provision of the latest.log
file demonstrates a commitment to thorough bug reporting and significantly increases the chances of the bug being resolved quickly and effectively. It is a crucial resource for developers and should always be included when reporting complex bugs in modded Minecraft.
Conclusion
This bug report highlights a significant issue in JEI's handling of potion recipes, where alternative ingredients are not displayed, potentially hindering player experience. By providing detailed steps to reproduce the bug, outlining the expected and actual behavior, and including relevant information such as the latest log file and JEI versions, this report aims to assist developers in efficiently identifying and resolving the issue. Addressing this bug will enhance JEI's accuracy and ensure a more complete and informative crafting experience for players within the modded Minecraft ecosystem. The accurate display of all crafting options is essential for JEI's role as a comprehensive resource, and resolving this bug will contribute to the overall quality and usability of the mod.
In summary, this article serves as a comprehensive bug report and a valuable resource for developers seeking to address the potion recipe display issue in JEI. The detailed information provided, including reproduction steps, expected and actual behavior analysis, and the inclusion of the latest.log
file, significantly aids in the debugging process. By addressing this bug, the JEI mod will provide a more accurate and complete representation of crafting possibilities, ultimately enhancing the player experience in modded Minecraft.