How to add Maceration Recipes and Control output numbers?

  • I have busy creating a mod that adds a number of functions that will eventually have IC2 integration, I am starting by allowing the metals to be macerated into dust and then smelted. I found that the following code should for example allow Tungsten to be grinded down to dust, however, I don't know if thats correct, or how to control how much dust is outputted. I want macerating the ingot to only give 1 dust to keep it exploit free. Also, the rest of my mod currently uses ModLoader. Will that be fine? I want to port it to Forge, but its a time consuming process that I hope I don't need to do.


    addMaceratorRecipe (ItemStack input, ItemStack output)


    In a currently unadded part of the mod, is it possible to have certain armor or items allow you to take no damage from tesla coils or lightning?

  • part of itemstack is stack size, just set it to 1 and 1 or w.e.
    I know that fml and ml don't play together, not sure if ml is similar enough to fml for it to work without significant code change
    if you need help, drop me a pm, I'd love to help ^^


    not sure if the last thing can be done without editing tesla coils + lightning, but then again, I haven't looked into it

  • I'm no coding expert (really I'm a noob), but I think it MAY be possible for the armor, when it receives damage, to check the damage source before doing the damage calculations. If it finds that the damage source is lightning, increase protection to complete nullify damage.

  • Ok, thanks for the help. So the following code is what the macerator recipe should look like correct? addMaceratorRecipe (mod_weaponizedmetals.oreTungsten, mod_weaponizedmetals.dustTungsten 2)
    I will try it tommorrow, if all goes well I will have a beta version out with world gen. One of the main features is that it adds nikolite and tungsten to world gen for 1.32, allowing people to collect that stuff before RP2 is released.

  • no, more like this

    Code
    ItemStack stack1 = mod_weaponizedmetals.oreTungsten.copy();
    stack1.stacksize = 1;
    ItemStack stack2 = mod_weaponizedmetals.dustTungsten.copy();
    stack1.stacksize = 2;
    addMacerationRecipe(stack1, stack2);


    thats assuming your ore and dust is an itemstack like ic2,
    if not, fix as appropriate

  • Ok, so its actually 4 individual lines? Thanks for the help. Time to get down to business.


    Just so I can can come back for a refresher:



    Line 1 tells the recipe its input
    Line 2 tells the recipe how many inputs are needed
    Line 3 tells the recipe its output
    Line 4 tells the recipe how many outputs are given


    Edit: This might take more than 1 day, I have decided Forge is worth it in the end, I don't want to have to distribute a server and client package, just 1 clean bundle. Plus with Forge I can make less base edits.