More death messages, more reliable

This commit is contained in:
Wuzzy 2019-03-08 20:22:01 +01:00
parent db8d7af245
commit 20576431e1
12 changed files with 148 additions and 128 deletions

View file

@ -2,6 +2,6 @@ mcl_core
mcl_sounds
mcl_util
walkover
mcl_death_messages
mcl_death_messages?
doc_items
doc?

View file

@ -1,5 +1,7 @@
local S = minetest.get_translator("mcl_nether")
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
minetest.register_node("mcl_nether:glowstone", {
description = S("Glowstone"),
_doc_items_longdesc = S("Glowstone is a naturally-glowing block which is home to the Nether."),
@ -91,7 +93,9 @@ minetest.register_node("mcl_nether:magma", {
on_walk_over = function(loc, nodeiamon, player)
-- Hurt players standing on top of this block
if player:get_hp() > 0 then
mcl_death_messages.player_damage(player, string.format("%s stood too long on a magma block.", player:get_player_name()))
if mod_death_messages then
mcl_death_messages.player_damage(player, string.format("%s stood too long on a magma block.", player:get_player_name()))
end
player:set_hp(player:get_hp() - 1)
end
end,