Commit Graph

108 Commits

Author SHA1 Message Date
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 76708b02d5 Update the Readme 2022-08-20 20:19:58 +02: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 435cef6f81 Remove the unused vector_extras dependency 2022-08-20 19:20:13 +02:00
HybridDog 01cd7c8e5b New nether guide
* Remove code which uses the font size setting to position text and images. Instead use Minetest's hypertext formspec element
* Rewrite many parts of the guide contents, e.g. "you" -> "we", more detailed portal description
* Add a setting to permit viewing it in the overworld (enabled by default)
* Update the Readme

I have set the font size to 24, which works well for me on a 1920x1080 screen with somewhat high DPI. The text written in hypertext apparently ignores the Minetest font size setting, so it may look bad on different screens.
2022-08-19 18:14:44 +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 27be1dd740 Mention the problematic guide in the Readme 2021-12-22 19:07:12 +01: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 be64a982f8 Remove the invisible folder 2021-12-22 17:53:32 +01:00
HybridDog 56f5909e0f Relicense; WTFPL allows it 2021-12-22 17:45:59 +01:00
HybridDog 7cdd0471a2 depends.txt -> mod.conf 2021-12-22 17:44:27 +01:00
HybridDog b876d8f2b9 Move the mod description to the forum to reduce duplicate text 2021-12-22 17:39:40 +01:00
HybridDog 870b6a9d47 Fix nether leaves visual_scale
Also, update README
2019-03-10 12:35:51 +01:00
DS-Minetest 0d4a302103 fix creative dig 2018-09-10 00:10:11 +02: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
Hybrid Dog 5925dc5606 mapgen: Use buffers for memory usage optimisation 2018-03-18 18:39:44 +01:00
DS-Minetest 6e2ffa04ea guide: fix portal indrigents 2017-12-31 22:02:22 +01:00
Hybrid Dog 8a3d0b0634 Update debug messages 2017-12-26 09:58:32 +01:00
Hybrid Dog 2ce9440fdf Use the light update parameter of write_to_map instead of the obsolete update_map (vmanip)
And use minetest.fix_light instead of a custom function (surprisingly it didn't cause a noticeable performance difference)
Also, a few code style changes
2017-12-26 09:39:17 +01:00
Hybrid Dog 12dc8ae004 Fix code style
I've also made a few other changes:
Use minetest.pos_to_string instead of manually creating the string
Do not use table_contains to test if a node id belongs to a nether tree, instead use lua table hashmap behaviour
2017-12-26 09:19:11 +01:00
Hybrid Dog 69b3e65c85 Fix missing unknown node test in grass_allowed 2017-12-26 08:40:18 +01:00
Hybrid Dog 0a2dbbb0f8 Fix small stuff (thanks to warnings from luacheck) 2017-12-25 21:23:34 +01:00
Hybrid Dog 6019bbce66 Do not use old vector_extras functions 2017-12-25 21:22:32 +01:00
Megaf acdf694356 Fixes https://github.com/HybridDog/nether-pack/issues/6
```
Use:
local tab = minetest.wrap_text(content, guide_size.fx, true)
Needs 3rd argument 'true' to ensure 'tab' is a table.
See 649eef9e4f/builtin/common/misc_helpers.lua (L311)
```
2017-12-25 20:48:41 +01:00
DS d32ede7e8a make netherrack and co. digable with creative hand 2017-07-08 14:26:15 +02:00
DS-Minetest e8a666f34e replace deprecated setting methods 2017-07-05 18:52:46 +02:00
DS a7da195aa1 fix a crash caused by the none existing minetest.splittext function
It was replaced with minetest.wrap_text. Hopefully that won't make problems.
2017-07-05 18:38:38 +02:00
HybridDog afb77f0a1d Update README.md 2017-02-03 23:19:10 +01:00
HybridDog c33e306849 reduce index calculations (untested)
M  nether/init.lua
2016-09-15 11:57:06 +02:00
HybridDog dac86dae07 🐈
M  modpack.txt
2016-08-08 15:51:58 +02:00
HybridDog 6d92487f20 🐈 2016-05-26 12:17:06 +02:00
HybridDog 578919c469 fix old newbie mistake 2016-05-04 18:42:45 +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
crabman77 0e9bdc48b2 fix unknow item default:coal 2016-05-04 18:21:40 +02:00
HybridDog 501ce57e59 update readme 2016-05-04 18:18:04 +02:00
ObaniGemini 3ba23a4c88 New nether guide Much better formspecs based on original code Reworked many sentences 2016-05-04 18:11:02 +02:00
HybridDog 780b95bfbc further optimazion of ws func 2016-05-04 17:43:37 +02:00
HybridDog f3cec2fe06 🐈 2016-03-10 20:47:16 +01:00
HybridDog 06099dcec3 🐈 2016-02-06 12:04:17 +01:00