Inspirational inspiration originated from the official document Kubejs · DRACKION/GTCEUM WIKI · Github
/ /
/ /
I found that when I wanted to customize a material, I found that the official documentation was a bit unclear, and I couldn't do the chemical equation of the custom material. Probejs did not associate the relevant statements, so I went through the Class file, oneIt's a month, and finally let me understand it
(Use Minecraft 1.20.1, Kubejs6)
//// and com.gregtechceu.gtceu.api.data.Chemical.mterial. Material.
GtceustApevents.regization ('Gtceu: Element', EVENT => {// Registration material
Event.create ('solarium', 13,14,60, null, 'so', false) // material name, proton number, neutron number, half -life (second), half -decline (none), chemical equation, whetherAshamed
// In fact, it has no effect on the attributes of the material
})
GtceustApevents.regization ('gtceu: material', event => {
Event.create ('Andesite_alloy')
.Ingot (1)
.Components ('1x Andesite', '1x Iron') // Direct use of raw materials cannot customize the formula
// You can find it in the game directly with component // You need to use custom materials in the component to allow custom materials to register before it
.Color (0x114514) .iconset (gtmaterialiconset.metallic).
Event.create ('solarium')
.Ingot (1)
.Element (gtelements.get ('solarium') // Use .elements.get (material name) to complete the custom chemical equation
.Color (0XFFEC8E) .iconset (gtmaterialiconset.dull).
})