Commit Graph

180 Commits

Author SHA1 Message Date
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 43f1f24d53 Add settingtypes.txt settings 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 b9e85582f9 Add Surface-following portal using Moore curves 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 9bfbb64e96 Add portal_examples.lua
Currently the example portals just take you to the nether, like nether portals. In theory they could take players anywhere.
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 0f3f42e5c0 Add portal sounds 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 7cff6b8cc2 Add portal ignition sparks 2020-02-15 10:55:37 +01:00
Treer 27a660b731 Unroll 32affba6 (stairs) (#9)
32affba6 re-registered stairs which have already been registered 20 lines earlier in the code, and registered them as "brick" causing the netherbrick stairs to replace Minetest's default:brick stairs. The rest of 32affba6 was already unrolled in 7a0e52da, but the stairs bug remained.
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
Treer e2666146ca Implement sound and events in API 2020-02-15 10:55:37 +01:00
Treer 0c7a6e95c5 Fix edge case
Fix bug where ensure_remote_portal_then_teleport() converted its destination_wormholePos to an anchorPos to pass to locate_or_build_portal() which converted it back to an wormholePos. Bug occurred when local_orientation was assumed for the target orientation, which could lead to locate_or_build_portal() ending up with a reconstituted wormholePos rotated outside the portal frame, not find a portal frame, so build a new portal there, griefing the old one.

locate_or_build_portal() has been refactored to take a wormholePos instead of an anchorPos, removing the need to know the orientation of the target portal (which can't be obtained from the param2 when the target portal is unlit)
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 c106b88e98 only perform remote_portal_checkup if portal schematic was placed 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 43b37e96b2 Add Book of Portals
Squashed commit of the following:

commit e80030750df91f75745c7d52729a0d4942eb32f8
Author: Treer <treer.git+github@the-bordello.com>
Date:   Sat Jul 13 13:52:02 2019 +1000

    Finish book of portals

commit 82ad3d6af683b6bb4cc107e8c76f44c0b791a28d
Author: Treer <treer.git@gmail.com>
Date:   Thu Jul 11 22:43:02 2019 +1000

    Book of Portals art

commit fac6ff1da89a1b06b78deb0b5b4e3bebe4166860
Author: Treer <treer.git@gmail.com>
Date:   Thu Jul 11 00:39:50 2019 +1000

    starting book of portals
2020-02-15 10:55:37 +01:00
Treer b6e2a3335a provide Portal API 2020-02-15 10:55:37 +01:00
Treer 3126d067a1 Dynamic/hardware portal colouring
Currently proof of concept: Removes wormhole colour from .png texture and specifies it through MT API instead. The post_effect_color may call for registering a separate node per portal colour.
Palette 0 will have to be the traditional portal magenta (instead of 0 being black) for map compatibility with mod when colour was in the texture and not param2.
2020-02-15 10:55:37 +01:00
Treer 83c9ad574f Allow two or more portal types to be made with the same frame material
(provided they are different sized portals)
Removes direct references to the registered_portals table
2020-02-15 10:55:37 +01:00
Treer f38211e55d Prevent portals from sharing frame nodes with other portals
While it's rather cute having portals that share parts of their frame with other portals, the way the nether mod implemented portals means a node being part of more than one portal enables a family of bugs.

Igniting a portal now extinguishes any portal that was using nodes now taken by the newly ignited portal.
2020-02-15 10:55:37 +01:00
Treer 2113d332f8 Spawn portals on the surface, when possible 2020-02-15 10:55:37 +01:00
Treer 9a4c7ed875 Fix call to node timer stop()
Part of e5a5db907, fixes an issue where node timers weren't stopped by extinguish_portal().
And tweaks some comments
2020-02-15 10:55:37 +01:00
Treer 59275bb242 tidy up some code 2020-02-15 10:55:37 +01:00
Treer c7d83eceb7 Prevent concurrent mapgen from removing freshly placed portals 2020-02-15 10:55:37 +01:00
Treer edf961907e Allow reignition of portals in player-built areas
e.g. allow remote ignition to a portal in a "portal room"
2020-02-15 10:55:37 +01:00
Treer 7a4d9ebf01 Issue #6 Replace ABM with single node timer
https://github.com/minetest-mods/nether/issues/6
2020-02-15 10:55:37 +01:00
Treer a085e194fa Add mesecons support
Portals can be switched on and off with mesecons
(from a tech-tree perspective, mese is still required for portal ignition)
2020-02-15 10:55:37 +01:00
Treer 614a3f91a7 Separate portal shape code from portal behavior code, and refactor
Allows dev and testing/debugging to focus on one (shape or behavior) without getting mixed up in the other, will also enable different portal shapes later on. Other adjustments:
* Reuse/reignite an existing portal or portal frame if there is one at the remote destination, rather than the area being overwritten by a slightly offset portal schematic.
* Create remote portals in a matching orientation to the local portal.
* Preserve player position & facing relative to portal when traveling through wormhole (even if portals are at 90°)
* Players no longer bounce several times after teleporting
* Player is not teleported until after the portal at the other end is confirmed/built
2020-02-15 10:55:37 +01:00
ㄗㄠˋ ㄑㄧˊ b49f4ce73d Fix error caused by teleporting offline players (#12) 2020-01-08 18:56:49 +01:00
SmallJoker 6551f5c120 Convert UTF-8 + BOM to UTF-8. Fixes crash on some systems 2019-08-01 18:25:25 +02:00
Treer b8dab52e41 Unroll 32affba6 (stairs) (#9)
32affba6 re-registered stairs which have already been registered 20 lines earlier in the code, and registered them as "brick" causing the netherbrick stairs to replace Minetest's default:brick stairs. The rest of 32affba6 was already unrolled in 7a0e52da, but the stairs bug remained.
2019-07-20 08:56:32 +02:00
Treer bf145d4c11 Fix portal particle spawners
Issue introduced in 0b6925f4b1. Fix tested in 4.17.1 and 5.1-dev
2019-06-26 19:04:02 -07:00
Auke Kok 2d94d74d97 Fix #1. 2017-12-20 20:52:57 -08:00
Auke Kok 57b2d30b9e Override mese crystal fragment, use new settings API.
Thanks to Julien Puydt
2017-12-19 21:39:29 -08:00
Auke Kok 0b6925f4b1 Fixes old bug id #21 2017-12-19 21:35:05 -08:00
Auke Kok 7a0e52da46 Luacheck cleanups. 2017-12-19 21:31:53 -08:00