Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

3 changed files with 7 additions and 16 deletions

View File

@ -1,7 +1,4 @@
# MineClone2 Get Comfortable # MineClone2 Get Comfortable
**Migrated, see <https://codeberg.org/rudzik8/mcl_cozy>**
[![ContentDB](https://content.minetest.net/packages/rudzik8/mcl_cozy/shields/downloads/)](https://content.minetest.net/packages/rudzik8/mcl_cozy/) [![ContentDB](https://content.minetest.net/packages/rudzik8/mcl_cozy/shields/downloads/)](https://content.minetest.net/packages/rudzik8/mcl_cozy/)
Adds commands to /lay or /sit to the MineClone 2/5/a game. Port of good old [cozy mod](https://forum.minetest.net/viewtopic.php?f=11&t=14143) (originally made for MTG by everamzah) to work with MCL properly and even provide some nice new features! Adds commands to /lay or /sit to the MineClone 2/5/a game. Port of good old [cozy mod](https://forum.minetest.net/viewtopic.php?f=11&t=14143) (originally made for MTG by everamzah) to work with MCL properly and even provide some nice new features!

View File

@ -41,16 +41,14 @@ minetest.register_globalstep(function(dtime)
players[i]:get_player_control().jump == true or players[i]:get_player_control().jump == true or
players[i]:get_player_control().sneak == true) then 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_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
playerphysics.remove_physics_factor(players[i], "speed", "mcl_cozy:attached") players[i]:set_physics_override({speed=1, jump=1, gravity=1})
playerphysics.remove_physics_factor(players[i], "jump", "mcl_cozy:attached")
mcl_player.player_attached[name] = false mcl_player.player_attached[name] = false
mcl_player.player_set_animation(players[i], "stand", 30) mcl_player.player_set_animation(players[i], "stand", 30)
end end
-- check the node below player (and if it's air, just unmount) -- check the node below player (and if it's air, just unmount)
if minetest.get_node(vector.offset(players[i]:get_pos(),0,-1,0)).name == "air" then if minetest.get_node(vector.offset(players[i]:get_pos(),0,-1,0)).name == "air" then
players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0}) players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
playerphysics.remove_physics_factor(players[i], "speed", "mcl_cozy:attached") players[i]:set_physics_override({speed=1, jump=1, gravity=1})
playerphysics.remove_physics_factor(players[i], "jump", "mcl_cozy:attached")
mcl_player.player_attached[name] = false mcl_player.player_attached[name] = false
end end
end end
@ -64,15 +62,13 @@ minetest.register_chatcommand("sit", {
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
if mcl_player.player_attached[name] then 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_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
playerphysics.remove_physics_factor(player, "speed", "mcl_cozy:attached") player:set_physics_override({speed=1, jump=1, gravity=1})
playerphysics.remove_physics_factor(player, "jump", "mcl_cozy:attached")
mcl_player.player_attached[name] = false mcl_player.player_attached[name] = false
mcl_player.player_set_animation(player, "stand", 30) mcl_player.player_set_animation(player, "stand", 30)
print_action_stand(name) print_action_stand(name)
else else
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0}) player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
playerphysics.add_physics_factor(player, "speed", "mcl_cozy:attached", 0) player:set_physics_override({speed=0, jump=0, gravity=0})
playerphysics.add_physics_factor(player, "jump", "mcl_cozy:attached", 0)
mcl_player.player_attached[name] = true mcl_player.player_attached[name] = true
mcl_player.player_set_animation(player, "sit", 30) mcl_player.player_set_animation(player, "sit", 30)
print_action_sit(name) print_action_sit(name)
@ -88,15 +84,13 @@ minetest.register_chatcommand("lay", {
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
if mcl_player.player_attached[name] then 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_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
playerphysics.remove_physics_factor(player, "speed", "mcl_cozy:attached") player:set_physics_override({speed=1, jump=1, gravity=1})
playerphysics.remove_physics_factor(player, "jump", "mcl_cozy:attached")
mcl_player.player_attached[name] = false mcl_player.player_attached[name] = false
mcl_player.player_set_animation(player, "stand", 30) mcl_player.player_set_animation(player, "stand", 30)
print_action_stand(name) print_action_stand(name)
else else
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0}) player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
playerphysics.add_physics_factor(player, "speed", "mcl_cozy:attached", 0) player:set_physics_override({speed=0, jump=0, gravity=0})
playerphysics.add_physics_factor(player, "jump", "mcl_cozy:attached", 0)
mcl_player.player_attached[name] = true mcl_player.player_attached[name] = true
mcl_player.player_set_animation(player, "lay", 0) mcl_player.player_set_animation(player, "lay", 0)
print_action_lay(name) print_action_lay(name)

View File

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