Skip to content

Commit 792b76a

Browse files
Material Creation, Properties, Flags, and Modification documentation (#3912)
Co-authored-by: Jurre Groenendijk <[email protected]>
1 parent 6eeb8c2 commit 792b76a

File tree

8 files changed

+590
-305
lines changed

8 files changed

+590
-305
lines changed

docs/content/Modpacks/Changes/v7.2.0.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ in the MachineDefinition, you need to add `.modelProperty(GTMachineModelProperti
1515

1616
## Ranged inputs/outputs
1717
In recipes, you can now use:
18+
1819
- `.itemInputsRanged(..., min, max)`
19-
- `.itemOutputssRanged(..., min, max)`
20+
21+
- `.itemOutputsRanged(..., min, max)`
22+
2023
- `.fluidInputsRanged(..., min, max)`
24+
2125
- `.fluidOutputsRanged(..., min, max)`
2226

2327
Where the inputs or outputs will be rolled inclusively from min to max.

docs/content/Modpacks/Examples/Superheated_Pyrolyzing_Oven.md renamed to docs/content/Modpacks/Examples/Example_Coil_Multiblock.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Superheated Pyrolyzing Oven"
2+
title: "Example Coil Multiblock"
33
---
44

55
### Superheated Pyrolyzing Oven Multiblock (by Phoenixvine)
@@ -105,4 +105,3 @@ Below is an example of a multiblock using the CoilWorkableElectricMultiblockMach
105105

106106

107107

108-

docs/content/Modpacks/Materials-and-Elements/01-Material-Creation.md

Lines changed: 120 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -4,83 +4,49 @@ title: Material Creation
44

55

66
Materials are in-game items or fluids. They can be dusts, ingots, gems, fluids and all their derivatives.
7-
To make a new material, write an `event.create()` call in the registering function, like in the examples.
8-
Write inside the parentheses the name of the material inside `''` or `""`.
9-
(**NOTE**: to add a material that is present on the periodic table, but doesn't have any in-game items/fluids, look below for how to do it)
7+
!!! note
8+
To add a material that is present on the periodic table, but doesn't have any in-game items/fluids, look at the [material modification page](./Modifying-Existing-Materials.md).
109

1110
You can change the properties of the material by adding any combination of the following calls:
1211

1312
- `.ingot()` will make the material have both an ingot and dust form.
1413
- `.dust()` will make the material have a dust form. Don't use this together with `.ingot()`.
15-
- `.gem()` will make the material have both a gem form and a dust form. Don't use those together with `.dust()` or `.ingot()`
14+
- `.gem()` will make the material have both a gem form and a dust form. Don't use those together with `.dust()` or `.ingot()`.
1615
- `.liquid()` will make the material have a liquid (fluid) form with liquid properties.
16+
- `.block()` will make the material have a placeable (block) fluid form. Requires `.liquid()`.
1717
- `.gas()` will make the material have a gas (fluid) form with gas properties.
1818
- `.plasma()` will make the material have a plasma (fluid) form with plasma properties.
1919
- `.polymer()` will make the material have a dust form with polymer properties.
20+
- `.ore()` will create an ore from the material.
21+
- Optionally you can add any of these sets of parameters:
22+
1. `boolean isEmissive` -> `true` for emissive textures
23+
2. `int oreMultiplier, int byproductMultiplier` -> how many crushed ores will be given from one raw ore and how many byproducts dusts will be given throughout the ore processing
24+
3. `int oreMultiplier, int byproductMultiplier, boolean isEmissive` -> see previous points
2025
- `.burnTime(int burnTime)` will turn the material into a furnace fuel.
2126
- `.fluidBurnTime(int burnTime)` defines how long the fluid of the material will burn.
2227
- `.components(component1, component2, ...)` describes the composition. The components are a list of elements of the following form: `'Kx material_name'`, where `K` is a positive integer.
28+
- `.element(element)` is similar to `.components()`, but is used when the material represents an element.
2329
- `.iconSet(set)` gives the material an icon set.
24-
- `.color(int colorCode)` gives the material a color. The color must be provided as a hex value in the following form: `0xNNNNNN`, where `N` are digits.
30+
- `.color(int colorCode)` gives the material a color. The color must be provided as a hex value in the following form: `0xRRGGBB`.
2531
- `.secondaryColor(int colorCode)` gives the material a secondary color. If this is not being called, the secondary value will default to white(0xffffff).
26-
- The secondary color is the overlay over the primary color on the material. This can be seen in the dust of a material, as the secondary color outline is visible. Rotors are another solid example.
27-
- `.flags(flag1, flag2, ...)` can be used to select certain properties of the material, like generating gears, or disabling decomposition.
28-
Examples of use can be found in [Material Flags](https://gregtechceu.github.io/GregTech-Modern/Modpacks/Materials-and-Elements/Material-Flags/)
29-
- `.element(element)` -> similar to `.components()`, but is used when the material represents an element.
30-
- `.rotorStats(/* int */ power, /* int */ efficiency, /* float */ damage, /* int */ durability)` -> this will create a turbine rotor from this material
31-
1. Power is the EU/t and fuel consumption multiplier the turbine gets when equipped with this rotor.
32-
This output varies depending on speed of turbine and rotor holder.
33-
2. Efficiency is how well it handles fuel.
34-
A smaller number will make it consume more fuel while a bigger number means it uses less fuel.
35-
Actual efficiency: rotorEfficiency * holder Efficiency / 100
36-
3. Damage is the amount of damage that happens to the player when opening the ui of a running turbine's rotor holder.
37-
4. Durability is how much base durability it has.
38-
- Here are some examples of base gt rotors:
39-
1. Titanium Rotor: .rotorStats(130, 115, 3.0, 1600)
40-
2. HSS-S Rotor .rotorStats(250, 180, 7.0, 3000)
41-
- `.blastTemp()` is meant to be paired together with `.ingot()`. Will generate a EBF recipe (and an ABS recipe) based on the parameters you give it:
42-
1. temperature -> dictates what coil tier it will require (check the coil tooltips for their max temperature).
43-
If the temperature is below 1000, it will also generate a PBF recipe.
44-
If temperature is above 1750, a hot ingot will be generated, this requiring a Vacuum Freezer.
45-
2. (optional) gas tier -> can be `null` for none, `'low'` for nitrogen, `'mid'` for helium, `'high'` for argon, `'higher'` for neon or `'highest'` for krypton.
46-
3. (optional) EU per tick -> the recipe voltage
47-
4. (optional) duration in ticks -> how long the recipe should take
48-
- `.ore()` will create an ore from the material.
49-
- Optionally you can add any of these sets of parameters:
50-
1. is emissive -> `true` for emissive textures
51-
2. ore multiplier and byproduct multiplier -> how many crushed ores will be given from one raw ore and how many byproducts dusts will be given throughout the ore processing
52-
3. ore multiplier, byproduct multiplier, is emissive
53-
- `.washedIn()`
54-
- `.separatedIn()`
55-
- `.separatedInto()`
56-
- `.oreSmeltInto()`
57-
- `.polarizesInto()`
58-
- `.arcSmeltInto()`
59-
- `.maceratesInto()`
60-
- `.ingotSmeltInto()`
61-
- `.addOreByproducts()`
62-
- `.cableProperties()` generates wires and cables(if material is not a superconductor). The following parameter sets can be given:
63-
1. Voltage, amperage, loss per block
64-
2. Voltage, amperage, loss per block, is superconductor -> for a super conductor, set loss as 0 and is super conductor as true
65-
3. Voltage, amperage, loss per block, is super conductor, critical temperature
66-
- `.fluidPipeProperties()`
67-
- `.itemPipeProperties()`
68-
- `.addDefaultEnchant()`
32+
- The secondary color is the overlay over the primary color on the material. This can be seen in the dust of a material, as the secondary color outline is visible. Rotors are another solid example.
33+
- `.addDefaultEnchant(string EnchantName, int level)` gives the material a default enchant.
6934

7035
!!! tip "Harvest Level & Burn Time"
7136
For `.ingot()`, `.dust()` and `.gem()`, optionally you can put inside the parentheses any of these sets of parameters:
7237

7338
1. harvest level (e.g. `.ingot(2)` will make the material have the harvest level of iron tools)
7439
2. harvest level, burn time (e.g. `ingot(2, 2000)` will make the material have the harvest level of iron tools and will burn in furnaces as fuel for 2000 ticks or 100 seconds).
7540

76-
!!! tip "Disabling Decomposition"
77-
Depending on the composition, GT will autogenerate an electrolyzer or centrifuge recipe to decompose the material. You can block that by adding the disable decomposition flag. `DISABLE_DECOMPOSITION`
78-
7941
!!! tip "Choosing EU/t"
8042
GT has some builtin constants to ease choosing the required EU/t:
43+
8144
- `GTValues.V` for a full amp of power at the selected tier
45+
8246
- `GTValues.VA` for a full amp, adjusted for cable loss
47+
8348
- `GTValues.VH` for half an amp
49+
8450
- `GTValues.VHA` for half an amp, adjusted for cable loss
8551

8652
These values are arrays containing the respective EU/t values for each tier.
@@ -91,51 +57,117 @@ You can change the properties of the material by adding any combination of the f
9157
```
9258

9359
??? tip "Color Pickers"
94-
To chose a color for your material, you can checkout https://www.w3schools.com/colors/colors_picker.asp
60+
To chose a color for your material, you can checkout the [color picker](https://www.w3schools.com/colors/colors_picker.asp).
9561
After you select a color with the above tool, copy the 6 digits that follow the # under the color preview.
62+
9663
## Creating an Ingot
9764

98-
```js title="ingot.js"
99-
GTCEuStartupEvents.registry('gtceu:material', event => {
100-
event.create('andesite_alloy')
101-
.ingot()
102-
.components('1x andesite', '1x iron')
103-
.color(0x839689).iconSet(GTMaterialIconSet.DULL)
104-
.flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_GEAR, GTMaterialFlags.GENERATE_SMALL_GEAR)
105-
})
106-
```
65+
=== "JavaScript"
66+
```js title="ingot.js"
67+
GTCEuStartupEvents.registry('gtceu:material', event => {
68+
event.create('andesite_alloy')
69+
.ingot()
70+
.components('1x andesite', '1x iron')
71+
.color(0x839689).iconSet(GTMaterialIconSet.DULL)
72+
.flags(GTMaterialFlags.GENERATE_PLATE, GTMaterialFlags.GENERATE_GEAR, GTMaterialFlags.GENERATE_SMALL_GEAR)
73+
})
74+
```
75+
=== "Java"
76+
```java title="Ingot.java"
77+
public static Material ANDESITE_ALLOY;
78+
public static void register() {
79+
ANDESITE_ALLOY = new Material.Builder(
80+
your_mod_id.id("andesite_alloy"))
81+
.ingot()
82+
.components("1x andesite", "1x iron")
83+
.color(0xFF0000).secondaryColor(0x840707).iconSet(GTMaterialIconSet.DULL)
84+
.flags(MaterialFlags.GENERATE_PLATE, MaterialFlags.GENERATE_GEAR, MaterialFlags.GENERATE_SMALL_GEAR)
85+
.buildAndRegister();
86+
}
87+
```
10788

108-
## Creating a Gem
89+
## Creating a Dust
10990

110-
```js title="gem.js"
111-
GTCEuStartupEvents.registry('gtceu:material', event => {
112-
event.create('purple_coal')
113-
.gem(2, 4000)
114-
.element(GTElements.C)
115-
.ore(2, 3)
116-
.color(0x7D2DDB).iconSet(GTMaterialIconSet.LIGNITE)
117-
})
118-
```
91+
=== "JavaScript"
92+
```js title="dust.js"
93+
GTCEuStartupEvents.registry('gtceu:material', event => {
94+
event.create('mysterious_dust')
95+
.dust() // The harvest level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
96+
.color(0x7D2DDB)
97+
})
98+
```
11999

120-
## Creating a Dust
100+
=== "Java"
101+
```java title="Dust.java"
102+
public static Material MYSTERIOUS_DUST;
103+
public static void register() {
104+
MYSTERIOUS_DUST = new Material.Builder(
105+
your_mod_id.id("mysterious_dust"))
106+
.dust() // The harvest level and burn time can be specified in the brackets. Example: `.dust(2, 4000)`
107+
.color(0x7D2DDB)
108+
.buildAndRegister();
109+
}
110+
```
121111

122-
```js title="dust.js"
123-
GTCEuStartupEvents.registry('gtceu:material', event => {
124-
event.create('mysterious_dust')
125-
.dust()
126-
.cableProperties(GTValues.V[GTValues.LV], 69, 0, true) // (1)
127-
})
128-
```
112+
## Creating a Gem
113+
114+
=== "JavaScript"
115+
```js title="gem.js"
116+
GTCEuStartupEvents.registry('gtceu:material', event => {
117+
event.create('purple_coal')
118+
.gem(2, 4000)
119+
.element(GTElements.C)
120+
.ore(2, 3)
121+
.color(0x7D2DDB).iconSet(GTMaterialIconSet.LIGNITE)
129122

130-
1. Voltage, Amperage, EU loss, Is Superconductor.
123+
})
124+
```
125+
126+
=== "Java"
127+
```java title="Gem.java"
128+
public static Material PURPLE_COAL;
129+
public static void register() {
130+
PURPLE_COAL = new Material.Builder(
131+
your_mod_id.id("purple_coal"))
132+
.gem(2, 4000)
133+
.element(GTElements.C)
134+
.ore(2, 3)
135+
.color(0x7D2DDB).iconSet(GTMaterialIconSet.LIGNITE)
136+
.buildAndRegister();
137+
}
138+
```
131139

132140
## Creating a Fluid
133141

134-
```js title="fluid.js"
135-
GTCEuStartupEvents.registry('gtceu:material', event => {
136-
event.create('mysterious_ooze')
137-
.fluid()
138-
.color(0x500bbf)
139-
.fluidTemp(69420)
140-
})
141-
```
142+
=== "JavaScript"
143+
```js title="fluid.js"
144+
GTCEuStartupEvents.registry('gtceu:material', event => {
145+
event.create('mysterious_ooze')
146+
.fluid() // Or .liquid(Int Temperature)
147+
.color(0x500bbf)
148+
})
149+
```
150+
151+
=== "Java"
152+
```java title="Fluid.java"
153+
public static Material MYSTERIOUS_OOZE;
154+
public static void register() {
155+
MYSTERIOUS_OOZE = new Material.Builder(
156+
your_mod_id.id("mysterious_ooze"))
157+
.fluid() // Or .liquid(Int Temperature)
158+
.color(0x500bbf)
159+
.buildAndRegister();
160+
}
161+
```
162+
163+
164+
!!! tip "Further Material Information"
165+
For more information on more fine grained material control, check out the pages below!
166+
167+
For a full list of the flags, check out the [Material Flags page](./Material-Flags.md).
168+
169+
For a full list of material properties, check out the [Material Properties page](./Material-Properties.md).
170+
171+
For an explanation of tools, check out the [Tool Creation page](./Tool-Creation.md).
172+
173+
For an explanation of custom icon sets and a list of existing ones, check out the [Icon Set page](./Material-Icon-Sets.md).

0 commit comments

Comments
 (0)