Commit Graph

31 Commits

Author SHA1 Message Date
Desour 0351e12bac Move mapgen code out of init.lua 2024-04-03 17:16:20 +02:00
Deathwing777 1c033a048f
Helper functions for other mods and an obsidian portal bugfix (#15)
* The obsidian portal is the first way for a player to reach the nether,
  so if damage is enabled and `nether.trap_players` is disabled,
  the obsidian portal should teleport the player instead of killing him/her
  since after death he/she respawns in the overworld and not in the nether.
  A small change in `obsi_teleport_player` fixes this problem.
  Fixes #16.
* There exist other mods which need to check if players are in the nether and
  teleport them to/from the nether, so we add four helper functions:
  `nether.is_player_in_nether`, `nether.is_player_trapped_in_nether`.
  `nether.external_nether_teleport` and `nether.registry_update`.
  Fixes #14.
* Add the `in_hell`, `trapped_in_hell` and `update_hells_registry` chat
  commands, which can be used for debugging
* `players_in_nether` has no meaningful effect if `nether.trap_players` is
  disabled, so we rename it to `players_trapped_in_nether`.
* Add `nether.bottom`, which approximately corresponds to the lower end of the
  nether
2024-02-29 21:05:03 +01:00
HybridDog 02d14a8970 Fix nether portal detection
The function which calculates positions of an empty square currently has a bug:
it returns the northeastern and southwestern corners twice
and omits the northwestern and southeastern ones.
This leads to a nether portal detection which is not rigorous enough, skipping eight nodes.

This commit fixes the problem.
Closes #13
2023-10-30 17:39:56 +01:00
HybridDog f12d33c743 Replace deprecated function names (e.g. moveto -> move_to) and make stairs optional 2022-08-20 20:11:35 +02:00
HybridDog 817efcdd29 Add settingtypes.txt to configure player trapping and message logging
There are also some changes to fix problems when trapping is enabled while damage is disabled or the other way round.
2022-08-16 17:25:41 +02:00
HybridDog 6507e43dc5 Do not ignore the portal code if damage is enabled and the "nether_players" file does not exist
I have accidentally introduced the bug in commit 4a7dd247e7.
It was discovered thanks to the people who reported it on the Minetest forum.
2022-08-15 15:47:16 +02:00
Desour 27bf94c4d0 Fix portal player y pos being off by 1 node sometimes 2022-07-26 17:52:25 +02:00
HybridDog c35d18a519 Fix some deprecation warnings 2021-12-22 18:46:56 +01:00
HybridDog fb1eca6c11 Add .luacheckrc and do some code fixes 2021-12-22 18:46:52 +01:00
HybridDog fadf202663 Fix object teleportation from and to nether 2018-08-18 20:00:40 +02:00
HybridDog df2d49edb0 Override player:set_pos etc. to disallow teleports from/to nether
constantly testing the player position is not longer necessary.
2018-08-15 19:52:39 +02:00
HybridDog 4a7dd247e7 Do not use players_in_nether as list but hashmap
Also, comment broken function
2018-08-15 17:31:15 +02:00
HybridDog 2f3522598c portal.lua: Fix some 80 char line breaks 2018-08-15 16:57:23 +02:00
HybridDog 020ab700ff Fix get_node vs get_node_or_nil usage 2018-08-15 16:52:04 +02:00
DS-Minetest e8a666f34e replace deprecated setting methods 2017-07-05 18:52:46 +02:00
HybridDog 03da51be24 add support to the function delayer mod 2016-05-04 18:36:22 +02:00
Wouters Dorian b2dd95eb50 Don't use globalsteps 2016-05-04 18:32:17 +02:00
HybridDog 99eceb10eb assume player:getpos always returns a vector
remove patch file
2016-05-04 18:27:36 +02:00
crabman77 2a3e553b9c fix crash nether if player cancel join server "/nether/portal.lua:243: attempt to index a nil value" 2016-05-04 18:24:57 +02:00
HybridDog 9cee9d0ec6 🐈 2016-01-04 13:25:06 +01:00
HybridDog 041f1ce21a untested: save known opposite portal y to meta 2016-01-04 12:00:35 +01:00
HybridDog b8f81b71bc make obsidian portal always work 2016-01-04 11:48:21 +01:00
HybridDog cacfae9502 add comments and begin making obsidian portal always work 2016-01-04 10:55:39 +01:00
HybridDog 524312a8d3 change nether pearl and portal.lua 2016-01-01 12:39:21 +01:00
HybridDog 6245b9e4e1 allow disabling killing of people using the simple portal 2015-12-31 15:15:39 +01:00
HybridDog 1003e8288c dont send players to hell if they execute those chatcommands without nether priv 2015-12-30 11:16:58 +01:00
HybridDog a0995f18f8 cache used portals instead of always teleporting to 100 etc 2015-12-28 20:04:38 +01:00
HybridDog 624cf7243d update chatcommand 2015-12-28 19:01:30 +01:00
HybridDog 1e0bcbb709 fix player doesnt hear nether teleporter sound, thanks to @crabman77 2015-12-28 18:38:09 +01:00
HybridDog b09a30c141 🐈 2015-05-29 12:08:27 +02:00
HybridDog 7c75dafcdb at least a bit history 2015-02-18 18:34:03 +01:00