Modifying Existing Materials
All periodic table elements are present in GT, but some of them don't have any properties attached. You can also add a BlastProperty for EBF autogenerated recipes. You can also do this for other materials such as Obsidian. Here is how you can add them:
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')
GTCEuStartupEvents.registry('gtceu:material', event => {
// Ingot
GTMaterials.Zirconium.setProperty(PropertyKey.INGOT, new $IngotProperty());
GTMaterials.Obsidian.setProperty(PropertyKey.INGOT, new $IngotProperty());
// 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));
});
You can even add an ore to existing materials:
```js title="flags.js GTCEuStartupEvents.registry('gtceu:material', event => {
const $OreProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty');
//Zinc Ore
GTMaterials.Zinc.setProperty(PropertyKey.ORE, new $OreProperty());
});
You can also add flags to existing materials:
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
});
```