Part of the GT Magic Reform Author Must-Renewal Tutorial-The first phase of the Gregtech Community Edition

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

This tutorial comes from the official Wiki document of CRT. Links here. This tutorial does not describe the basic Zenscripts grammar. Please go to the documentation of the friendly mother to read it yourself!

At the same time, it is suitable for GTCE and all his branches and reproduction versions, such as GTCEU, but I can't guarantee that they will not change the part of CRT compatibility!


GTCE & CRT

GTCE's magic reform is not the same as the original workbench, but uses the Tool of RECIPEMAP, so the writing method is different from the original modification method!

If you want to change the recipe of recipemap, you must import the package

 Import Mods.gregtech.recipe.recipemap 

machine

Need to use

 recipemap.getByname (machine name) 

To get the specified synthetic table.

You can also use assignments, such as

 Val Blast_furnace = MODS.GRegtech.Rcipe.Rcipemap.getByname ("Blast_furnace"); 

Next, you only need Blast_furnace to replace the recipemap.getByname of Blast_furnace.

Machine name

So you have to ask, what is the name of the machine?

This is the list of names given by CRT documentation

Compressor: Compressor

Extractor: Extractor

Plumber: MACERATOR

Mining plant: olwasher

Heat centrifugal machine: Thermal_centrifuge

Electric furnace: furnace

Microwave oven: Microwave

Assembly machine: Assembler

Pouring machine tool: Forming_press

Flike irrigation machine: Fluid_canner

Plasma arc furnace: Plasma_arc_furnace

Arc: ARC_FURNACE

Filter: SIFTER

Precision laser etching machine: LASER_ENGRAVER

Mixer: mixer

High pressure kettle: AutoCLAVE

Electromagnetic chosen

Polar magnetrifier: Polarizer

Chemical immersion: Chemical_bath

Brewing room: Brewer

Flow heater: FLUID_HEATER

Distilled room: distillery

Fermented slot: Fermenter

Flow curing device: Fluid_solidifier

Flow extractor: FLUID_EXTRACTOR

Centrifuge: Centrifuge

Electrolyzer

Blast furnace: Blast_furnace

Cost -explosive compressor: Implosion_compressor

Vacuum frozen: Vacuum_freezer

Chemical reactor: Chemical_reactor

Distillation tower: distillation tower

Petroleum cracking machine: cracker

Thermal solution furnace: Pyro

Wire rolling machine: wiremill

Roll board: Metal_Bender

Metal furnace: alloy_smelter

Installing machine: Canner

Line: LATHE

Board cutting machine: Cutting_Saw

Moving machine: ExtRuder

Forging hammer: Forge_hammer

Packing machine: Packer

Unblock machine: Unpacker

Diesel generator: DIESEL_GENATOR

Gas turbine: GAS_TURBINE steam turbine: Steam_turbine

Plasma generator: Plasma_genrator

Not realized yet:

UU material generator: UUAMPLIFIER

Thermal generator: thermal_genrator

Half -current generator: SEMI_FLUID_GENARTOR

Frequent reactor: fusion_reactor

Non -ordinary recipemap

The synthesis table of the soil blast furnace is different. This is an instance given by the CRT document that is used to modify the formula of Primitive Blast Furnace.

 Import Mods.gregtech.recipe.pbfrecipeBuilder; // guide package

// Primitive Blast Furnace fireproof tile blast furnace

PbfrecipeBuilder.start ()

.Input (*1) // Enter items: a dual forge iron ingot

.Output ( .firtStitem*1) // Output item: Steel ingot

.Duration (250) // Formula time, unit tick

.Fulamount (2) // Fuels?

.Buildandregister (); // Recipe registration

// Remove RECIPES from PBF Remove the synthetic table from the fire tile blast furnace

Import Mods.gregtech.Rcipe.recipeMaps;

