forked from rudzik8/mcl_decor
Display movement notice in HUD instead of chat
This commit is contained in:
parent
c5fafbb2ce
commit
87253ca16a
9
api.lua
9
api.lua
|
@ -5,9 +5,14 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
-- originally from the ts_furniture mod (which is from cozy) by Thomas--S // <https://github.com/minetest-mods/ts_furniture/>
|
||||
mcl_decor.sit = function(pos, _, player)
|
||||
local name = player:get_player_name()
|
||||
if not player or not name then
|
||||
return false
|
||||
end
|
||||
if not mcl_player.player_attached[name] then
|
||||
if vector.length(player:get_player_velocity()) > 0 then
|
||||
minetest.chat_send_player(player:get_player_name(), S("You have to stop moving before sitting down!"))
|
||||
-- check movement
|
||||
if vector.length(player:get_velocity() or player:get_player_velocity()) > 0.125 then
|
||||
--minetest.chat_send_player(name, S("You have to stop moving before sitting down!"))
|
||||
mcl_title.set(player, "actionbar", {text=S("You have to stop moving before sitting down!"), color="white", stay=60})
|
||||
return
|
||||
end
|
||||
player:move_to(pos)
|
||||
|
|
2
mod.conf
2
mod.conf
|
@ -1,4 +1,4 @@
|
|||
name = mcl_decor
|
||||
description = Adds more decoration and furniture blocks to MineClone 2 (5)
|
||||
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs
|
||||
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs, mcl_title
|
||||
optional_depends = mcl_cozy, mcl_mushroom
|
||||
|
|
Loading…
Reference in New Issue