GTM+Kubejs Demon Reform Test [KJS] Kubejs Minecraft Game

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

Since the author is the first time I tried magic changes and shared the experience with players with ideas to change GTM, there are inevitable errors, and I hope that the understanding of the ax is positive.

Mainly refer to the official document https://github.com/drackion/gregtechceu 1.19/wiki/kubejsser

Recipe type (recipe_type)

As we all know, Kubejs adds formulas to know the formula of the synthetic formula. In the 1.20 version of Minecraft, the version of 1.0.13.A, the version of the KUBEJS environment of 2001.6.3-build.52, enter/kubejs export in the game to export the game.All registered formula types, in the recipe_type under the main directory/local/kubejs/export/registries, can be seen that the main involved in GTCEU is: (translated later)

 "gtceu: steam_boiler": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",

"Gtceu: Electric_furnace": "Com.gregtechceu.gtceu.API.Rcipe.gtRcipeType",

"gtceu: alloy_smelter": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"gtceu: arc_furnace": "com.gregtechceu.gtceu.api.old.gtRecipeType",,

"gtceu: assembler": "com.gregtechceu.gtceu.api.Rcipe.gtRcipeType",

"gtceu: autocLlave": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: bender": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: brewery": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"Gtceu: MACERATOR": "Com.gregtechceu.gtceu.API.Rcipe.gtRespe",

"Gtceu: Canner": "Com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: center": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: chemical_bath": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",

"gtceu: chemical_reactor": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",

"GTCEU: Compress": "Com.gregtechceu.gtceu.API.Rcipe.gtRecipedype", "Gtceu: Cutter": "com.gregtechceu.api.oldrecipeType"

"gtceu: distillery": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: Electrolyzer": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"Gtceu: Electromagnetic_separators": "Com.gregtechceu.gtceu.api.Rcipe.gtRcipeType",, ",", ",

"gtceu: extractor": "com.gregtechceu.gtceu.api.Rcipe.gtRcipeType",

"Gtceu: Extruder": "Com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"Gtceu: Fermenter": "Com.gregtechceu.gtceu.aPi.Rcipe.gtRecipedype",,

"Gtceu: Fluid_heater": "Com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"Gtceu: Fluid_Solidifier": "Com.gregtechceu.gtceu.API.Rcipe.gtRecipeype",

"gtceu: forge_hammer": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",

"gtceu: forming_press": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",

"gtceu: lathe": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",,

"gtceu: mixer": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",,

"gtceu: oure_washer": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: packer": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",,

"gtceu: polarizer": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: laser_engraver": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",, ",,",,,,,,,,,,, to ",

"gtceu: siter": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType", "gtceu: thermal_centrife": "com.gregtechceu.aPi.old.gtRes PE ",

"gtceu: wiremilll": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"gtceu: circuit_assembler": "com.gregtechceu.gtceu.api.Rcipe.gtRcipeType",, ",", ",

"GAS_COLLECTOR": "Com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",

"gtceu: rock_breaker": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"Gtceu: Combustion_generator": "com.gregtechceu.gtceu.api.oldortrecipeType",

"gas_turbine": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",

"gtceu: steam_turbine": "com.gregtechceu.gtceu.api.recipe.gtRecipedype",

"gtceu: Plasma_genrator": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"gtceu: large_boiler": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"gtceu: coke_oven": "com.gregtechceu.gtceu.api.old.gtRcipeType",,

"gtceu: primitive_blast_furnace": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",, ",", ",", ",

"Gtceu: Electric_blast_furnace": "Com.gregtechceu.gtceu.api.oldRcipe.gtRcipeType", // Power blast furnace

"gtceu: distillation_tower": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",

"gtceu: pyrolySe_oven": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",

"gtceu: cracker": "com.gregtechceu.gtceu.api.Rcipe.gtRecipedype",,

"Gtceu: Implosion_compressor": "Com.gregtechceu.gtceu.api.Rcipe.gtrec", "gtceu: vacuum_freezer": "com.gregtechceu.aPi.old.gtr ecipetype ",

"gtceu: assembly_line": "com.gregtechceu.gtceu.api.recipe.gtRecipeType",

"gtceu: large_chemical_reactor": "com.gregtechceu.gtceu.api.Rcipe.gtRcipeType",

"gtceu: fusion_reactor": "com.gregtechceu.gtceu.api.Rcipe.gtRecipeType",

"gtceu: alloy_blast_smelter": "com.gregtechceu.gtceu.api.recipe.gtRecipeype",,

"Gtceu: Create_mixer": "Com.gregtechceu.gtceu.API.Rcipe.gtRecipeType"

We mainly remember: the key value in front can

Add formula (recipe_type)

Kubejs's added formula is the server script (when/regoad can be reloaded). When adding the GTCEU formula, first create any JS file under the main directory/kubejs/server_scripts, such as test.js, and then edit it in it.

First write the framework of the server script

<<<<<<] = "assh: none;">> serverersion

})

We then edited in the brackets, and the code format of the formula is as follows

 Event.recipes.gtceu. Formula type ('ID')

.Iteminputs ('Item ID', 'Item ID', ....)

