Commit Graph

27 Commits

Author SHA1 Message Date
Treer 52038017f3
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.
2021-07-18 16:44:37 +10:00
Treer 4b508f8492 Update README.md 2021-01-15 00:29:23 +11:00
Treer 02d062b9c9 Handle large protected depths
Portals will now fail to ignite instead of defaulting to a fallback depth of (starty - 256) when no unprotected target can be found.
The search depth is also increased from (starty - 256) to (starty - 646)

This is to properly handle large protected areas that are sometimes set up at spawn - see issue #26
2020-08-02 12:19:30 +10:00
Treer 5b3b56ebec
Respect protected areas when spawning remote portals (#27)
* respect protected areas when spawning remote portals

* Use portal_shape to determine area to check for natural/protected

* Log warning on deprecated function call
2020-07-26 14:34:06 +10:00
Treer 0e26770830
Merge pull request #18 from Treer/feature/portals-api-facedir-support
Add facedir support to Portals API
2020-06-01 22:08:15 +10:00
Treer e5fbc2486b Allow a colorfacedir color to be specified for a portal's frame node
A color could also be specified via param2 in a portal schematic.
2020-05-31 19:48:26 +10:00
Treer f7ebd78614 New/extra portal animation
(new animation by Extex101)
The original texture is now "nether_portal_alt.png", and used to provide a "nether:portal_alt" node, which is used/demoed by the Surface-portal as the original animation still has a "it's full of stars" charm coming out when used for lighter coloured portals.
2020-05-31 09:31:16 +02:00
Treer 7939161535 API improvements
Improvements found while using the portals API in another mod (cloudlands):
* remote_portal_checkup() will check the whole portal and frame for mapgen overwrites.
* Allow find_realm_anchorPos() to return nil if no realm location could be found (portal will fail to ignite).
* Allow create_book_of_portals() to be invoked [indirectly] by other mods.

Also lowers nether_book_close.png to be 4bpp
2020-02-15 10:55:37 +01:00
Treer 32e5d818e8 Use lua schematics instead of .mts files when building portals
Removes the need for the get_malleated_schematic_filename hack
2020-02-15 10:55:37 +01:00
Treer 39d655b4c8 Add Help-modpack support
https://forum.minetest.net/viewtopic.php?t=15912
Don't place Book of Portals in dungeon chests if its contents can be written in the help modpack Encyclopedia instead, and don't add Book of Portals to dungeon chests if Nether portals are the only type of portal - A Nether mod doesn't need a Book of Portals if it's only being used to provide a Nether portal.
2020-02-15 10:55:37 +01:00
Treer 36d1f6f573 Images instead of ASCII diagrams in Book of Portals 2020-02-15 10:55:37 +01:00
Treer 363872c760 Avoid storing the playerRef
See https://rubenwardy.com/minetest_modding_book/en/quality/common_mistakes.html#never-store-objectrefs-ie-players-or-entities
Related: https://github.com/minetest-mods/nether/pull/12
2020-02-15 10:55:37 +01:00
Treer 40913ee841 text changes
Also a minor change to prevent surface portals from appearing in a grid pattern in MT 0.4
2020-02-15 10:55:37 +01:00
Treer e765f5f504 text/docs/formatting changes 2020-02-15 10:55:37 +01:00
Treer 1d19546345 Update copyrights & require Minetest v0.4.16 or greater
Also adds nether.register_wormhole_node(), moving the wormhole node template into portal_api.lua, and allowing wormhole nodes with custom post_effect_color to be more easily created.
2020-02-15 10:55:37 +01:00
Treer 6752964c96 Add PortalShape_Platform
and other work on the portal examples
also documentation and fixing issue where apples prevented volume_is_natural() from returning true
2020-02-15 10:55:37 +01:00
Treer 11a818212a Standardize files as LF without CR, and UTF-8 without BOM
UTF-8 with BOM crashes some systems according to 6551f5c120 comment, and there are several cases where Minetest is buggy with files that use CRLF line endings (though none I'm aware that affect these files), so strip CRs and BOM
2020-02-15 10:55:37 +01:00
Treer 58eb65c0c8 documentation 2020-02-15 10:55:37 +01:00
Treer 6e0cadb1ec Check no other mod is already using a portal definition 2020-02-15 10:55:37 +01:00
Treer b8ec09f402 Add animated particle support
Also implements an ignition failure sound.
2020-02-15 10:55:37 +01:00
Treer d5a551b4cf Add example alternative shape PortalShape_Circular
Also fixes up a few bugs that only became apparent when not using the traditional portal shape
2020-02-15 10:55:37 +01:00
Treer 7cff6b8cc2 Add portal ignition sparks 2020-02-15 10:55:37 +01:00
Treer e2666146ca Implement sound and events in API 2020-02-15 10:55:37 +01:00
Treer 52b20925d5 Unlinks target portal if it's linked to a different portal
This is effectively a missing part to the change that made locate_or_build_portal() enforce that portals only link together in mutual pairs. As target portals that didn't need to be located or built we not being updated to link back to where the player travelled from.

Also
* implements events: on_run_wormhole, on_extinguish
* adds a lot of debug info
2020-02-15 10:55:37 +01:00
Treer 6401052f92 fix bugs
fixes nullreference in find_surface_target_y, and ensure_remote_portal_then_teleport assuming a traditional portal shape.
minor documentation work.
2020-02-15 10:55:37 +01:00
Treer 1a6d15def3 Portals connect to nearby targets
Records portal positions. More testing required
2020-02-15 10:55:37 +01:00
Treer b6e2a3335a provide Portal API 2020-02-15 10:55:37 +01:00