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

feat: dynamically configure slot counts for Industrial Agglomeration … #77

Open
wants to merge 1 commit into
base: 1.19.x
Choose a base branch
from

Conversation

XzZZzX02
Copy link

Hi, there, excellent work!
I've been playing some modpacks and find out some custom recipes of Terrestrial Agglomeration Plate require more than three types of input items, while Industrial Agglomeration Factory only has 3 input slots, which is a bit of inconvenient, so I made some modifications to the code to enable changes to the number of input slots. Following is the detailed PR content. Additionally, since I am not very familiar with GUI rendering and drawing operations, I did not make corresponding modifications to the GUI. Considering that multi-slot usage scenarios are mostly related to automation integrated with AE, modifying the GUI might not be particularly important.

This pull request includes several changes to the ContainerMenuIndustrialAgglomerationFactory and BlockEntityIndustrialAgglomerationFactory classes, mainly focusing on making the slot count configurable via LibXServerConfig. The changes also involve updating the slot handling logic to accommodate the new configurable slot counts.

Configuration Updates:

Slot Handling Updates:

Import Statements:

…Factory

Added SlotCount configuration group in LibXServerConfig to allow dynamic configuration of input and output slot counts via config file.
@MelanX
Copy link
Collaborator

MelanX commented Jan 19, 2025

Hey, thank you for taking your time to open this pull request! I have some minor adjustments.

  1. You don't need inputSlotCount, iterate over the actual value (from the config)
  2. I think it would be better to dynamically calculate how many input slots are required. Something like this would help (I hope that also works with recipes only present on server and sent to client):
private static int getInputSlotCount(Level level) {
    List<TerrestrialAgglomerationRecipe> terraRecipes = level.getRecipeManager().getAllRecipesFor(BotaniaRecipeTypes.TERRA_PLATE_TYPE);
    int maxInput = 3;
    for (TerrestrialAgglomerationRecipe recipe : terraRecipes) {
        if (recipe.getIngredients().size() > maxInput) {
            maxInput = recipe.getIngredients().size();
        }
    }

    return maxInput;
}
  1. Minimum input slot count should remain 3 (but shouldn't be necessary/already handles it with calculation)
  2. Instead of adding way too many rows, make the rows wider. Just hardcode the first three input slots and add more slots as required in a good layout. For some inspiration, take a look at org.moddingx.libx.menu.GenericMenu.layoutSlots. Also move the inventory slots down for each row you're adding.

After writing this list, I think it's not minor, sorry :)

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.

2 participants