.ItemoutPuts ('Item ID')

.Duration (time)

.Eut (power)

Among them, the formula type must be replaced with the corresponding formula type above. Pay special attention to replace the colon (:) to point (.) For example, the form of the formula of the power blast furnace should be replaced by Gtceu.electric_blast_furnace

The meaning of the subsequent members is mainly::

iteminputs: Enter items, fill in the item ID, write as many items in the input, separate it with a comma, the item ID is used for a single quotation box (you can use JEI to view the ID-F3+h), or you can use it or you can use it, or you can use it or use it./kubejs hand viewing the item ID (including NBT)

The format of multiple items, add a quantity X (lowercase English letters) before the ID ID, such as two soil '2x mincraft: dirt'itemoutputs: output items, fill in the format as above, the format is the same as above

duration: The time required for the formula execution (fill in an integer, use tick as the unit, 1s = 20tick)

EUT: Energy -consuming power, fill in an integer, the unit is EU/T, (combined with Duration members determine the total energy consumption of a formula)

In addition, there are some parameters:

Inputfluids: fluid input, the format is: inputfluids (FLUID.OF ('fluid ID1', quantity), FLUID.OF ('fluid ID2', quantity), ...), the query method of fluid ID is the same as the item (it is recommended to use Jei using Jei, Not in the hand -maybe it may be a barrel), the number is the integer in MB as the unit

outputfluids: fluid output, the format is: outputfluids

InputStress: No explanation, no examples of use, if there are new discoveries, add replenishment

RPM: The parameters of the mechanical power linked block (such as the power mixer), the format is RPM (speed), the speed is filled in the integer

CHANCEDOUTPUT: Probability product (such as grinding production and production), the format is: CHANCEDOUTPUT (item.of ('item ID', quantity), probability, increase probability gain)

The probability unit is one in 10,000, and the probability gain of the boost, that is, the probability bonus given by the voltage of the level of 1, which is also the unit of one thousandth, for example

CHANCEDOUTPUT (item.of ('Minecraft: DIRT', 1), 5000, 500)

Multiple items may be performed through multiple .ChanceDoutPut, waiting to be tested

CIRCUIT: Add a programming circuit board required by the formula, the format is Circuit (circuit board ID), fill in the integer

Example analysis (recipe_type)

GTM 1.20 version 1.0.13 There is a recipe bug of a power blast furnace, that is, single crystal silicon silicon with single crystal silicon and phosphorus doped. Because the upper and lower formulas contain silicon powder and small arsenic (and 32: 1)As a result, the power blast furnace preferentially identifies the general single crystal silicon formula and cannot synthesize single crystal silicon. According to the author, there was originally a No. 2 programming circuit in the formula.In this way, the formula is available without affecting the general cost.

<<<<<<] = "assh: none;">> serverersion

Event.remove ({output: 'gtceu: Phosphorus_boule'})

Event.recipes.gtceu.electric_blast_furnace ('rainsfield_new_pboule_recipe'))

.Iteminputs ('64x gtceu: Silicon_INGOT', '8X GTCEU: Phosphorus_dust', '2x gtceu: gallium_aresenide_small_dust')

.ItemoutPuts ('gtceu: Phosphorus_boule')

.Inputfluids (FLUID.OF ('Gtceu: nitrogen', 8000))

.Duration (12000) .eut (480)

})

Among them, the second behavior deletes the original formula. The matching method is to directly delete all the formulas of making phosphorus doped single crystal silicon. Because the item has only this synthetic method, there is no problem.

After typing/RELOAD in the game, it really succeeded, but it seems that GTM does not give a temperature modification method, resulting in this formula does not require temperature

It is worth noting that if the .circuit (2) found that it is still not effective (no programming circuit is displayed in the jei, and the phosphorus doping formula cannot be performed), it can be considered as transplantation problem

We put the corresponding items into the blast furnace and found that it was unable to execute. After the investigation, the temperature was 0K. The logic inside the code may consider the 0K formula to be executed. How to set the temperature of the formula?The official document does not give a function, we need to find it ourselves. At this time, you can use Probejs. For specific operations

After installing Probejs, Kubejs, and GTCEU, after entering the archive and DUMP, open VSCODE for editing, and you will find that VSCODE uses files generated by Probejs to detect internal member functions.Point (.), Will start Lenovo related member functions (or method method),

We look for one by one (or type possible keywords such as TEMP), and find that the method of BlastfurnanceTemp (also displayed in the screenshot above) is the function of setting the formula temperature. We use it to set it. The final code is as follows as follows.

<<<<<<] = "assh: none;">> serverersion

Event.recipes.gtceu.electric_blast_furnace ('rainsfield_new_pboule_recipe'))

.Iteminputs ('64x gtceu: Silicon_INGOT', '8X GTCEU: Phosphorus_dust', '2x gtceu: gallium_aresenide_small_dust')

.ItemoutPuts ('gtceu: Phosphorus_boule')

.Duration (12000)

.Eut (480)

.BlastfurnaceTemp (2500)

})

At this time, RELOAD can run the formula

The remaining additives, mineral production, and custom multi -blocks are waiting for supplement (recently I don’t have time)