Commit Graph

153 Commits

Author SHA1 Message Date
Treer
ab4a031c1c Fix Out Of Memory issue
Also another naming convention update - it's been get_3d_map_flat() sin Jan 2018.
2020-06-18 00:41:07 +10:00
Treer
aac3ea6719
Merge pull request #13 from Treer/feature/biome_mapgen
Switch mapgen to using biomes (still with backwards compatibility)
2020-06-08 21:05:16 +10:00
Treer
f4255f5d1f Add biomes-based implementation of the mapgen, and decorations
Prevents the c++/native mapgen from placing ores or decorations (when useBiomes is true).
The biomes-based implementation is faster, more deterministic, and keeps its dungeons, but requires MT 5.1 features to work.

Also
 * Glowstone & Netherrack stalactites
 * Include the new decorations in mapgen_nobiomes
 * Decorate dungeons - Add windows and glowstone "chandeliers" to some rooms
 * Configurable Nether floor and ceiling depths
2020-06-08 21:00:58 +10:00
Treer
94222d44e0 Preserve original mapgen as a "nobiomes" version
For v6 mapgen which doesn't support biomes, or MT versions prior to 5.1 which don't support the necessary biome features
2020-06-05 19:36:30 +10:00
Treer
86105b4eb8 fix lighting bug in mapgen
Removes hard black edges appearing at emerge boundaries.
2020-06-05 19:32:14 +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
Ward Vandewege
608d692401 Fix logic bug in parsing of nether_realm_enabled
The second argument of minetest.settings:get_bool is the default value (for when the configuration value is not set). Remove the superfluous `or nether.NETHER_REALM_ENABLED` which rendered the config option useless, because it always forced the variable to true.
2020-05-31 09:40:23 +02: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
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
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
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