Overriding on_generated function of the vacuum mod

Post Reply
Red_King_Cyclops
Member
Posts: 324
Joined: Sun Jun 16, 2019 20:17
Location: x=123, y=120, z=534

Overriding on_generated function of the vacuum mod

by Red_King_Cyclops » Post

I'm working on a mod that depends on vacuum. The vacuum mod has an on_generated function that simply replaces all air blocks with vacuum blocks above a certain y-height. For the mod I am making, there needs to be certain "y-levels" that contain air but are surrounded by vacuum "y-levels." To do this, should I override vacuum's on_generated function, or should I make a second on_generated function that replaces certain vacuum blocks with air blocks?
Currently working on new mods.

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Overriding on_generated function of the vacuum mod

by Krock » Post

Registering a new on_generated callback would be the sane solution here. Another option would be to hijack the already registered callbacks and calling them manually before yours depending on the Y value, but I'd not recommend to do that unless you're forced to use plain Lua (no JIT).
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests