Skip to content

Commit

Permalink
update docs to 1.3.1 (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC authored Aug 19, 2024
1 parent 0c6173e commit dbf88a8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
21 changes: 10 additions & 11 deletions docs/Modpacks/Materials-and-Elements/01-Material-Creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@ title: Material Creation


Materials are in-game items or fluids. They can be dusts, ingots, gems, fluids and all their derivatives.
To make a new material (**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),

write an `event.create()` call in the registering function, like in the examples.
Write inside the parentheses the name of the material inside `''` or "".
To make a new material, write an `event.create()` call in the registering function, like in the examples.
Write inside the parentheses the name of the material inside `''` or `""`.
(**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)

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

- `.ingot()` will make the material have both an ingot and dust form.
- `.dust()` will make the material have a dust form. Don't use this together with `.dust()`.
- `.dust()` will make the material have a dust form. Don't use this together with `.ingot()`.
- `.gem()` will make the material have both a gem form and a dust form. Don't use those together with `.dust()` or `.ingot()`
- `.fluid()` will make the material have a fluid form.
- `.liquid()` will make the material have a liquid (fluid) form with liquid properties.
- `.gas()` will make the material have a gas (fluid) form with gas properties.
- `.plasma()` will make the material have a plasma (fluid) form with plasma properties.
- `.polymer()` will make the material have a dust form with polymer properties.
- `.burnTime(burn time in ticks)` will turn the material into a furnace fuel.
- `.fluidBurnTime(burn time in ticks)` defines how long the fluid of the material will burn.
- `.burnTime(int burnTime)` will turn the material into a furnace fuel.
- `.fluidBurnTime(int burnTime)` defines how long the fluid of the material will burn.
- `.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.
- `.iconSet(set)` gives the material an icon set.
- `.color(color code)` gives the material a color. The color must be provided as a hex value in the following form: `0xNNNNNN`, where `N` are digits.
- `.secondaryColor(color code)` gives the material a secondary color. If this is not being called, the secondary value will default to white(0xffffff).
- `.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.
- `.secondaryColor(int colorCode)` gives the material a secondary color. If this is not being called, the secondary value will default to white(0xffffff).
- `.flags(flag1, flag2, ...)` can be used to select certain properties of the material, like generating gears, or disabling decomposition.
- `.element(element)` -> similar to `.components()`, but is used when the material represents an element.
- `.rotorStats(speed, damage, durability)` -> this will create a turbine rotor from this material.
Expand Down Expand Up @@ -64,7 +63,7 @@ You can change the properties of the material by adding any combination of the f
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).

!!! tip "Disabling Decomposition"
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.
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`

!!! tip "Choosing EU/t"
GT has some builtin constants to ease choosing the required EU/t:
Expand Down
2 changes: 1 addition & 1 deletion docs/Modpacks/Materials-and-Elements/Material-Flags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Flags
title: Material Flags
---


Expand Down
9 changes: 6 additions & 3 deletions docs/Modpacks/Materials-and-Elements/Material-Icon-Sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ The following icon sets are available by default:

## Custom Icon Sets

Custom iconsets can be specified as well, for example `GTMatericalIconSet.get('infinity')`.
Custom iconsets can be specified as well, using the `gtceu:matieral_icon_set` event:

```js
GTMaterialIconSet.get('')
```js title="custom_iconsets.js"
GTCEuStartupEvents.registry('gtceu:material_icon_set', event => {
event.create('starry')
.parent('shiny')
})
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Properties
title: Material Properties
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ All periodic table elements are present in GT, but some of them don't have any p
```js title="periodic_table_elements.js"
const $IngotProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.IngotProperty');
const $DustProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.DustProperty');
const $FluidProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty');
const $BlastProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.BlastProperty')
const $BlastProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.BlastProperty');

GTCEuStartupEvents.registry('gtceu:material', event => {

Expand All @@ -22,38 +21,53 @@ All periodic table elements are present in GT, but some of them don't have any p
// Dust
GTMaterials.Selenium.setProperty(PropertyKey.DUST, new $DustProperty());

// Fluid
GTMaterials.Iodine.setProperty(PropertyKey.FLUID, new $FluidProperty());
GTMaterials.Iodine.getProperty(PropertyKey.FLUID).storage.enqueueRegistration(GTFluidStorageKeys.LIQUID, new GTFluidBuilder());
GTMaterials.Oganesson.setProperty(PropertyKey.FLUID, new $FluidProperty());
GTMaterials.Iodine.getProperty(PropertyKey.FLUID).storage.enqueueRegistration(GTFluidStorageKeys.GAS, new GTFluidBuilder()); //Can be LIQUID, GAS, PLASMA or MOLTEN

// Blast Property
GTMaterials.Zirconium.setProperty(PropertyKey.BLAST, new $BlastProperty(8000, 'higher', GTValues.VA(GTValues.MV), 8000));

});
```

Adding fluids to existing materials requires a bit of work with the new FluidStorage system

```js title=fluid_property.js"

const $FluidProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty');
const $FluidBuilder = Java.loadClass('com.gregtechceu.gtceu.api.fluids.FluidBuilder');
const $FluidStorageKeys = Java.loadClass('com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys');

GTCEuStartupEvents.registry('gtceu:material', event => {
addFluid(GTMaterials.Iodine, $FluidStorageKeys.LIQUID); // Can be LIQUID, GAS, PLASMA or MOLTEN
addFluid(GTMaterials.Oganesson, $FluidStorageKeys.GAS);
}


let addFluid = (mat, key) => {
let prop = new $FluidProperty();
prop.getStorage().enqueueRegistration(key, new $FluidBuilder());
mat.setProperty(PropertyKey.FLUID, prop);
}
```
You can even add an ore to existing materials:
```js title="flags.js
```js title="ore_property.js"
GTCEuStartupEvents.registry('gtceu:material', event => {

const $OreProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty');

//Zinc Ore
// Zinc Ore
GTMaterials.Zinc.setProperty(PropertyKey.ORE, new $OreProperty());

});
```
You can also add flags to existing materials:
```js title="flags.js
```js title="flags.js"
GTCEuStartupEvents.registry('gtceu:material', event => {

GTMaterials.Lead.addFlags(GTMaterialFlags.GENERATE_GEAR); //This is for materials already in GTCEU
GTMaterials.get('custom_material_name').addFlags(GTMaterialFlags.GENERATE_FOIL); //This only works for materials added by GTCEU addons
GTMaterials.Lead.addFlags(GTMaterialFlags.GENERATE_GEAR); // This is for materials already in GTCEU
GTMaterials.get('custom_material_name').addFlags(GTMaterialFlags.GENERATE_FOIL); // This only works for materials added by GTCEU addons

});
```

0 comments on commit dbf88a8

Please sign in to comment.