For recipe in recipemaps.GetprimitiveBlastFurnacereCipes () {{)

Recipe.remove (); // At this time, you can use a general formula to delete

Recipemap


Let's talk about the usage of recipemap.First of all, you need a guide package, and then call the builder:

 recipemap.recipebuilder () 

Come up a RECIPEMAP with a corresponding machine.

You can use the assignment method like the beginning

 // Use the power blast furnace for example

Val blast_furnace = mods.gregtech.recipe.recipemap.getByname ("blast_furnace");

blast_furnace.RcipeBuilder () // The recipemap used here is the variable of the second line

.Inputs (*1) // Enter items: a dual forged iron ingot

.Fluidinputs ([*500]) // fluid input: 500MB oxygen (IliquIDSTACK can use CRT instructions/CT liquids to obtain. After entering this instruction

.Outputs ( .firstitem*1) // Output items: a steel ingot

.Property ("Temperature", 1000) // This is the lowest temperature for the items to be burned.

.Duration (40) // Formula Time: 40tick

.Eut (120) // Input Energy: 120Gteu/Tick

.Buildandregister (); // Construct and register formula

The .property here is a special setter. He has some special methods ("string in" "string in" ") for different machines.

Name description of the number of explosives of Explosives aggregate compressor formula.CIRCUIT can use a programmatic circuit machine to use the configuration programming circuit for formula.Tempurature blast furnace formula is used, the configuration formula starts the minimum required temperature

Those who have not been realized yet:

Name description Amplifier is used for UU increase liquid productioner, the output UU increase liquid, unit MBeu_TO_START is used for the fusion reactor, the formula of the GTEU required for the formation of the formula, the unit GTEU.

You can use them like "Temperature".

For example

. Property ("circuit", 1) // 1 represents the configuration of the programming circuit, which can be from 0 to 24

.property ("Explosives", 10) // 10 is the number of explosives that make the aggregate compressor formula

Some useable recipemapsetters (Setter under recipebuilder ())

. inputs () // The items that need to be entered

.fluidinputs () // The fluid required by the formula.

.outputs () // The items output of the formula

.fluidoutputs () // The fluid output by the formula requires IliquidStack

.chancedOutput(, 0-10000, 0-10000) (10000是100%,即最小0.01%是1) // (物品-IItemStack, 初始输出概率, 每一级输出概率提升(注意:概率这里The number needs to be converted by%)

.duration () // Formula time unit tick

.notconsumable (x) // The x here can be a CRT ID (the original text is like this, probably representing Ingredient), his role is the same as .inputs, but the input items configured by this setter will not be consumed in the formula!

.hidden () // cannot be used by default. As long as this setter is used, then this recipe will not be displayed in Jei (that is, the Just EnoGH Items module or any branch).

.propety ("PROPETY_METHOD" int) // See you

.ChancedoutPut (, 0-10000, 0-10000) (10000 is 100%, that is, the minimum 0.01%= 1) // is roughly the same as the previous .chanceoutputput, but only some machines use this statement. The most unavailable useOne category is a fan.(This is the original text, what is the specific unknown?). EUT () // Eu consumption per color

Removal machine formula

The formula to remove a machine is completed by the instance of this formula, so you need to find this synthetic table first.


For example:

 Val Compressor as recipemap = recipemap.getByname ("compressor");

// Find this formula (voltage, formula entered the items, the fluid entered by the formula, just fill in NULL)

Compressor.findRecipe (2, [], null) .Rmove ();

Material-Materials

GTCE's material system is very powerful. It uses Metaitem to register to simply and quickly register a series of items such as powder plates of ingot plates, and you only need to enter a special color code to let GTCE help you use color rendering for color renderingstencil.


Let's start!

Material-Items and Materials Registration

First of all, it is still a guide package:


 Import Mods.gregtech.material 
 Import Mods.gregtech.material 

These two bags contain all the classes and objects of Gregtech about the Material system.

All available attributes (for MateriAl registration):

The name type describes the color code of the RGB format of the new material of Colorint, and the chemical format of the new material of RGBCHEMICALFOREMUSTRING. For example, the chemical formula of water is H 2 OiconSetmaticICONSET's rendering material template collection.ComponentSimmutableList is composed of this material, which will be said to (?) GenerationFlagsrawlong.Let's talk about (?) Elementelement's composition element is probably given alloy material (?)


Let's take a look at the value device:

The name type describes whether the material is radioactive if the material is radioactive. If there is any, there is no falseProtonslong. It is probably the number of proton in the material.(?) Neutronslong was not marked in the original text, probably the number of neutron in the material.(?) Masslong was not marked in the original text, probably the quality of the material.(?) Densitylong was not marked in the original text, probably the density of the material.(?) Camelcasestringstring is not marked in the original text, probably related to the hump (?) UnlocalizedNamestringring is unknown (?) LocalizedNamestringring is probably the localization of the material, which is limited to the client.(?) Namestring material registration name, full lowercase.

Material method:

Name (parameter) describing adDFlags (String ... Flagnames) adds a generator Hasflag (the name of the String logo).

FluidMaterial fluid material registration

The fluid material is a super class of the Material, and all members are still available.


Available parameters:

The name attribute describes the original text of Fluidtemperantureint, which is probably the fluid temperature.(?)

Value device:

The name attribute describes the original text of Hasfluidbook. It is probably to determine whether the fluid is a liquid attribute. True is a liquid, otherwise FALSE.Hasplasmabool was not marked in the original text, probably to determine whether the fluid is the attribute of plasma, True is, otherwise False.IsgaseOUSBOOL was not marked in the original text, probably determining whether the fluid is the attribute of the gas, True is, otherwise FALSE.FLUIDIFLUDEFINITION material fluid.(?) IFLUIDEFINTION defines IliquidStackPlasmaifluiddefinition material plasma.(?) DustMaterial-Registration of Fan Materials

His superclass is Fluidmateril, and all members are still available.

Available parameters:


Name attribute describes the multiple of Oremultiplierint crushing ore output items in the grinding machine.(For example, enter a crushed ore, and the output is several times.) ByproductMultipliereInt crushed ore The multiples of by -products produced in the grinding machine.SMELTINGMultiplierInt items are product multiple when firing.DirectsMeltingSolidMaterIL's products obtained by burning this material.Washedlnfluidmaticial washed the fluid product obtained by the item.In the process of electromagnetic separation, the ore of this material will be separated into this material and materials specified in this field during electromagnetic separation.(?) Burntimeint The material can be fired as a fuel during the melting process, and it is not fuel if it is 0 or negative.

Value device:

The name type describes the product of the ore ore ore, which is the format.The excavation level of the block of Harvestlevelint.

SOILDMATERIAL-Solid material

His superclass is DustMaterial, and all members are still available.

Available value device:


Name attribute description HandlematerialsOildmaterial will use this material to make the handle and the handle to make this material.(?) MaceteinTodustMaterial to grind any item in this material will obtain the product, the default is itself.(?)

Getter (Getter's specific introduction, please read the documentation of friendship mom):

The name attribute describes the speed of the tool made by ToolspeEdFloat with this material. The default 1.0ftoolDurabilityInt tools are durable with this material. 0 means that this material cannot be made into a tool.TOLENCHANTMENTSList will bring its own enchantment when it is made of this tool, and it is not brought by default.

Ingotmaterial-ingot material

His superclass is somedmaterial, and all members are still available.

This part is relatively special. As a ingot material, he can make special equipment such as wires and fluid pipelines.


These attributes can be set through the Setter below:

 SetcableProperties (Long voltage level, int based on the infrastructure, INT per grid loss) // wire

SetfluidPipeProperties (int throughput, int to the maximum tolerance temperature, whether BOOLEAN can transmit gas) // fluid pipeline

An example given by CRT document:

 var Ingotmaticial = Materialregistry.createingotmatic (2052, "test", 0x1a2f3e, "ingot", 1); // Ordible

Ingotmaterial.setCableProperties (128, 4, 1); // 128eu/Tick 4A 1 line loss/square block

Attachment data

You can find SolidMaterial#Toolenchantments in Gregtech.EnchantmentData, which are internal storage with a grade enchanting.

They can use crafttweaker.enchantments.ienchantmentDefinition to convert by calling Enchantmentgetter, and Level can be obtained through the levelGetter.


To add enchantment to the tools in SoildMaterial, you only need to call the adDTOOLENCHANTMENT (INCHANTMENT ENCHANTMENT) and add the Crafttweaker enchanting data type.

 Var Material = Material Registry.get ("IRON"); // Assign and modify IRON materials

Material.addtoolelenchantment (*1); // Add a enchantment for the tools of the material, which will be attached when he synthesizes.

Flag-material generation logo

These signs are suitable for materials:

The name of the sign (not distinguished) describes the decomposition_by_electrolyzing to enable the generator to decompose the formula Decomposition_BY_CENTRIFUGINGING. It will become flammable and combustible.EXPLOSIVE adds the material to make the material a certain explosive.NO_UNIFICATION adds to make the material cannot be completely unified.(?) No_recyCling adds any items to be unable to recycle to clean.(?) Disable_Decomposition is prohibited from generating this material and all the decomposable formula Decomposition_Requires_Hydrogen to add the decomposition formula for the decomposition formula. Materials, if it is DustMaterial, The compressor formula that is compressed with powder will be generated. If it is a metal material, it will generate the formula of using the roller machine. If the block material is found, the formula of using the plate cutting machine will be generated.Generate_Dense generates a compressed plate material for this material.NO_WORKING cannot be processed in any other way except for grinding or melting, which is used for coating materials.NO_SMashing makes this material unable to use conventional metal processing methods, because such metals cannot be bent for more solid materials.NO_SMELTING makes this material unable to be burned.Induction_smeting_low_output will make this material less output in the inductive furnace.SMELTO_FLUID can make this material melt into liquid (registering liquid for this material).Exclude_block_crafting_recipes is not described, unknown.Exclude_plate_compressor_recipe is not described and unknown.Crystallisable adds this material as a crystal class.(For example, emerald and diamonds) GENERATE_FLUID_BLOCK is added to make the system produce streaming blocks for this fluid material.Generate_Lense's original text is not described, unknown.The original text of high_sifter_output is not described and unknown.Generate_plasma is added to generate the plasma of this material.STATE_GAS adds the material state marking as a gas.Generate_rod's original text was not described, probably for this material registered rod material.Generate_gear's original text was not described, probably registered gear materials for this material.Generate_long_rod's original text was not described, and it was probably registered long rod materials for this material.Mortar_grindable adds to grind this material with a mantle.


Material icon set

You need a guide package:

 Import Mods.gregtech.material. Materialiciconset 


Icon set list:

None

Metallic

Dull

Magneticquartz

Diamond

Emratd

Shiny

SHARDS

Rough

Fine

Sand

Flint

Ruby

Lapis

POWDER

Fluid

Gas

Lignite

Opal

Glass

Wood

Leaf

Gem_horizontal

Gem_vertical

Paper

NetherStar

The icon model in the specific icon set can be in the Gray module file/Assets/Gregtech/Textures/Items/Material_sets to see what icon templates are there in each folder.

The Getter of the icon set is name.

Methods include Tostring (), and static method getByname (string name).

MaterialRegister-Material Registration

The material registry is a helper to obtain, list and create materials in a unified system.


Need a guide bag

 Import Mods.gregtech.mterial. MaterialRegistry 


Example:

#loader gregtech //

Import Mods.gregtech.Material.Material Registry;

// Note that if nothing is found, the return type can be empty.

varming = materialregship.get (materialname);

// List all registered materials

varmediallist = materialRegistry.getallmatermatics ();

// If this material cannot be used as a tool, set ToolDurability to 0 to 0

// Note that the parameter of a @Optional can be omitted, and it is replaced by the default 0.

// It means that gems and steel ingot materials cannot be used as tools by default.

Materregistry.createfluidmaticial (int Meta register ID (cannot repeat!), String name, int color rgb, string icon set, @Ooption Materiralstack [] materialcomponents);

Materregistry.createDustsStMaterial (int Meta register ID, string name, int color, string icon set, intities required for int, @OoptionAl Materialstack [] materialcomponents);

Materregistry.creategemmatic (Int Meta register ID, string name, int color, string icon set, intities required for intities, @optional materstack [] materialcomponents, @Optional Fl oat tool speed, @Optional INT tools durable);

Materregistry.createingotmaterial (int Meta registered ID, string name, int color, string icon set, intities required for mining, @Optional Materialsstack OAT tool speed, @Optional INT tools durable, @Optional INT blast furnace furnace furnaceThe temperature required for such materials);

The final overall example:

#loader gregtech //

Import Mods.gregtech.Material.Material Registry;

// Create a gem material that shows chemical formula.

// This will automatically generate an electrolytic formula to electrize the component of this material.

Val DustMaterial = MaterialRegistry.CreateDustMaterial (700, "test", 0xffaa33, "dull", 2); 2); 2); 2); 2); 2); 2); 2); 2); 2);

dustmaterial.addflags (["Generate_ore", "Generate_plate"];

Then, then

Val Gemfancy = MaterialRegistry.creategemmatic (701, "SOME_FANCY_GEMSTONE", 0x0F3E4E2, "Gem_horizontal", 1, [*4, *2, *9, *2], 1.0, 0);

// You can use any previously registered materials-including custom materials and GTCE materials.

Val IngotComplex = MaterialRegistry.Createingotmatic (702, "Complex_alloloy", 0xF6872E, "SHINY", 1, [Material: Copper>*3, *1, *9, *2], 3.5, 0);

At this point, the material part is over.

Devtech extension

Now let's try Devtech. First of all, you have to add a Devtech module to download according to your current GTCE version, such as GTCE download version 1.0.0 below, GTCEU download 1.0.0 and above versions.

Devtech-recipemap

I encountered the old friend we are familiar with, recipemap. This time it is an extension added by Devtech, which adds more powerful features to the recipemap.

First of all, it is a guide package:


 Import Mods.devtech.irecipeMap; 

Then you can start using it, first look at his custom recipeMapbuilder function


Official examples:

 IRCipemap.RcipeMapbuilder (string name)

.MinPuts (INT minimum input)

.Maxinputs (INT maximum input)

.Minoutputs (INT minimum output)

.Maxoutputs (INT maximum output)

.MinFLUIDINPUTS (INT minimum fluid input, unit mb)

.Maxfluidinputs (INT maximum fluid input)

.MinFLUIDOUTPUTS (INT minimum fluid output)

.MaxfluidoutPuts (INT maximum fluid output)

.SetOverlaysLots (overlayslots as overlayslots ...) // The meaning of the rendering slot here is

.Setprogressbar (texture as texturearea, moveType as moveType) //

.Build ();

In addition to ordinary recipeMapbuilder, you can also use it

IntciRCUITRECIPEBUILDER and .buildcircuit ();

BlastRecipeBuilder and .buildblast ();

As for the specific use, it needs to be used in recipemap. This is the recipeMapbuilder. He only applies to providing a slot and a recipemap template for the machine.

IRM's other parts

Next, let's take a look at the rendering grooves OverlaySlot and Texturearea and MoveType. These parts of the official wiki did not mention that at first I thought it was not the official. In fact, I did not update Wiki.I found that this part has been written by finding the source code.

First look at the source code

Introduction package:

 Import Mods.devtech.texturearea;

Import mods.devtech.moveType;


Import Mods.Devtech.overlaysLot;

Import mods.devtech.guitextures;

First take a look at MoveType

The source code gives three moveType, which are:

 vertical

Horizontal is horizontal

Vertical_inverted is vertically inverted

The guess is the rendering direction of GUI.

GUI needs a Texturearea, which has three methods, one is that the existing GUI is directly moved over.

Use the following methods:

 IOverlaysLots.newoverlayslot (Boolean Isoutput, Boolean Isfluid, Constantguitexture Texture) 

The two previous options can be adjusted according to their own needs, while Constantguitexture requires another package.

We first write a assignment, indicating that Guitexture from this package:

 Val GUI = Idttexturearea.get (String name) 

At this time, the correspondence of String in the GUI will be returned. This is the GUI list. Find the @zenproperty in the file in the file. The series behind the space behind is his String name, until the bracket.I won't guess each of the specific corresponding to each GUI, and I don't have time to try one by one.

Devtech -Overlay

This chapter will tell the part of Overlay in the Overlay in the recipeMapbuilder.

It should be noted that this OverLay is a material rendering material outside the machine, not the OverlaySlot inside the machine.

Need to import packages, to import according to your needs:

 Import Mods.devtech.overlay; // Non -customized materials

Import Mods.Devtech.overLayRenderr; // Customized material guidance package, not perfect

Import Mods.Devtech.overlayFace; // Customized material rendering surface


A available Getter:

 Overlays.get (string as name); 

Costantoverlay

Official OverlayName list, which is the machine material of GTCE's own machine:

Coal_Boiler

lava_boiler

solar_boiler

Primitive_blast_furnace

coke_oven


Alloy_smelter

furnace

Electric_furnace

extractor

compressor

hammer

Macerator

amplifab

arc_furnace

assembler

autoclave

bender

brewery

canner

center

chemical_bath

chemical_reactor

cutter

distillery

Electrolyzer

Electromagnetic_separators

extruder

Fermenter

Fluid_canner

FLUID_EXTRACTOR

FLUID_HEATER

Fluid_solidifier

Forge_hammer

Forming_press

lathe

Microwave

mixer

ol_washer

packer

unpacker

Plasma_arc_furnace

polarizer

Laser_engraver

sifter

thermal_centrifuge

wiremill

Diesel_genrator

Gas_turbine

steam_turbine

An example:

 value = overlays.get ("Steam_turbine"); 

Still assignment.

Customoverlay

Note that this part of the custom is not perfect.

 Overlayrenderer.newoverLay (String path, FirstFace as overlayFace, SecondFace as overlayface) 

The path requires a module or material package that can load Textures, such as Resources Loader.

Overlayface is a new type, including:

Front = Previous

Back = Top = top surface


Bottom = bottom

Side = side

An example given by the official:

#loader gregtech

Import mods.devtech.overlayrenderr;

Import Mods.Devtech.overlayFace;

Import Mods.Devtech.machits.registerMachine;

Import Mods.gregtech.Rcipe.recipeMaps;

var textures = Overlayrenderer.newoverlay ("Machines/Thingy", overlayFace.front, OverlayFace.Side, OverlayFace.top);

// The you just slap that variable into the

MachineRegistermachine.createSimpleMachine (1987, "Thingy.lv", recipemaps.compressor_recipes, textures, 1);

It can be seen that this machine uses Compressor's recipemap and a newly built Newoverlay. The material path is Machines/Thingy, and then the rendering surface refers to the material rendering surface.

Then, according to this example, your material needs to be placed (as examples as examples) Resources/Gregtech/Textures/Blocks/Machines. locks/The name of the machine name of the machine below Machines.

Custom unilateral machine

Import package:

 Import Mods.Devtech.machines.registerMachine; 

Simplemachine simple machine

 registerMachine.createSimplemachine (INT machine ID, must be unique, cannot be repeated, string localized name, can be LANG Key, recipemap can be customized or the original RECIPE Map, overlayrenderer hereRenderer has not written Wiki, but the active code, incomplete, level level); // I don’t understand

RegisterMachine.createSimpleMachine (INT machine ID, string localized name, recipemap, the one on the overlays, int level);

Simplegenrator

 registermachine.createSimpleGenerator (ID as int, local as string, fuelReCipemap as fuelReCipemapmap, Overlay as overlayRender R, tier as int);


Registermachine.createSimpleGERATOR (ID as int, local as string, fuelReCipemap as fuelRecipemap, overlay as overlays, tier as int); Emap is not perfect!This SimpleGenerator is almost useless.

MACERATOR ESQUE MACHINES

Model creation method for grinding machines:


 registermachine.createMacerator (ID as int, localAp as recipemap, Overlay as inTlays, Tier as in t, int output, probably the meaning of output grid); //I won't say it 

Cheat box

 registermachine.createChest (int machine ID, string localized name, material used in solidMaterial box, int and few lines, int and several lines); 

SOILDMATERIAL, please look at the MateriAl section, but you don't have to customize the SOILDMATERIAL, you can use the original SOILDMATERIAL.

Tank-fluid storage tank

 registerMachine.createtank (int machine ID, string localized name, material used in solidMaterial sinks, INT water sink size, INT maximum vertical); 

The maximum vertical and maximum horizontal direction should refer to the maximum size of the sink, the size of the sink is the liquid capacity, and the unit MB.

Quantumchest-quantum box

 registermachine.createquantumchest

I do n’t understand why this storage volume is long, and I do n’t have time to try it.

Quantumtank-quantum cylinder

 registerMachine.createquantumtank

Why is the storage INT this time (?

FluidCollector

Fluid collector

 registerMachine.createfluidCollector (INT machine ID, string machine name, string level, iliqustack fluid, INT cyclic length, INT storage tank size); 

It seems that the original GTCE has no such machine. I can't say the specific effect.

Devtech-gtceu

When I was writing this tutorial, I found that the Devtech on Github had a fork warehouse, which is the GTCEU supporting version of Brachy84. As for the original Devtech, it has stopped.Click here to open the github page of Devtechceu.

You need to use this version, please open this link to download.

Devtechceu-new machine

This version of Devtech has made a new new machine method that can create machines, boilers, steam machines, generators, etc.Introduction package:

 Import Mods.gregtech.machine.machineBuilder;

Import Mods.gregtech.Rcipe.recipeMapbuilder;

Import Mods.gregtech.Rcipe.recipeMaps;

Import mods.gregtech.recipe.recipemap;


All new machines are based on MachineBuilder objects.

CRT's machine ID starts from 32000.

The basic name should contain any: or layer suffix, such as .lv. These will be added automatically.

The level will be added to the ID. For example, the bronze class Steam is +1, the steel -level Steam is+2, and ULV +3 ... and so on.


This means that you should keep at least 15 for each machine (if you will use MAX, 16) ID.

(I don't understand this part of writing, but anyway, it should be that if your machine is registered from bronze steam to the largest MAX voltage, you need to leave the 16 IDs from 32000 to 32016 for them.)

MachineBuilder's format

 MachineBuilder.create (int ID, string basenename) 

Some necessary setters

Set the RECIPEMAP of the machine:

 SetRcipeMap (recipemap recipemap)

.setRecipeMap (recipemaps.assembler_recipes)

The recipeMap here can be the recipemap of other machines of the original machine, or it can be a custom recipeMap, which will be mentioned below.

Set the material of the machine:

The setting here refers to the appearance material rather than the internal GUI.

There are three methods to set the external material, but he will only rendering one outer layer. The bottom material will be determined by the level, that is, the bottom layer material when the level is ULV will be ULV mechanical blocks.

Method 1:

Use the machine material given by the original GTCEU, and use the internal path of the module to determine the material.The path and material name are here.


example:

 Setrenderer (String path) // format

.setRenderer ("Machines/Assembler")

Taking the assembly machine as an example, all paths should start with Machits. You can directly decompress the CEU's file assets/Gregtech/Textures/BLOCKS/MACHINES.

Method 2:


Create a newly rendering Overlay, first import package:

 Import Mods.gregtech.machine.renderer; 

The basic format is

 SetRenderer (renderr.create ("Machines/AWESOME_MACHINE", "FRONT", "TOP", "Bottom", "Back", "SIDE") 

The material path given by the example is the sub -folder of the Machines, so you can use the Resources Loader or the material package ResourceSloader path:

Resources/Gregtech/Textures/Blocks/Machines sub -folder.

Material bag path:

ASSETS/Gregtech/Textures/Blocks/Machines sub -folder.

You can define the surface of the material, use the abbreviation f, t, bo, ba, s still effective.

Method 3: Use Multiblock Tweaker

Because the method is more difficult to write, I do n’t recommend it, I want to write myself to see the official wiki and Multiblock Tweaker wiki.

Non -optional setter

The first is the voltage level of the machine:

Add levels to the machine, unless the machine does not use voltage level.

The minimum value is 0 and ULV, and the maximum value is MAX.

There are two ways to write levels:

 addier (int ... tier) // This method requires you to list all the levels

.addtier (1, 2, 3, 4) // These represent your registered level

.addtierrange (Int Mintier, Int MaxTier) // This method requires your smallest level and maximum level

.addtierrange (1, 4) // Last registered register

Set to generator:

Maybe you need this MachineBuilder to declare a machine or generator.


. Setgenrator () // Set as an generator

.setmachine () // Set as a machine

Set the fluid storage size in the machine:

. SettankScalingFunction (Function (Tier as int) as int {

Return 4000;

}) // This is a function, he said that the fluid storage capacity of all levels of machines is 4KMB

Steam machine setter

The following method is only applicable to steam machine/steam boilers.

Set as steam machine/appearance settings:


. Addsteamtier (Boolean Highpressure)

.addsteamtier (false)

.addsteamtier (Boolean Highpressure, Boolean Bricked)

.addsteamtier (true, true)


These two setters will turn the machine into steam machines, but they have different appearances after setting. If HighPressure is True, the steam machine will be used to use steel steam machines, and the bottom layer of the steel machine will be rendered into a steel shell into a steel shell.EssenceIf the Bricked is also true, then the bottom -up rendering of the machine will become a brick shell.

If both are FALSE, only machines that use ordinary bronze shells will be enabled.

Steam machine progress bar:

. Setprogressbar (Boolean Highpressure, String Path)


.setprogressbar (FALSE, "Textures/GUI/Progress_bar/Progress_bar_arrow_bronze.png")))

.setprogressbar (Boolean Highpressure, String Path, MoveType MoveType)

.setprogressbar (FALSE, "Textures/GUI/Progress_bar/Progress_bar_ARROW_BRONZE.png", moveType.richt)

Boolean HighPressure sets his rendering level, False is not rendered by steel machines, and True renders.

PATH only needs this path because this is the only path of the bronze steam machine progress bar.MoveType developed his orientation. The effective values ​​of MoveType are only Right, up, and down. If Multiblock Tweaker is installed, there are other methods.

Set the steam conversion rate:

Determine this special machine (only machine, not boiler) steam equal to 1 EU.

The default is 1.0.

. SetsteamConVersionRate (Boolean HighPressure, Double ConversionRate)


.setsteamConVersionrate (true, 1.5)

The first BOOL value If True enables the latter Double value of the steel, it is steam conversion.

Set the boiler:

Define the value of steam behavior.

Steamoutput = How much steam is output every 0.5 seconds (high pressure defaults to 24 0, normally 100)

COOLDOWINININTERVAL = How long does the boiler start to cool (high pressure default 40, normally 45)

COOLDOWNRATE = Machine cooling speed (default 1)


 Setboilervalues ​​(Boolean Highpressure, Int Steamoutput);

SetBoilervalues ​​(Boolean Highpressure, Int Steamoutput, Int CoolDowNinterval);

SetBoilervalues ​​(Boolean Highpressure, Int Steamoutput, Int CoolDowNinterval, INT COOLDOWNRATE);

Set the steam storage volume:

. Setsteamtanksize (Boolean Highpressure, Int Tanksize)

.setsteamtanksize (false, 8000)


Set the steam machine slot:

 Setslotoverlay (Boolean Highpressure, String Path, Boolean Isoutput);

.setslotoverlay (Boolean Highpressure, String Path, Boolean Isoutput, Boolean Isflum);

.setslotoverlay (Boolean Highpressure, String Path, Boolean Isoutput, Boolean Isflum, Boolean Islast);

If it is not special GUI, don't use this thing, it is a little troublesome.

register

. Buildandregister ()

Some examples:


 MachineBuilder.create (32000, "assembler") .setRcipemap (recipemaps.assembler_recipes)

.SetRenderer ("Machines/Assembler")

.Addtier (0)


.Addsteamtier (false, true)

.Addsteamtier (true)

.Buildandregister ();

// Creating a Recipe Map Here

Val BoilerRecipes as recipemap = recipeMapbuilder.create ("AWESOME_BOILER") // The name of custom recipemap


.Setinputs (1, 1) // Input, two places

.Setoutputs (1) // Output, output one


.Setfluidinputs (1) // fluid input, a fluid groove

.Setfluidoutputs (1) // fluid output, a fluid groove

.Sethidden (false) // Whether this formula hidden in Jei, can actually not write here

.Setdurationbar () // temperature bar

.Build (); // Here is custom recipemap

Machinebuilder.create (32015, "AWESOME_BOILER")

.SetRcipeMap (BoilerRecipes)

.SetRenderer ("Generators/Boiler/Coal"))

.Setgenrator ()

.Addsteamtier (false, true)

.Addsteamtier (true)

.Buildandregister (); // Steam boiler

Ore Flags

You need #Loader Gregtech at the top of the file.

Need a guide bag

 Import Mods.gregtech.ore.oreprefix; 

An example given by the official:

 Oreprefix.registerorePrefix (string name, Float quantity, @Optional String icon set, @optional into); // Examples

Val CurvedPlate as orefix = oreprefix.registerorepRefix ("PlateCurved", 1); 1)

