Part.3.2 Formula adapter -modular machinery from entry to the soil [Mmce] modular mechanical: community version

This tutorial is set by the author's setting without permission.

Modular machine: community version from entry to the soil -part.3.2 Formula adapter

This tutorial is guided by guiding modular machinery and modular machinery: the community version of the beginner entry. This tutorial contains the basic use and advanced application of the formula adapter in the Crafttweaker.

The main modules used in this tutorial are modular machinery: community version -1.11.1 -R33, Crafttweaker.

Note: The content of this tutorial may change at any time. Please carefully compare the module version used in this tutorial, so as not to cause module updates to cause inexplicable error problems.

Tutorial directory:

Part.1 Basic Machinery Creation

Part.2 Basic Formula Create

PART.3.1 Advanced formula application

Part 3.2 Formula adapter recipeadapter (currently)

Part.3.3 Mechanical event system (unfinished)

Part.4.1 parallel formula processing (unfinished)

Part.4.2 Factory system (unfinished)

Part.4.3 Factory event system (unfinished)

Part.4.4 Smart Data Interface (unfinished)

Part.4.5 Unilateral / multi -square mechanical upgrade (unfinished)

Part.4.6 Custom GUI information (unfinished)

Part.5 configuration file analysis (unfinished)

Environmental preparation

This tutorial is highly recommended to use Visual Studio Code (hereinafter referred to as vScode), which can greatly reduce your magic workload.

Using VSCODE, you can use its powerful functions to complete complex operations faster. At the same time, it has code prompts to greatly reduce the difficulty and error rate of code reading. At the same time, you can install plug -in to expand the function to make it stronger.

Reading this tutorial means that you are familiar with most of the advanced use of Zenscript, and you have learned about basic mechanical creation and formula creation.

Module

If you have installed Crafttweaker and modular mechanical body and the game has been started, you can skip this description.

To create a formula, you need to use Crafttweaker (any version).

Foreword

In the process of creating machinery, we may want to create an upgraded version of a mechanical (such as XXX Machine MK.1, XXX Machine MK.2).

However, the formula of each machine has corresponding machinery, which causes us to create formulas for each machine, which will inevitably cause a lot of useless code and waste time.

Therefore, the recipe adapter (RecipeAdapter) has realized the functions of all the formulas of other mechanical formulas for us, and at the same time, the content of the formula can be fine -tuned during the replication process.

RecipeadapterBuilder

RecipeadapterBuilder is a class provided by MMCE to Crafttweaker, which contains all content about recipedapter.

Basic example

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("Assembler_mk2", "Assembler_mk1"). Build ()

The code above creates a formula for the formula adapter, and the BUILD () method is finally called at the end.

After running this content, the module will add all formulas named `Assembler_mk2` Machines called` Assembler_mk1`.

Formula modifier

In addition to copying all formulas, we can also add a formula modifier to the adapter.

Example:

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("Assembler_mk2", "Assembler_mk1")

.addmodifier (recipemodifierbuilder.create ("ModularMachinery: Duration", "Input", 0.5, 1, False) .addmodifier (recipemodifierbuilder.c.c RecularMachinery: Energy "," Input ", 5.0, 1, FALSE) .build ())

.Build ()

After running this content, the module will add all formulas named `Assembler_mk2` Machines called` Assembler_mk1`.

At the same time, all formulas in all formulas in the `assembler_mk2` are half of the mechanical formula of` Assembler_mk1`, and the energy consumption is 5 times that of the mechanical formula of the mechanical formula.

Input

On the two basics above, we can also add additional input to the formula.

All methods can be called like recipebuilder and recipeprimer. In other words, most methods of recipebuilder and recipeprimer can be used by recipeadapterbuilder.

Example:

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("Assembler_mk2", "Assembler_mk1")

.Addmodifier (recipemodifierbuilder.create ("ModularMachinery: Duration", "Input", 0.5, 1, False) .build ())

.Addmodifier (recipemodifierbuilder.create ("ModularMachinery: Energy", "Input", 5.0, 1, FALSE) .build ())

.Addfluidinput (*50)

.Build ()

After running this content, the module will add all formulas named `Assembler_mk2` Machines called` Assembler_mk1`.

At the same time, all formulas in all formulas in the `assembler_mk2` are half of the mechanical formula of` Assembler_mk1`, and the energy consumption is 5 times that of the mechanical formula of the mechanical formula.

In addition, on the basis of these formulas, 50MB of IC2 coolant input will be added to each formula.

Built -in module formula support

The formula adapter also supports the mechanical formula of some modules on the basis of supporting the reciprocity formula of custom machinery.

At the same time, it also supports the adder modifier and additional input.

Below will list the adapters of all supported modules (as of MMCE-R33).

furnace

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "Minecraft: Furnace"). Build ()

This adapter will add all the formulas in the furnace to the target machine.

(Advanced) is also written in a floating point number of "Experience" in the CustomData in the CustomData of the ActiveMachinerecipe (obtained through the Zengetter: ActiveRecipe) in the Customdata in the Customdata in the Customdata.

IC2 compressor

Need to install the module industry era 2.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "IC2: Te_compressor"). Build ()

This adapter adds the formula of all IC2 compressors to the target machine.

Soul 2 alloy formula

Need to install module soul 2.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "tConStruct: SMELTERY_ALLOY"). Build ()

This adapter will add alloy formulas in all the artisan soul 2 to the target machine.

Soul 2 smelting formula

Need to install module soul 2.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "tConStruct: SMELTERY_MELTING"). Build ()

This adapter will add the smelting formula in all the artisan soul 2 to the target machine.

(Advanced) is also written in a key value in the Customdata in the Customdata in the CustomData of the ActiveMachinerecipe (obtained through the formula event of the formula.

Nuclear power process: remake version

Need to install a module nuclear power process: remake.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "nuclearcraft: alloy_furnace"). Build ()

This adapter will add all nuclear power processes to the target machine: the alloy furnace formula in the remake.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "NUCLEARCRAFT: Chemical_reactor"). Build ()

This adapter will add all nuclear power processes to the target machine: the chemical reactor formula in the remake.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "NUCLEARCRAFT: Infuser"). Build ()

This adapter will add all nuclear power processes to the target: remake the fluid injection in the version.

 Import Mods.modularMachinery.Rcipeadapterbuilder;

Recipeadapterbuilder.create ("target_machine", "nuclearcraft: melter"). Build ()

This adapter will add all nuclear power processes to the target machine: the melting formula in the remake.