Commit Graph

58 Commits

Author SHA1 Message Date
bri cassa 23a6919a49 Merge remote-tracking branch 'upstream/master' 2021-07-24 13:09:07 +02:00
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
bri cassa dc21f026f6 Merge remote-tracking branch 'upstream/master' 2021-07-16 23:50:56 +02:00
tenplus1 b90afa0b86 fix nil bug in portal_api.lua
fixes a nil bug in portal_api.lua where nodedef.is_ground_content isn't available.
2021-07-08 10:14:24 +10:00
sys4-fr fb6b666895
Fix deprecation warnings (#44)
Co-authored-by: sys4 <bricassa@sys4.fr>
2021-04-18 16:30:05 +02:00
bri cassa 96ef16bf2a Merge branch 'github' 2021-03-26 19:29:39 +01:00
bri cassa 44f3912add Check minetest.features for use_texture_alpha_string_modes 2021-03-26 19:14:30 +01:00
bri cassa 4ff727909c Merge branch 'github' 2021-03-25 20:59:49 +01:00
bri cassa 7f5b4277dd Remove obsolete 'alpha' field 2021-03-25 20:57:23 +01:00
bri cassa 733ac1690a Merge branch 'github' 2021-03-21 11:06:39 +01:00
bri cassa 3b3fb6d1dd Fix deprecated use of use_texture_alpha in default portal def. 2021-03-21 11:05:14 +01:00
Sys Quatre 60d4f8c7df Merge remote-tracking branch 'upstream/master' 2020-09-28 20:48:55 +02:00
Louis 1268049706 Remove string.lower so item name is correctly translated 2020-09-28 00:07:03 +10:00
Sys Quatre 281d6fc07f Merge remote-tracking branch 'upstream/master' 2020-08-02 14:07:44 +02: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
Sys Quatre 97cf3250e4 Merge remote-tracking branch 'upstream/master' 2020-07-31 22:23:04 +02:00
Treer e326a94266
Add nether.debug() (#28) 2020-07-26 15:07:39 +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
Sys Quatre c0481ea4ca Fix mods comp. using callback on_rightclick with mese fragment 2020-07-15 01:46:52 +02: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 e113db1478 Add facedir support to Portals API
Portal shematics include facedir information for when new portals are spawned using frame nodes that are facedir or colorfacedir
2020-03-04 00:31:33 +11: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 aa2bfe9472 prevent obscure portal behaviour bug
If a portal is being ignited and portal frame near-but-not-at its destination was found that was active and already linked back to the local portal, it would cause the local portal to be extinguished. (Required the remote portal to somehow be in a different state from the portal it was linking to)
2020-02-15 10:55:37 +01:00
Treer 4c3545f17a drop portal shape images to 2bit
Save some bits. Unfortunately PNG can't do 3bit-indexed images :(
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 0618325710 API exposes the registered portal count, and frame nodes 2020-02-15 10:55:37 +01:00
Treer 8f29a35175 use minetest.get_modpath("mesecon") instead of checking mesecon ~= nil 2020-02-15 10:55:37 +01:00
Treer e3ac1ade79 blasts extinguish 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 58da96549a Trim trailing spaces
This eliminates most luacheck formatting warnings
2020-02-15 10:55:37 +01:00
Treer d0ce9dd633 Update .luacheckrc and fix warnings
Changes to reduce formatting warnings will be committed separately
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 3945467152 Add more mesecon support
wormholes now emit mesecon energy, allowing mesecons to know the state of the portal.
(mesecons could previously only set the state of the portal)
2020-02-15 10:55:37 +01:00
Treer 478684062d Add Minetest 0.4 support 2020-02-15 10:55:37 +01:00
Treer 4ebdf7f25f Handle edge-case when player quits the game while teleporting
Issue was raised as a pull request against the original code - https://github.com/minetest-mods/nether/pull/12
Also replaces deprecated getpos/setpos with get_pos/set_pos - https://github.com/minetest-mods/nether/pull/11
2020-02-15 10:55:37 +01:00
Treer 4985e199b1 check for portal frames on the surface
When a surface level was known, only the volume_is_natural check was being performed, this fixes that.
Also fixes bug where LBM didn't start the timer of example portals that had been disabled.
Allows portal ignite to repair a stopped timer.
Other misc cleanup - paramat's new Floatlands won't have lakes so I removed that from the flavortext.
2020-02-15 10:55:37 +01:00
Treer 48cbd87b59 Move wormhole_node_is_horizontal into the shape definition
out of the portal defintion
2020-02-15 10:55:37 +01:00
Treer a971e0359e Finish example portals
give nether_portal_circular.mts a flat floor - the new nether_portal_circular.mts allows its bottom nodes to be sunk into the ground.
Example portal basic behavior and book_of_portals_pagetext implemented.
Other changes are allowing portals corrupted by ABMs to be repaired, finding better ground level of surface portals.
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 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 31cf6a9bc3 Place_Schematic uses correct frame and wormhole nodes
This requires a cache-invalidation hack borrowed from cloudlands mod.
Also, null reference fixes in ensure_remote_portal_then_teleport and locate_or_build_portal, and minor improvements
2020-02-15 10:55:37 +01:00
Treer dd6c19d005 Keep portal type in metadata for non-traditional portals
Makes the portal system more flexible - new portal shapes don't have to ensure there's a frame node at the timerPos
2020-02-15 10:55:37 +01:00
Treer 835ad9686d rearrange code
eliminate need to assign extinguish_portal() to a local var, and group the helper functions together in the API section
2020-02-15 10:55:37 +01:00