Use CRT to inject formulas to Gaia condensate board and magic power (only 1.12.2) [CRT] CRAFTTWEAKER MINECRAFT Game

This tutorial is set by the author to use the CC by-NC protocol.

Use MOD: Botanical expansion, Crafttweaker, Randomtweaker, ZU.

Gaia condensate board:

There are no tutorials in the site, so I move.

Notice!The formula will not be displayed in Jei (only the recipe can only be added with Randomtweaker)!

Imported package

 Import Mods.botanicadds.gaiaplate; 

Add formula

 gaiaplate.add (IItemstack Output, Int Mana, IItemstack [] inputs); 

Example: Enter iron ingot, gold ingot, 114514 magic, output dirt.

 gaiaplate.add (, 114514, [, ]); 

Delete formula

Gaiaaplate.remove (Iitemstack output);

Example: Delete the synthesis of Tyra steel ingots

Gaiaaplate.remove ();

After the formula, you will find that the formula will not be displayed in Jei. At this time, you need to use Randomtweaker to write Jei. The author provides a template here.Since the formula of the Gaia condensate board is comparable, it is best to have only one item for each input when writing the formula. For exampleIf you add 2 iron ingots to synthesize a soil, there will be problems.

 Import Mods.randomtweaker.jei.ijeipanel;

Import mode.randomtweaker.jei.ijeiutils;

Import mode.randomtweaker.jei.ijeirecipe;

import crafttweaker.item.iitemstack;

Import Crafttweaker.Item.INGREDIENT;

Static Created as Bool [int] = {}; // A static variable, which is convenient for subsequent query whether Ijeipanel has been created.

Function GaiaplatedeCipe (Output As IITEMSTACK, Mana as int, input as iveredient []) as void {) as void {) as void {

Val Il = Input.Length%2; // Whether the type of input item obtain an input item is a odd number or even number.

If (iSNULL (Created [IL])) {// If the current type of Ijeipanel has not yet been created.

Val gpj = jei.createjei ("gaiaplatejei" ~ IL, "Gaia condensate board"); // Create a new Ijeipanel.

Gpj.setmodid ("Botanicadds");

Gpj.seticon (); gpj.addrecipecaiEcataSTATO ();

GPJ.SetbackGround (IjeiUTILS.CREATEBACKROUND (0,0,170,130, "Randomtweaker: Textures/GUI/JEI/LMY_GAIA.PNG" "); // Set the GUI picture below.Just change the position of the path yourself.

Gpj.addslot (IJeiutils.CreateItemslot ("Output", 77, 38, FALSE, FALSE));

Gpj.addelement (Ijeiutils.createjeimanabarement (35,63, mana, 0));

Gpj.addslot (Ijeiutils.createItemslot ("block0", 77,66, true, false);

Gpj.addslot (Ijeiutils.createItemslot ("block1", 77,82, true, false));

Gpj.addslot (Ijeiutils.createItemslot ("block2", 61,90, true, false));

Gpj.addslot (Ijeiutils.createItemslot ("block3", 93,90, true, false));

Gpj.addslot (Ijeiutils.createItemslot ("Block4", 45,98, TRUE, FALSE));

Gpj.addslot (Ijeiutils.createItemslot ("block5", 77,98, true, false);

Gpj.addslot (Ijeiutils.createItemslot ("Block6", 109,98, TRUE, FALSE));

Gpj.addslot (IJeiutils.CreateItemslot ("Block7", 61,106, TRUE, FALSE));

gPJ.addSlot(IJeiUtils.createItemSlot("block8",93,106,true,false));        gPJ.addSlot(IJeiUtils.createItemSlot("block9",77,114,true,false));

Val S = iL == 0? 67: 77; // If the type of input item is even, the S assigning the value of S is 67. 77.These two values ​​are the X position of the center slot of the item input slot.

For IG4 in 0 to (s == 67? 8: 9) {// If the S value is 67, then the type of input item is even, then the maximum slot is 8 grooves.

VAR L = IG4%2; // Here, my thoughts are relatively abstract and are not easy to express.Anyway, you know he can run.

Var xa = Ig4 as float/2.0F;

While xa> = 1.0F {

XA-= 1.0F;

L+= 1;

}

If (IG4%2 == 0) {{

Gpj.addslot (IJeuitils.CreateItemslot ("Inputa" ~ Ig4, S-L*18,0, TRUE, FALSE);

} Else GPJ.Addslot (Ijeiutils.createItemslot ("Inputa" ~ Ig4, S+L*18,0, TRUE, FALSE));});}

Gpj.register ();

Created [IL] = TRUE; // The Ijeipanel of the type of item has been created.

}

Val gp = jei.createjeirecipe ("gaiaplatejei" ~ IL);

Gp.addelement (IJEIUTILS.CREATEFONTINFOEMENT

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

Gp.addinput ();

For IG4 in Input {

Gp.addinput (IG4);

}

Gp.addoutput (output);

Gp.build ();

Var it = [] as [IItemstack];

For II in Input {

It+= ii.itemarray [0];}

Mods.botanicadds.gaiaPlate.add (output, mana, it);

}

This is a GUI picture, just put it in the corresponding GUI picture location.

As mentioned above, because the application of the Gaia condensed board, there is only one input item.

Example: Enter 1 gold ingot, 1 iron ingot and 10,000 magic, output 1 soil

 GaiaplateRecipe (, 10000, [, ]); 

Effect map:

Finally, thank the group friends MC_EDWIN's inspiration

Magic injection:

When writing magic rectification, when I renovated, I suddenly found that the API provided by the Plant Magic created magic injection formula can actually specify the catalyst block, but the MOT is not open. Just ZU can use the ZS to access the Java class, so I want to use the ZU to come to use the ZUWrite one.If you use it, please see https://github.com/friendlyhj/zenutils/wiki/nativeMethodAccess.

 Import Native.net.minecraft.itemstack;

Import native.net.minecraft.block.State.iblockState;

Import native.vazkii.botania.api.botaniaapi;

import crafttweaker.item.iitemstack;

ZenClass ManainFusionr {// Create a new ZenClass to write a formula.

ZenConStructor (Output As IitemStack, Input As IItemstack, Mana as int, Catalyst as Iitemstack) {

Val O = OUTPUT as itemstack; // Convert IItemstack to Itemstack, otherwise people do not recognize this.

Val I = Input as itemstack;

Val C = Catalyst.asblock (). Definition.getStateFrommeta (calyst.damage) as iBlockState; // Obtain the blockState of the catalyst and convert to MC's iBlockState.

Val R = Botaniaapi.registerManAINFUSIONFUSIONRCipe (O, I, Mana); // Create a formula directly with the BOT API.

R.setcatalyst (c); // Set the catalyst as the corresponding square.

}

}

Example: Enter a magic diamond and 1000 magic, output a diamond, set the catalyst block as the magic Tara steel block.

 ManainFusionr (, , 1000, ); 
renderings: