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

Add (partial?) Advanced Rocketry compatibility #189

Merged
merged 10 commits into from
Aug 31, 2024

Conversation

Wizzerinus
Copy link
Contributor

So there are 2 main parts with Advanced Rocketry one might want to do through GrS: adding recipes to processing machines, and adding planets. I've checked the code for XML planet loading and it's so deranged I don't want to read through it (no joke the main method is like 400 lines - see here ) so I decided against it for the time being, so only machines are supported right now

AR has a fork, I've tested all my changes against the fork, they do work properly

Machines supported: Centrifuge, ChemicalReactor, Crystallizer, CuttingMachine, ElectricArcFurnace, Electrolyser, Lathe, PrecisionAssembler, PrecisionLaserEtcher, RollingMachine

Machines NOT supported: piston push (since GrS already includes builtin compat for In-World Crafting)

@Wizzerinus
Copy link
Contributor Author

Wizzerinus commented Jul 11, 2024

This should be all of fixes, except Piston Push is not yet implemented. I'll do that later.

@Wizzerinus
Copy link
Contributor Author

Small Plate Presser implemented, also did some class restructure to make it easier

@WaitingIdly WaitingIdly added the mod compat Relating to compatability with a mod or features of a mod label Jul 11, 2024
@Wizzerinus
Copy link
Contributor Author

anything else needed here?

@Wizzerinus
Copy link
Contributor Author

ok these should be all PR adjustments

RecipesMachine registry = RecipesMachine.getInstance();
List<IRecipe> recipes = registry.getRecipes(clazz);
if (recipes == null) {
recipes = new LinkedList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a linked list? Most of the time array list is bettere.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same code as Advanced Rocketry uses to init its recipe lists, so yeah im pretty sure it does.

        List<IRecipe> recipes = this.getRecipes(clazz);
        if (recipes == null) {
            recipes = new LinkedList();
            this.recipeList.put(clazz, recipes);
        }

Map<Integer, String> oredicts = new HashMap<>();
for (int i = 0; i < input.size(); i++) {
IIngredient in = input.get(i);
inputs.add(Arrays.stream(in.getMatchingStacks()).collect(Collectors.toList()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrays.asList()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna look at these collectors.toList() uses and fix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@brachy84 brachy84 merged commit 9705f37 into CleanroomMC:master Aug 31, 2024
@Wizzerinus Wizzerinus deleted the compat/advancedrocketry branch September 4, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod compat Relating to compatability with a mod or features of a mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants