Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boiler Fuel Fix and JEI Fuel Recipe Change Suggestions #2543

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

magi-guy
Copy link

@magi-guy magi-guy commented Jul 19, 2024

STILL IN PROGRESS

Overview

I noticed that boiler fuels burned for significantly less time than they should. I also noticed some problems with JEI pages, mostly regarding generators and the large steam boiler. This PR aims to fix the issues and/or provide some additional information to the player to reduce confusion.

Changes

  • Large Boilers can finally be viable with fluid fuels, as there was a bug in the code telling them to burn 100x the fluid without burning for any longer. This multiplier was commented to say that it was to reduce the amount of integer division happening, not to make Large Boilers burn more fuel. This has been fixed to properly scale the duration as well.
  • Added a separate tab for Large Boiler fuels, as they have many differences to the combustion and semi-fluid fuels they accept that are in the code but the player previously had no way of knowing.
  • For generator fuels in JEI, the "Usage:" text is properly replaced with "Generation:" (This was previously defined by the sign of the EU/t, but no recipes have a negative EU/t, and fuel recipes would break if they were set to be negative.)
  • For some recipes in which changes through voltage tiers are not reflected in JEI (eg. the rate at which fuels are consumed in combustion generators) helper text was added to the bottom of the JEI page. Feel free to change this at will; I tried to pull information from constants or configs wherever possible, but some of the data is experimental.
  • Fuel recipes have the ability to add info to their JEI pages with a dynamic line count through only the lang file, just in case translations have different lengths or a pack/addon dev wishes to add their own information.
    In Progress:
    Changed Large Boilers to have their own JEI page with information unique to boilers (eg. water and steam, half/doubled durations for combustion and dense fuels respectively) and removing the Large Boiler machines from the Combustion and Semi-Fuel tabs, all while maintaining compatibility with existing packs and addons.

Implementation Details

I ended up almost entirely reworking the Large Boiler system. BoilerRecipeLogic.java has sustained immense changes, but only to the code inside trySearchNewRecipe(); systems that use this should function as usual.
While there is now a new RecipeMap for BoilerFuels, they are simply cloned from combustion and semi-fluid fuels (as previously the recipe logic used those two). The changes to each recipe that was previously done in the recipe logic is now done in the BoilerRecipeBuilder file.
There are some edits to the following files that (while utmost care was taken to ensure continued compatibility for packs) may cause unseen issues or use methods in ways that are unintended.

  • RecipeProperty.java : Added public property getInfoLineCount() that can be overridden to tell the recipe wrapper how many lines a recipe property would add to their JEI page. Without overriding, the function accounts automatically for properties that add only one or zero lines, so no changes need to be made to existing recipe properties.
  • Recipe.java : Added public method getAdditionalLinesCount() to serve the same purpose as getHiddenPropertyCount while accounting for recipes with properties that add multiple lines to their JEI page.
  • GTRecipeWrapper.java : The "Usage:" to "Generation:" text in recipe pages was based off the sign of the EU/t. This has been replaced with the FuelProperty recipe property. Additionally, the usage of getHiddenPropertyCount() has been switched to getAdditionalLinesCount().
  • FuelRecipeBuilder : Added the FuelProperty recipe property to fuel recipes for generators; this builder was already used for all necessary recipes, so no other files should really required editing.

Screenshots

image
image
image
(In Progress: )
image

Potential Compatibility Issues

Honestly, I completely understand if this PR gets rejected simply because it goes to deep into the files, but I'm hoping the changes are worth it. I wont be offended if nothing gets accepted, don't worry!
I'm not certain that getAdditionalLinesCount() works entirely with multiple properties, especially when mixing hidden and unhidden properties. This will likely be resolved by the time I finish the branch.
I tried making it so addon devs wouldn't have to edit too much in the way of java files, but if one would like to add dynamic variables to a fuel recipe it would be a little hacky probably.

@magi-guy magi-guy changed the title JEI Fuel Recipe Change Suggestions Boiler Fuel Fix and JEI Fuel Recipe Change Suggestions Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant