1
0
Fork 0

Fix mounting while flying (partially fixes #1) and add title to the mod.conf

big thanks to cora!
This commit is contained in:
Mikita Wiśniewski 2022-05-16 18:58:40 +07:00
parent 04d7596b54
commit 0185f69567
2 changed files with 8 additions and 3 deletions

View File

@ -25,7 +25,7 @@ local function actionbar_show_status(player)
elseif minetest.get_modpath("mcl_tmp_message") then
mcl_tmp_message.message(player, S("Move to stand up"))
else
minetest.log("warning", "Didn't found any mod to set titles in actionbar (mcl_title or mcl_tmp_message)!")
minetest.log("warning", "[mcl_cozy] Didn't found any mod to set titles in actionbar (mcl_title or mcl_tmp_message)!")
end
end
@ -38,7 +38,8 @@ minetest.register_globalstep(function(dtime)
players[i]:get_player_control().down == true or
players[i]:get_player_control().left == true or
players[i]:get_player_control().right == true or
players[i]:get_player_control().jump == true) then
players[i]:get_player_control().jump == true or
players[i]:get_player_control().sneak == true) then
players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
players[i]:set_physics_override(1, 1, 1)
mcl_player.player_attached[name] = false
@ -51,6 +52,8 @@ minetest.register_chatcommand("sit", {
description = S("Sit down"),
func = function(name)
local player = minetest.get_player_by_name(name)
-- check the node below player (and if it's air, just don't sit)
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
if mcl_player.player_attached[name] then
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
player:set_physics_override(1, 1, 1)
@ -72,6 +75,7 @@ minetest.register_chatcommand("lay", {
description = S("Lay down"),
func = function(name)
local player = minetest.get_player_by_name(name)
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
if mcl_player.player_attached[name] then
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
player:set_physics_override(1, 1, 1)

View File

@ -1,4 +1,5 @@
name = mcl_cozy
title = MineClone2 Get Comfortable
description = Sit and lay using chat commands
depends = mcl_player
depends = mcl_player, mcl_playerinfo
optional_depends = mcl_title, mcl_tmp_message