#Issue by adding Fluid to Exsisting material

8 messages · Page 1 of 1 (latest)

dreamy compass
#

i run in to a issue by adding a fluid to a existing material with the sample from the wiki

    addFluid(GTMaterials.Sodium, $FluidStorageKeys.LIQUID); // Can be LIQUID, GAS, PLASMA or MOLTEN

    let addFluid = (mat, key) => {
        let prop = new $FluidProperty();
        prop.getStorage().enqueueRegistration(key, new $FluidBuilder());
        mat.setProperty(PropertyKey.FLUID, prop);
    }

feedback in game : Error in 'GTCEuStartupEvents.registry': TypeError: addFluid is not a function, it is undefined.

silver belfry
#

place the call after the declaration like so and try again

    let addFluid = (mat, key) => {
        let prop = new $FluidProperty();
        prop.getStorage().enqueueRegistration(key, new $FluidBuilder());
        mat.setProperty(PropertyKey.FLUID, prop);
    }
    addFluid(GTMaterials.Sodium, $FluidStorageKeys.LIQUID); // Can be LIQUID, GAS, PLASMA or MOLTEN
dreamy compass
#

okay it works, pls maket a note on the wiki for it thanks~ happy_cat

tranquil sky
#

(unless you got the original code from the wiki and that's wrong)

dreamy compass
tranquil sky
#

if you define it inside the event, it only works if it's before it