diff --git a/docs/Modpacks/Materials-and-Elements/01-Material-Creation.md b/docs/Modpacks/Materials-and-Elements/01-Material-Creation.md index 12afce4..68fac55 100644 --- a/docs/Modpacks/Materials-and-Elements/01-Material-Creation.md +++ b/docs/Modpacks/Materials-and-Elements/01-Material-Creation.md @@ -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. @@ -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: diff --git a/docs/Modpacks/Materials-and-Elements/Material-Flags.md b/docs/Modpacks/Materials-and-Elements/Material-Flags.md index b90fd24..b64387b 100644 --- a/docs/Modpacks/Materials-and-Elements/Material-Flags.md +++ b/docs/Modpacks/Materials-and-Elements/Material-Flags.md @@ -1,5 +1,5 @@ --- -title: Flags +title: Material Flags --- diff --git a/docs/Modpacks/Materials-and-Elements/Material-Icon-Sets.md b/docs/Modpacks/Materials-and-Elements/Material-Icon-Sets.md index 5df634c..28177d3 100644 --- a/docs/Modpacks/Materials-and-Elements/Material-Icon-Sets.md +++ b/docs/Modpacks/Materials-and-Elements/Material-Icon-Sets.md @@ -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') +}) ``` diff --git a/docs/Modpacks/Materials-and-Elements/Material-Properties.md b/docs/Modpacks/Materials-and-Elements/Material-Properties.md index cbeaacc..b9903d3 100644 --- a/docs/Modpacks/Materials-and-Elements/Material-Properties.md +++ b/docs/Modpacks/Materials-and-Elements/Material-Properties.md @@ -1,5 +1,5 @@ --- -title: Properties +title: Material Properties --- diff --git a/docs/Modpacks/Materials-and-Elements/Modifying-Existing-Materials.md b/docs/Modpacks/Materials-and-Elements/Modifying-Existing-Materials.md index a664513..c139b80 100644 --- a/docs/Modpacks/Materials-and-Elements/Modifying-Existing-Materials.md +++ b/docs/Modpacks/Materials-and-Elements/Modifying-Existing-Materials.md @@ -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 => { @@ -22,26 +21,41 @@ 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()); }); @@ -49,11 +63,11 @@ You can even add an ore to existing materials: 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 }); ```