MoonManModding / EmergingTechnology

A Minecraft mod exploring emerging technologies
MIT License
24 stars 11 forks source link

CraftTweaker compatibilities #45

Closed kane-thornwyrd closed 4 years ago

kane-thornwyrd commented 4 years ago

Hello MoonMan,

I'm very grateful for all you have done, and since this mod provide a plethora of new machines, some things seems like they have a fancy gauntlet and are near inevitable, like the CraftTweaker support.

So, your mission, MoonMan, should you decide to accept it, will be to implement the CraftTweaker support into Emerging Technology; you can use Blu implementation as example : https://github.com/BluSunrize/ImmersiveEngineering/tree/a9c98dd956d911fb2d3f59aaea6d63340d95384d/src/main/java/blusunrize/immersiveengineering/common/util/compat/crafttweaker .

As always, should you or any of your Modding Force be caught or killed, the Secretary will disavow any knowledge of your actions. This Issue will self-destruct in case of rejection. Good luck, MoonMan.

:)

MoonManModding commented 4 years ago

Hahahaha excellent, thank you for the suggestion 😁

I will take a look at this and see if I can add it into the next release - no need for any self-destruction 💥

MoonManModding commented 4 years ago

Hello mission control,

I've added this into version 1.3.4-beta but haven't had a chance to properly test it, also because I'm not very familiar with CraftTweaker. There will be things missing but if you could let me know what you think that would be great 👍

Cheers for the suggestion!

kane-thornwyrd commented 4 years ago

I strongly suggest to allow the use of ore dicted entries for inputs, that would mean to maybe add a class that handle the Recipe input(s)/Output(s) like the CrusherRecipe Class do in IE:

public CrusherRecipe(ItemStack output, Object input, int energy)
    {
        this.output = output;
        this.input = ApiUtils.createIngredientStack(input);
        this.oreInputString = input instanceof String?(String)input: null;
        this.totalProcessEnergy = (int)Math.floor(energy*energyModifier);
        this.totalProcessTime = (int)Math.floor(50*timeModifier);

        this.inputList = Lists.newArrayList(this.input);
        this.outputList = ListUtils.fromItem(this.output);
    }

To allow the use of oredictionary entries as input :)

Here as example: https://github.com/MoonManModding/EmergingTechnology/blob/fa565b707a0cce11876e616d4333d5e2d688a43b/src/main/java/io/moonman/emergingtechnology/integration/crafttweaker/machines/Fabricator.java#L20

And the RemoveAll doesn't work, but in fact I just checked and it seems that you didn't implemented it yet. :)

MoonManModding commented 4 years ago

Yes indeed, I have been looking into the oredict bits. I think I'll need to give my recipe system a bit of an overhaul, but just wanted to get the basics out there to test. I will fully implement all the CraftTweaker commands when I get a chance 😁 Can you confirm that it works for you with the IItemStack input/outputs?

Thanks for your help!

kane-thornwyrd commented 4 years ago

Alas it didn't worked with the processor at least :/ I'll check the other machines and the log output. I would like to contribute more, like by writing code, but I have a psy condition that block me to do so, so I left the coding to you :/

MoonManModding commented 4 years ago

Hm ok, if I have some time later today I will try to test it. In the meantime I have added oredict support which will be available in the next release. The log output would be extremely useful also, and in fact could you send me an example of a CraftTweaker file you are using? I'm really not familiar with CraftTweaker so I am relying entirely on your expertise!

Also you are contributing plenty, it's a massive help to get your input and testing 🤩