mirror of
https://github.com/minetest-mods/nether.git
synced 2025-07-02 00:10:32 +02:00
Make ShiftExistingBiomes available via API (#40)
* bug fixes Fixes wrong new_y_min when shift_existing_biomes() shifts a biome below the nether floor, find_surface_anchorPos() no longer assumes y=0 will be outside the nether. Nil-reference fixed when a mods tries to register a portal after mods are finished loading, but the portal shape+material was already registered by another mod. * Make ShiftExistingBiomes available via API makes the ShiftExistingBiomes function available to other mods via the nether global, since it's not a simple function and biomes would also need to be shifted if another mod wants to add a second nether layer. * Allow layers to extend the depth of nether effects Mods can set/lower nether.DEPTH_FLOOR_LAYERS when creating a layer under the nether. This allows multiple layer mods to know where their ceiling should start, and to be included in the effects which only happen in the nether. * document nether API More of a tentative interop guide than an API. Use snake_case for API functions.
This commit is contained in:
@ -2073,7 +2073,7 @@ function nether.register_portal(name, portaldef)
|
||||
end
|
||||
|
||||
portaldef.name = name
|
||||
portaldef.mod_name = minetest.get_current_modname()
|
||||
portaldef.mod_name = minetest.get_current_modname() or "<mod name not recorded>"
|
||||
|
||||
-- use portaldef_default for any values missing from portaldef or portaldef.sounds
|
||||
if portaldef.sounds ~= nil then setmetatable(portaldef.sounds, {__index = portaldef_default.sounds}) end
|
||||
|
Reference in New Issue
Block a user