Skip to content

Overall improvements and possible compatabilities#299

Open
semenishchev wants to merge 22 commits intoPetrolpark-Mods:1.20.1from
semenishchev:1.20.1
Open

Overall improvements and possible compatabilities#299
semenishchev wants to merge 22 commits intoPetrolpark-Mods:1.20.1from
semenishchev:1.20.1

Conversation

@semenishchev
Copy link

After dancing with the mods a bit, I'm thinking that this compatibility is the most important one. This is only initial compatibility, I will expand this in the future.

#288

@semenishchev
Copy link
Author

Right now this can't be merged since it exposes whole crafttweaker mod, thus making mod not-runnable for the people who don't have it installed

@semenishchev semenishchev changed the title CraftTweaker compatibility Overall improvements and possible compatabilities Feb 19, 2024
@semenishchev
Copy link
Author

semenishchev commented Feb 20, 2024

Since this commit ZenScripts such as these are working

import mods.destroy.Reactions;
import mods.destroy.Molecules;

val mbte = Molecules.create("mbte")
    .formula("destroy:linear:O(C(C)(C)C)C")
    .boilingPoint(55.2)
    .build();
Reactions.create("test")
    .addReactant(<molecule:destroy:phenylacetone>, 1)
    .addReactant(<molecule:destroy:methylamine>, 1)
    .addReactant(mbte, 1)
    .addProduct(<molecule:destroy:water>)
    .build();

For now I need to add localisation support to the customly made molecules and reactions. And then add destroy recipes of distillation, electrolysis, aging, centrifugation, charging and obliteration.
This will include support of customising the mixtures in the recipes as well.

@semenishchev
Copy link
Author

semenishchev commented Feb 20, 2024

I got it working.

https://youtu.be/5jzG_4Y9q0M
The way I got translations is through OpenLoader mod and adding the resource pack with assets of craftweaker there
Снимок экрана 2024-02-20 в 19 26 20

Also removed redudant code in the original recipe classes
More collection optimisations
Fixed recipe string dumps
Implemented AgingRecipeManager
@petrolpark
Copy link
Collaborator

Nice stuff, thank you! I am thinking of readjusting how Elements/Molecules/Reactions are registered (maybe to use events, something similar to how JEI does its compat), but it shouldn't be too different from the current system. I'll probably merge this once the rest of 1.0 is finished, and given it a more thorough check-through. I also appreciate you fixing the messiness of my Map loops, from basically when I was first learning Java. Thanks again!

@semenishchev
Copy link
Author

In the latest commit I've added methods such as
Molecule.registerMolecule(molecule);
Molecule.unregisterMolecule(molecule);
and
Reaction.registerReaction(reaction);
Reaction.unregisteReaction(reaction);.

So these are being called by CraftTweaker scripts, so the only thing that matters that these methods do what they should to do (register/unregister).

@semenishchev
Copy link
Author

Someone who translated it to Russian isn't native speaker. It has countless spelling and grammar mistakes

@semenishchev
Copy link
Author

my minecraft IGN is pcpx btw

@semenishchev
Copy link
Author

I made compatibility with Mixers and all of that stuff.

Mixtures.createMoleculeFluidIngredient(molecule, concentration, amount);
Mixtures.createSaltFluidIngredient(cation, anion, concentration, amount);
Mixtures.createIonFluidIngredient(concentration, amount);

Also it fully exposes reaction builder and its utils such as reaction result, so you can create all complex reactions and recipe from CraftTweaker

@petrolpark petrolpark mentioned this pull request Mar 2, 2024
@petrolpark petrolpark added 💭 Suggestion New features to improve Destroy 🤝 Compatibility Bugs and suggestions related to compatibility with other mods labels May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤝 Compatibility Bugs and suggestions related to compatibility with other mods 💭 Suggestion New features to improve Destroy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments