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

fix slot grid when the amount of slots is a prime number #195

Merged
merged 2 commits into from
Oct 22, 2021

Conversation

PrototypeTrousers
Copy link
Contributor

What:
This PR solves the issue of determineSlotsGrid not taking into account that some numbers are not perfect squares or multiples of 2,3 , like prime numbers

How solved:
if the amount of input slots is not a perfect square, we raise the amount of slots to the left, if the total amount slots is still not enough we increase the amount of the bottom ( we grow the grid to the next perfect square root)

Outcome:
Returns a grid with appropriate slots for inputs with size 5,7,11.. etc

Possible compatibility issue:
None

@ALongStringOfNumbers
Copy link
Contributor

Crash when opening the JEI page for the LCR https://pastebin.com/Yu3zatQ4

@PrototypeTrousers
Copy link
Contributor Author

Looks like i missed what was the return expected.
The function does return a valid 2x2 grid for a 3 slots inputs, but the expected result is actually a 3x1 grid. will refactor with that in mind

special case for 3 items, for aesthetic purposes.
@TechLord22 TechLord22 merged commit ab47807 into GregTechCEu:master Oct 22, 2021
@PrototypeTrousers PrototypeTrousers deleted the slotsGrid-Fix branch October 28, 2021 12:31
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.

4 participants