Val CurvedPlate as orefix = Oreprefix.registerorepRefix ("PlateCURVED", 1, "PlateCurved");

Val CurvedPlate as Oreprefix = Oreprefix.registerorePrefix ("Platecurved", 1, "PlateCurved", 0);

NAME defines the prefix name and the name of the ore dictionary.

Amount defines the number of materials.Ingots 1.Block 9;

icontype (optional) defines material icon type (model location).By default, it uses the name of the prefix.Located in Textures/Items/Materials_SET/Inner


Flags is a sign.

0 = None (default)

1 = Enable unity

2 = Self -reference

3 = Two

Ore project

First import package:

 Import Mods.gregtech.material.imterialpredicate;

Import Mods.gregtech.Material.Material;

Need one

 Oreprefix.getByname (string name); 

Now you need to define a predicate.It defines which material should actually have the project.For example, the board project requires the material to have ingot attributes or gem attributes.

Official examples:

 Curvedplate.setGenerationPredicate (Imatereialpredicate Predicate);

// example

Curvedplate.setGenerationPredicate (Function (MAT As Material) as BOOL {

Return mat.hasingot ();

} As iMasterPredicate);


Predicate returns a function of Boolean value to determine whether it should be a project for the material.

This will check whether the material has a ingot attribute.You can use the predicate words.

List:

 Curvedplate.setGenerationPredicate (Imatereialpredicate.hasingot);

Curvedplate.setGenerationpredicate (Imateerialpredicate.hasgem);

Curvedplate.setGenerationpredicate (Imateerialpredicate.hasdust);

Curvedplate.setGenerationpredicate (Imateerialpredicate.hasflum);

Finally add this to your ore FLAG and create the project with actuality.

 Curvedplate.creatematericalitem (); 

Automatically generate formula:

You must use a script without #Loader Gregtech!

You can add methods to generate formulas.

Import package:

 Import Mods.gregtech.recipe.utils;

Import Mods.gregtech.ore.irerecipehandler;

Import mods.gregtech.ore.oreprefix;

Then get the ore prefix you want:

 value = oreprefix.getprefix ("oreprefix"); 

Final use

 Oreprefix.genlateRECIPES (IRERERECIPEHANDLER RECIPEHANDLER);

// example

Oreprefix.genlateRecipes (Function (ORPREFIX As Oreprefix, Material As Material) {{

// Here you can add any recipes like you normally do


// Example (Will Add a Recipe that requires a hammer and the materials place in crafting table)

Recipes.addshapet (Utils.Item (Oreprefix, Material), [

[, Utils.ore ("Plate", Material)]

]);

} As IRERECIPEHANDLER);

Utils.Item (ORPREFIX, Material) will return the project of materials and ore prefixes.For more information, please see here.

resource

Add a LANG entry to the ORE prefix in the LANG file

item.matic.oreprefix.plateCurved = Curved %s Plate ( %s will be replaced with material)

To provide materials for items, you need to create a model for the required materials. Assets/Gregtech/Models/Item/Material_Sets/

The file name should be the material icon type of the line under the lowercase.In this case, Plate_curved.json, now you need to place the material at any place where the model is directed.

example:

#loader gregtech

Import mods.gregtech.ore.oreprefix;

Import Mods.gregtech.material.imateialpredicate;

Import Mods.gregtech.Material. Material; Val Curvedplate as orefix = ORPREFIX.registerorePrefix ("PlatEcurved", 1);

Curvedplate.setGenerationPredicate (Function (MAT As Material) as BOOL {

Return mat.hasingot ();

} As iMasterPredicate);

Curvedplate.createMaterialitem ();


Example 2:

 Import Mods.gregtech.ore.oreprefix;

Import Mods.gregtech.ore.irerecipehandler;

Import mods.gregtech.recipe.utils;

Val CurvedPlate as orefix = Oreprefix.Getprefix ("PlateCurved");


Curvedplate.genlateRECIPES (Function (Oreprefix As Oreprefix, Material As Material) {{

Recipes.addshapet (Utils.Item (Oreprefix, Material), [

[, Utils.ore ("Plate", Material)]

]);

.RecipeBuilder ()

.Inputs (Utils.ore ("Plate", Material))

.Circuit (3)

.Outputs (Utils.Item (Oreprefix, Material)))

.Eut (24)

.Duration (50)

.Buildandregister ();

} As IRERECIPEHANDLER);

To be honest, I don't know what's useful at all

Material FLAG

You can create a custom material logo to determine whether you should generate something for the project.

This example will only be produced by copper, because the logo is only added to the copper.

#loader gregtech

Import Mods.gregtech.MaterialFlag; Import Mods.gregtech.materFlagbuilder;

Val Customflag = MaterialFlagbuilder.Create ("My_custom_flag")

.Requireingot ()

.Build ();

.addflags (CUSTOMFLAG);

// USING CURVED PRATE Prefix from Above as Example

Curvedplate.setGenerationPredicate (Function (MAT As Material) as BOOL {

Return mat.hasflag (CUSTOMFLAG);

} As iMasterPredicate);

A new Flag is created here, called my_custom_flag it requires the Ingot property.This means that if the material does not have a ingot attribute, it will automatically add.You can ask all attributes and all signs.

. Requireflag (string flag) // flag


.requireflag (materialFlag Flag)

.requiredust () // Fan

.requireingot () // ingots

.requiregem () // Gem

.requirefluid () // fluid

.requireplasma () // Plasma

.requiretool () // Tool

StoneType

StoneType creates other types of ore.To use the puzzle:

 Import Mods.gregtech.stonetype;

Import Mods.gregtech.Material.MaterialBuilder;

Create a material representing the stone.The example will use EREBUS UmbersStone.(You can use existing materials)

 Val ErebusStone = MaterialBuilder (32000, "umbersStone")

.Dust (1)

.Build ();

Note that the CRT ID cannot be repeated.

Note: The material must have dust, ingot or gem attributes!

Now we create a auxiliary string that defines the state.

 Val BlockState = "EREBUS: Umbers: Type = UmbersStone"; 

EREBUS: UmbersStone is a square ID.After that, you can add the attributes of defining block state (using multiple with).

Finally create a stone type.

 StoneType.create (16, "umbers", "oremberstone", EREBUSSTONE, BLOCKSTATE); 

parameter:


16 -is the digital identification. GTCEU is added from 0-11. It is recommended to start from 16.(From the higher value, it will cause problems)

"umberstone" -name of stone type.It can be almost anything

"OREUMBERSTONE" -The name of the ore prefix that is created automatically.

EREBUSSTONE- is the Stone created before

BlockState-is the state string we created before

Optional -iBlockStateMatcher defines the block that can be replaced in generation.(Only replace the stone type block status by default)

Optional Boolean -Define whether ore projects should be generated.(The default is fake)

Formula assistant

The formula assistant can only be used in the script, without the need to pre -loader #Loader Gregtech

Import package:

 Import Mods.gregtech.recipe.utils; 

This class adds some helpers to obtain ore prefixes and materials.

It is useful for customized ore preliminary formula processing procedures.

How to use:

 Utils.Item ("Minecraft: Clay", 1) // Return  (1 is his meta value)

Utils.Item (oreprefix.getprefix ("Ingot"), ) // Return to this Material concentrated Ingot item and return

Utils.Item ("INGOT", ) // The previous reduction version, return

Utils.Item (oreprefix.getprefix ("Ingot"), "Copper") // again, return

Utils.Item ("Ingot", "Copper") // Return to

Utils.ore ("Ingotcopper") // Return to Utils.ore ("Ingot", "Copper") // Return

Utils.ore (oreprefix.getprefix ("Ingot"), ) // Return to

Utils.ore ("Ingot", ) // Return

Utils.ore (oreprefix.getprefix ("Ingot"), "Copper") // Return


Utils.flum ("Copper") //

Utils.flum () // Copper, a concentrated fluid class, returns ()

Utils.metaitem ("SOME.ITEM") //

Utils.maticial ("Copper") //

Multiblock tweaker

Let's talk about MBT now, but only involve his custom multi -square GT machine part.

First take a look at the official examples

 // No pre-load-#loader.

Import Mods.gregtech.multiblock.builder;

Import Mods.gregtech.multiblock.factoryBlockpattern; Import Mods.gregtech.multiblock.relativeEdirection;

Import Mods.gregtech.multiblock.iblockMatcher;

Import Mods.gregtech.multiblock.multiblockability;

Import mode.gregtech.multiblock.factorymultiblockshapeinfo;

Import mods.gregtech.multiblock.iblockInfo;

Import Mods.gregtech.metatilentities;

Import mods.gregtech.recipe.recipemap;

Import crafttweaker.World.ifacing;

Import crafttweaker.text.itextComponent;

Var Loc = "Multiblock_alloy_smelter"; // Replacement writing, "The string inside is the machine name

Var Meta = 2000; // Meta ID cannot conflict. If there is a problem, Crafttweaker will throw a warning in the log.

Builder.start (LOC, META) // Fill in two variables here, in fact, you can fill in ("String name" int ID)


.Withpattern (// template

FactoryBlockpattern.start (RelativeDirection.right, RelativeDirection.down, RelativeDirection.front) // The relative direction is right, below, before.


.Aisle (// level writing

"CCC",

"CCC",

"CSC")

.Aisle (

"CCC",

"C C", // The space represents no square block "CCC")

.Aisle (

"CCC",

"CCC",

"CCC")

.Whereor ("c", // interpreter

, that is, some of the part of C in the structure represent the metal mechanical block with Meta value 2

IBLOCKMATCHER.abilitypartPredicate (// block matcher, block component predicate

Multiblockability.input_nergy, // The predicate is written below part of C, which means that this predicate belongs to the C block

Multiblockability.import_items, // The specific function is that these components can replace the C block

Multiblockability.export_items

))

.Where ("s", IBLOCKMATCHER.Controller (LOC)) // Explain the matching controller of the matching controller in the structure in the structure, and then enter the LOC/multi -square mechanical name, which represents the unique registered controller of this machine.

.Where ("", iBlockmatcher.any) // Explain the matching device in the structure of the structure to match any square.

.Build ()) // Construction

.Adddesign (// Add design

Factorymultiblockshapeinfo.start () // Multi -square factory, structural information, start matching

.Aisle (

"ICC",

"CCC",

"CCC")

.Aisle (

"Scc",

"E C",

"CCC")

.Aisle (

"OCC",

"CCC", "CCC")

.Where ("c", ) // The interpreter, do not describe the narrative

.Where ("s", iBlockInfo.Controller (LOC)) // The controller

.Where ("I", metalEntities.item_import_bus [0], ifacing.west ()) // Interpreter, meta block, item input bus, ifacing facing westward west

.Where ("o", metatilentities.item_export_bus [0], ifacing.west ()) // Item output bus

.Where ("e", metalleentities.energy_input_hatch [2], ifacing.west ()) // Energy input warehouse

.Where ("", IBLOCKINFO.EMPTY) // Interpreter, square information, representing an empty block

.Build ())

.Withparttooltip (, ItextComponent.fromString ("Example") as it ItextComponent) // Part Tooltip, when displaying multiple blocks, appears in the TOOLTIP of the metal mechanical shell. , Used itextComponent

.WithRecipeMap (// recipemap used

Recipemap.getByname ("AlLoy_smelter") // Just use a existing recipemap. It is recommended to use our custom MBTRECIPEMAP..Buildandregister (); // Construction and register

// The following is best to specify in the. Lang file, because these files may not work properly.

Game.setLocalization (// Localized name, LANG Key

"Multiblocktweaker.machine.multiblock_alloy_smelter.name",, ","

// "Multiblock AlLoy Smelter", please put the lang key above in the. Lang file, let's talk about it below

);

Game.setLocalization (// Settings

"Multiblocktweaker.multiblock.multiblock_alloy_smelter.Descripting",

// "The Multiblock AlLoy Smeter is a Multiblock that DOES AllOY SMELTERTER RECIPES. Hello, World!" ""

);

// Don't forget to add a formula to the machine

recipes.addshapet (

,

[

[,         ,         ],

[, , ],,,],],],],],,],,],],,],],,],,],,,,],,,,,,,,,

[, , ]

]

);

Don't you understand?Let's take a look at the second example

 // No pre -load.Import Mods.gregtech.multiblock.builder;

Import Mods.gregtech.multiblock.factoryBlockblockpattern;

Import Mods.gregtech.multiblock.relativeEdirection;

Import Mods.gregtech.multiblock.iblockMatcher;

Import Mods.gregtech.multiblock.multiblockability;

Import mode.gregtech.multiblock.factorymultiblockshapeinfo;

Import mods.gregtech.multiblock.iblockInfo;

Import Mods.gregtech.metatilentities;

Import Mods.gregtech.recipe.factoryRcipemap;

Import crafttweaker.World.ifacing;

var local = "Magic_miner"; // still LOC

VAR META = 2001; // Remember, ID cannot conflict, otherwise Crafttweaker must go wrong

var magnet_miner = builder.start (LOC, META) // Construction starts

.Withpattern (

FactoryBlockpattern.start (relatedIvement.right, RelativeDirection.down, RelativeDirection.front) // relative position

.Aisle (

"CCC",

"CCC",

"CSC")

.Aisle (

"CCC",

"C C",

"CCC") .aisle (

"CCC",

"CCC",

"CCC")

.Whereor ("C",

, // Interpreter, explain that C represents metal mechanical shell with Meta value 3 in this structure.

IBLOCKMATCHER.abilitypartPredicate (// block matcher, special predicate

Multiblockability.input_nergy, // energy input

Multiblockability.import_items, // Input items

Multiblockability.import_fluids, // Input fluid

Multiblockability.export_items // output items

)) .Where ("s", IBLOCKMATCHER.Controller (LOC)) // The interpreter, matched with the controller block, fills the name of the machine in the brackets, or the LOC variable name.

.Where ("", IBlockmatcher.any) // Explain that the space can be any square

.Build ()) // Construction

.Adddesign (// Add design

Factorymultiblockshapeinfo.start () // Structure information

.Aisle (

"ICC",

"CCC",

"ECC")

.Aisle (

"Scc",

"C C",

"CCC")

.Aisle (

"OCC",

"CCC", "FCC")

.Where ("c", ) // The interpreter

.Where ("s", iBlockInfo.Controller (LOC)) // The interpreter

.Where ("i", metallentities.item_import_bus [0], ifacing.west ()) // Interpreter, the item input bus line

.Where ("f", metallentities.fluid_import_hatch [0], ifacing.west ()) // Interpreter, fluid input warehouse

.Where ("o", metatilentities.item_export_bus [0], ifacing.west ()) // Item output bus

.Where ("e", metalleentities.energy_input_hatch [2], ifacing.west ()) // Energy input warehouse

.Where ("", IBlockInfo.empty) //

.Build ()) // Construction

.Cleartooltips (natural) // Clear all Tooltip

.WithRecipeMap (// Custom RECIPEMAP

FactoryRecipeMap.start (LOC)

.MinPuts (1) // Minimum input .maxinputs (1) // Maximum input

.Minoutputs (3) // minimum output

.Maxoutputs (27) // Maximum output

.Maxfluidinputs (1) // maximum fluid input

.Build ()) // Construction

.Buildandregister (); // Construction and registration

// Don't forget the formula of the machine controller

recipes.addshapet (

,,

[

[,         ,         ],

[, , ],,],],],],],,],],,],,],],,],,,,,,,,,,

[, , ]

]

);

// The Bracket Handler Can Also Be used to refer to it

.Recipemap // recipemap

.Recipebuilder ()

.Duration (500) // time

.Eut (500) // Enter EU/Tick

.Inputs () // Input items

.Fluidinputs (*8000) // Input liquid, 8000MB water .outputs (*64, // Output of items output

*64,

*64,

*64,

*64,

*64,

*64,

*64,

*64)

.Buildandregister (); // Construction and registration

Gtceu version MBT

The GTCEU version of MBT was developed by Kailbash, EUTRO, Brachy and others, and the version number greater than 2.0.0.

Look at the first example first:

// No need to #loader gregtech

Import Mods.gregtech.multiblock.builder;

Import Mods.gregtech.multiblock.factoryBlockblockpattern;

Import Mods.gregtech.multiblock.relativeEdirection;

Import Mods.gregtech.multiblock.functions.iptternBuilderFunction;

Import Mods.gregtech.icontrollertile;

Import mode.gregtech.multiblock.ctpredicate;

Import Mods.gregtech.multiblock.iblockpattern; Import Mods.gregtech.Rcipe.recipemap;

var local = "Glass_smelter";

Builder.start (LOC) // Now!We don't need to remember the ID of FU*K!Now he will make up for himself!

. WithPattern (Function (Controller As IController) as iBlockpattern {// Function

//Ctpredicate.States () formulate square blocks, and the SetmingLOBALLIMITED (15) below refers to only 15 of this block in this structure. TOOLTIP can now use LANG Key.

Val Glass = CTPREDICATE.STATES (). SetmingLoballimited (15) .addtooltips ("Glass_smelTERTIPS"));

Return FactoryBlockpattern.start (RelativeDirection.right, RelativeDirection.down, RelativeDirection.front)

.Aisle (

"Kkk",

"Kkk", "ksk",

"D D")

.Aisle (

"CCC",

"CLC",

"CCC",

"") .SetRepetable (2) // This setter means that the labeled layer repeatedly overlay twice.

.Aisle ("CCC",


"CCC",

"CCC",

"D D")

.Where ("k", Glass | Controller.autoabilities ()) // equal to Glass.or (Controller.autoabilities ())

.Where ("c", Glass) // glass

.where ("l", ctpredicate.liquids ()) // equal to ctpredicate.blocks () == ctpredicate.States : lava>) == .where ("s", controller.Self ()) // means the controller of this machine's controller

.Where ("d", ) // fence block

.Where ("", ctpredicate.getany ()) // represents any block

.Build (); // Construction

} As iPatternbuilderFunction) // Function

. WithRecipeMap (recipemap.getByname ("Bender") // You can use existing recipemap and custom recipemap. The code here is equal to

.WithbaseTexture () // The basic texture of the machine is set as glass

.Buildandregister (); // Construct and register // The following things are recommended to be placed in the. Lang file

// Don't forget to add the recipe of the controller and the RECIPEMAP of the machine.

Let's take a look at the second example:

 // No need #loader

Import Mods.gregtech.multiblock.builder;

Import Mods.gregtech.multiblock.factoryBlockblockpattern;

Import Mods.gregtech.multiblock.relativeEdirection;

Import Mods.gregtech.multiblock.functions.iptternBuilderFunction;

Import Mods.gregtech.icontrollertile;

Import mode.gregtech.multiblock.ctpredicate;

Import mods.gregtech.multiblock.iblockpattern;

Import Mods.gregtech.recipe.factoryRcipemap;

Import mods.gregtech.recipe.recipemap;

var local = "mbt: magnet_miner"; // Assignment LOC

Val Magic_Miner = Builder.start (LOC) // Automatic completion ID

.WithPattern (Function (Controller As IControlLertile) as IBLOCKPATRN {{

Return FactoryBlockpattern.start () // Template

.Aisle ("CCC", "CCC", "CCC") // Another way of writing a two -dimensional array

.Aisle ("ccc", "c c", "cmc")

.Aisle ("CSC", "CCC", "CCC") .Where ('s', Controller.Self ()) // The controller

.Where ("c", ctpredicate.states () // Meta value 3 metal machine shells with 3 metal machine cases 3

| CTPREDICATE.abilities (). SetmingLoballimited (1) .setpreViewCount (1) // There was at least one Import_items bus.Jei preview shows that there is only one.

| CTPREDICATE.abilities (). Setmingloballimited (1) .setpreViewCount (1) (1)

| CTPREDICATE.abilities (). SetmingLoballimited (1) .setpreViewCount (1) (1)

| CTPREDICATE.abilities (). Setmingloballimited (1) .setmaxgloballimited (3) .setpreViewCount (1) // There was at least one input there. _Energy warehouse. Jei will only display one)

.Where ('m', Controller.autoabilities (false, false, false, false, false, false, true)) // equal to ctpredicate.abilities ()

.Where ('', ctpredicate.getair ()) // Air

.Build (); // Construction

} As iPatternBuilderFunction)

.WithRecipeMap (// recipemap factionRecipemap.start ("Magic_miner") // Create a new recipemap.

.Minputs (1)

.Maxinputs (1)

.Minoutputs (3)

.Maxoutputs (27)

.Maxfluidinputs (1)

.Build ()) // Construction

.Withbasetexture () // Find the existing renderer in the CEU.However, you can also use .

.Buildandregister (); // Construction and registration

// Set forward

Magic_miner.hasmaintenanceMeChanics = false; // Maintain the machine and maintain the warehouse

Magic_miner.hasmufflermechanics = TRUE; // Specifications, muffle warehouse

Magic_miner.frontoverlay = ; // Previous material

// Add a simple recipemap

Magic_miner // parentheses processing program can also be used to refer to it.()

.Recipemap // For details of how to add formulas, please refer to CEU WIKI.

.Recipebuilder ()

.Duration (500) // time

.Eut (500) // EU/Tick

.Inputs () // Input

.Fluidinputs (*8000) // Enter fluid

.Outputs (*64, // Output *64,

*64,

*64,

*64,

*64,

*64)

.Buildandregister (); // Construction and registration

// This is best to specify in the. Lang file because these files may not work properly.

Game.setLocalization (

"Mbt.machine.magic_miner.name",

"Magic Miner"

);

Game.setLocalization (

"Mbt.multiblock.multiblock_dt.descript",, "

"The Magic Miner is a Multiblock that mines ores from nothing." ""

);

Game.setLocalization (

"Recipemap.magic_miner.name",

"Magic Miner"

);

// Don't forget to add formula.

Gtceuwiki

This part was discovered in the Gitceu warehouse in GitHub, and his Wiki page also had a part of GTCEU's dedicated magic reform.

GTCEU's material part

introduce

You should take a look at it first

What should be "material"?

---

Materials are the foundation of CEU. He defines a kind of attribute and its attributes. The materials are usually element (such as iron Fe, oxygen O) or compounds (such as water H 2 o), but he also has some weirdMaterials, such as the eyes of the last shadow and the stars of the lower boundary.

What attributes are defined?

---

The material specifies whether it has fluid attributes, plasma attributes, pink attributes, gem attributes or ingot properties.When it has a specific attribute, GTCEU automatically registered the corresponding item or fluid.Some attributes require other attributes, such as Ingot requires dust.What else did he define?

---

You can also define color, logo (indicator of specific attributes), MaterialiconSet (texture), CableProperties, elements, formulas (tool prompts), components, etc.Don't worry, they are not complicated, the following will be introduced in detail.

Search for existing materials

There are two methods of officials: one simple, one is not simple.(?)

Simple method

This method requires the first.This method breaks away from the material of the material, which is the name used before translation in the Lang file.You can use the/GT Hand command to retrieve it, and it lists after the word "material" in chatting.Its working principle is almost the same/CT Hand, but it has done extra things for the Gregtech project.

 // Import package Material class to use Materials

Import Mods.gregtech.Material. Material;

// Assign the variable my_material to a material called Steel.

var my_material = ;

As for the difficulty method, the same method is the same, because the effect is the same, and the first one is simpler, so I don't want to talk about the second type.

Create new materials

First of all, you cannot use any ordinary Crafttweaker script to make materials. They need a specific pre -loader,#loader gregtech, which must be in the first line of the file, which is necessary for the material generation work.Please note that other conventional scripts (such as adding a formula formula) do not work in the script with this loading program!

The material is registered using MaterialBuilder. If you add a machine formula with the system of Gregtech CE and CEU, it will feel very similar.

All materials need a digital ID and a name.ID must be between 0-32768, but the ID 32000+ retains to Crafttweaker.Any additional developers should not use the ID within this range, so do not have to worry about conflict.More than 700 materials also exceed all the materials used by CEU itself!Name must be all lowercase, without space, and does not include special characters (@,%, etc.).

#loader gregtech

// Import packets: MaterialBuilder and Material to register with materials

Import Mods.gregtech.Material.MaterialBuilder;

Import Mods.gregtech.Material. Material;

/*

*This itself has no effect.

*It allocates a variable for a new MaterialBuilder, with a ID of 32,000, named "My_material".

*/

var my_material_builder = MaterialBuilder (32000, "my_material");

#loader gregtech

// Import packets: MaterialBuilder and Material to create new materials

Import Mods.gregtech.Material.MaterialBuilder;


Import Mods.gregtech.Material. Material;

/*


*This cannot be fully worked.Continue reading and understanding what else is needed!

*It will allocate a variable for a new material, its ID is 32001, the name is "my_real_material"

**Use .build (); to complete the construction of a material.This is the process that actually created it

*/

var my_material = materialbuilder (32001, "my_real_material"). Build ();

Add material attributes

This is where the material really begins to take shape.All the following methods are in MaterialBuilder (). Looking down, the first example to see how to use this method, each method can be linked together one by one until the required materials are specified.It is then built and ended and returned to a complete material.

fluid

 FLUID (@optional String Type, @Optional Boolean Hasblock) 

Fluidproperty adds a fluid to the material.The above two parameters are optional. If you want to modify the optional parameters, you must specify a value for each parameter in the previous parameter.Please note that using FLUID ().

There are two types of Type of String Type, namely "Fluid" and "Gas".

If HasBlock is True, it will register a fluid block for this fluid, which can be placed in the world.


plasma

 Plasma () 

Plasmaproperty generates plasma for this material. It does not need Fluidproperty, but it can be used with it.

Powder material:

 Dust (@Optional Int Harvestlevel, @Optional Int Burntime) 

Add a dustproperty to this material, which generates powder, small pink and small pile of powder, and automatically applies to IngotProperty and Gemproperty.

Harvestlevel's mining level of the material block during mining. If the material also has ToolProperty, this value will also be used to determine the mining level of the tool.

Burntime This material is used as the burning time of the furnace fuel (in tick). If it is not specified, the material cannot be used as a furnace fuel.

Ingots material:


 Ingot

Add an IngotProperty to this material and generate a ingot material. It will automatically add a Dustproperty, which is not compatible with Gemproperty.

Harvestlevel's mining level of the material block during mining. If the material also has ToolProperty, this value will also be used to determine the mining level of the tool. If this material has defined the excavation level, it will be covered.

Burntime This material is used as a burning time for melting furnace fuel (in tick). If it is not specified, the material cannot be used as a furnace fuel.If this material has defined the burning time, it will be covered.

gem

 GEM (@optional Int hanvestlevel, @Optional INT BURNTIME) 

Add a Gemproperty to this material and generate all types of Gray technology gemstones. It will automatically add a Dustproperty, which is not compatible with IngotProperty.

HarvesstLevel harvest level

Burntime is the burning time of fuel (unit tick)

color

 color (int color) 

Set the color of this material, do not use the default default 0xfffffff

Coloraverage (), the color can be provided in any format in any format: an integer value, such as 16777215 or 0xffffff.This is RGB, without the Alpha channel.Average color: colorAverad ()

The color of the material will be the weighted average of all component colors in the material.

tool

 Toolstats (Float Speed, Float Damage, Int Durability, Int Enchantability) 

Set statistical data made of tools made of this material.

Speed-tool excavation speed.

Damage-tool attack damage.

durability-tool durability.

Enchantability-tool enchanting ability.

Blast furnace temperature

 BlastTemp (int Temp, @optional String Gastier, @Optional Int Euverride, @Optional Intidoverride) 

Set the temperature of the blast furnace of this material. If it is lower than 1000 Kaerwin, the soil blast furnace formula will be added. If it is higher than the 1750 Cairvin, the power blast furnace, thermal material ingot and its vacuum freezer formula will be added. If the material with this attribute has a fluid,It will turn the fluid temperature into the temperature set here.

Temp-Kailvin blast furnace temperature required for heating materials.Just like in real life, this value cannot be less than 0.

@Optingal Gastier-The gas layer used in an electric blast furnace.The available options are: "Low", "MID", "High", "Higher", "Highes.

@Optional Eutoverride-Set the EU/T of the automatic power blast furnace formula to the specified value.


@Optional Durationoverride-Set the time of the automatic power blast furnace formula to the specified value.

ore

 Ore (@optional int oremultiplier, @Optional Int byproductMultiplier, @Optional Boolean Emissive) 

Add ore, crushing ore, pure crushing ore, crushing centrifugal ore, dirty powder and pure powder to this material.

@Optional oremultiplier -crushing ore of ore-> The output multiplication of grinding crushed ore, the default value: 1 (no multiplication).


@Optional byproductMultiplier-Any type of by-product output multiplied by the fragmented ore processing, the default value: 1 (no multiplication).

@Optingal Emissive-ore should be used in the luminous material (see the figure below).The default value: false.

Ore glow


Clean

 Washedin (Material Material, @optional Int Washedamount) 

Set the content of crushing ore using chemical methods to clean the ore.

Material-washing the fluid material of the material, the required materials are Fluidproperty.

@Optingal Washedamount-The amount of fluid required by the crushing ore is washed, and the default value: 100MB.


Electromagnetic

 Separadinto (material ... materials) 

The products of the clean ore powder that are treated with this material are set in the electromagnetic mining machine, and the Oreproperty is required.

A series of materials output in the electromagnetic mining machine in Materials- This has automatically included the material itself.Gnist

 addorebyproducts (material ... materials) 


The ore by -product of this material requires the ORPROPERTY settings.

Materials-a series of by-product materials output by by-product output during various ore processing.

Ore melting

 Oresmeltinto (Material Material) 

Set the product of the ore directly in the original melting furnace setting of the ore -related form of this material, and the Oreproperty is required.


Material-material output in the furnace.It can be IngotProperty, Gemproperty, or Dustproperty.

Magnetic

 Polarizesinto (Material Material) 

The magnetizer product of this material requires IngotProperty settings.

Material-material output during magnetization.

Arc furnace melting


 Arcsmeltinto (Material Material) 

Set the product of the arc furnace of this material.Need IngotProperty settings.

Material-the material output of the arc furnace, by default, the material will be output itself.

Grind

 MACERATEINTO (Material Material) 

The grinding machine product of this material requires IngotProperty settings.

Material-material output during grinding, by default, the material will be output itself.


Fluid temperature

 Fluidtemp (int Temp) 

The temperature of the fluid of this material requires FLUIDPROPERTY settings.

Temp-Kelvin temperature to be set, just like in real life, this value cannot be less than 0.

Wire/cable

 CableProperties (Long Voltage, Int AMPERAGE, INT LOSS, @optional Boolean Isupercon) 

The wire and cable that adds this material requires IngotProperty settings.


Voltage-1X wire/cable can transmit voltage level.

AMPERAGE-1X wires/cables can be transmitted by current, Ampel.

Loss-1x line losses (line loss) per block, cable has this value divided by 2, but unless settings are set to 0, it will never be a non-destructive wire.

@Optingal issupercon- Is this a super conductor?This will prohibit cables from generating and damage the wire to 0.

Fluid pipeline

 FluidpipeProperties (int MaxTemp, Int Throughput, Boolean Gasproof) 

The fluid pipeline that adds this material requires IngotProperty settings.


MAXTEMP-Set the highest fluid temperature allowed in the pipeline.When the fluid is transmitted to this temperature, the pipeline will burn and disappear.

Throughput-setting the maximum traffic through the pipeline, multiplied by this value 20 is the maximum rate of Tiny Pipe, each subsequent pipeline further multiplied by a pipeline before 2.

Gasproof-If True, the pipe can transmit the fluid of the gas state.Otherwise, the transmitted gas will evaporate.

Object pipeline

 ITEMPIPEPROPROPERTIES (Int Priority, Float Stacksperc) 


The item pipeline that adds this material requires IngotProperty settings.

Priority-sets the priority of the pipeline, and the items will use the lowest priority path. This value is directly used for normal pipelines. The value of the small pipeline multiplied by 1.5, and the value of the large pipeline multiplied by 0.75.StackspersEc-Set the maximum transmission rate of 64 projects per second. This value is directly used for normal pipelines. The value of the small pipeline multiplied by 0.5, and the value of the large pipeline multiplied by 2.

Default enchant

 adddefaultEnchant (Ienchantment Enchantment) 


Adding the default attachment to this material requires ToolProperty settings, which will directly apply these enchantment to this material.

Enchantment -The enchantment to be set, use Crafttweaker's Ienchantment.

example

#loader gregtech


Import Mods.gregtech.Material.MaterialBuilder;

Import Mods.gregtech.Material. Material;

var Specialsteel = MaterialBuilder (32002, "Special_Steel") // Name

.Flum ("Gas", FALSE) // Gas


.Ingot () // Enable the ingot material, so open the powder material

.Color (0x0000ff) // Pure blue

.Toolstats (10, 3, 256, 21) // Tool settings

.Blasttemp (2900) // Blast furnace temperature, greater than 1000 use EBF power blast furnace


.Ore () // Enable ore

.AddoreByproducts (, ) //

.CableProperties (128, 2, 4, FALSE) // Add the cable

.Build (); // Construct this material


How about, is it easier than GTCE?

Change the material appearance

You may have noticed from the example above that the texture of the material looks the same as the style of many other materials. This is called Materialiconset, which is the material set. The entire section is dedicated to explaining this system and how to use it.

The material sets available for MaterialiconSet are: "None", "Metallic", "Dull", "Magnetic", "Quartz", "Diamond", "Emerald", "SHINY", "Rough", "Fine", "Sand", "Sand", "FLINT", "RUBY",  "LAPIS", "FLUID", "GAS", "LIGNITE", "OPAL", "GLASS", "WOOD", "GEM_HORIZONTAL", "GEM_VERTICAL", "PAPER", "NetherStar "," Bright ", these materials are placed in the MOD file/Assets/Textures/Items/Materials_Set. Each subfolder represents each material set. You can open the folder to see which material templates containing the material set containingEssenceFor example, the figure below shows the appearance of ore with different Materialiconset.


Meterialiconset of all its materials use a single method settings.

 iconset: iconset (String iconset) 

If the material is set to this material, the default value depends on whether the material has the following points:

Gemproperty-default


Ingotproperty or dustproperty-default

FLUIDPROPERTY-Definite "Fluid" or "GAS" depends on FluidType

Plasmaproperty-default "Fluid", but it will receive special plasma streaming materials anyway.

The default value will be determined in this order.

Examples of using material sets:

#loader gregtech

Import Mods.gregtech.Material.MaterialBuilder;


Import Mods.gregtech.Material. Material;

var SpecialStelTextured = MaterialBuilder (32003, "Special_STEEL_TEXTURD") // name

.Flum ("gas", false) // gas and fluid blocks

.Ingot () // ingot powder material

.Color (0x0000ff) // Pure blue

.Iconset ("shiny") // The material set is set to shiny


.ToolStats (10, 3, 256, 21) // Tools .blasttemp (2900) //

.Ore () // ore

.AddoreByproducts (, ) // Byminated products

.CableProperties (128, 2, 4, FALSE) // Cable

.Build (); // Construction


Element

Ingredients refer to the composition of the material.

For example, the ingredients of tungsten steel are 1 TUNGSEN (W) and 1 STEEL (Fe).This is its chemical formula:

MateriLSTACK


The component is determined by a thing called MateriAlStack.This is the material version of Itemstack, and itemstack is a counting project.In our example, MaterialStack is a counting material that is easy to create MaterialStack. However, due to the compile system of Crafttweaker, you must ensure that there is a space before and after*, otherwise you may receive a script error.

 Import Mods.gregtech.material. Material;

// Create a materialstack of the material tin with a count of 3.

var my_material_stack = *3;

Very simple, isn't it?

Then this article is here first, the rest will come again next time.

Make up the link to the next period