forked from minetest-mods/cozy
Use mod.conf for dependencies, and description (#3)
This commit is contained in:
parent
26e9a32006
commit
b51cd0326c
@ -1,2 +0,0 @@
|
|||||||
default
|
|
||||||
player_monoids?
|
|
@ -1 +0,0 @@
|
|||||||
Adds sitting down, and lying down player animations.
|
|
16
init.lua
16
init.lua
@ -9,7 +9,7 @@ local function freeze(player)
|
|||||||
else
|
else
|
||||||
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
|
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
|
||||||
end
|
end
|
||||||
default.player_attached[player_name] = true
|
player_api.player_attached[player_name] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function unfreeze(player)
|
local function unfreeze(player)
|
||||||
@ -21,8 +21,8 @@ local function unfreeze(player)
|
|||||||
else
|
else
|
||||||
player:set_physics_override({speed = 1, jump = 1, gravity = 1})
|
player:set_physics_override({speed = 1, jump = 1, gravity = 1})
|
||||||
end
|
end
|
||||||
default.player_attached[player_name] = nil
|
player_api.player_attached[player_name] = nil
|
||||||
default.player_set_animation(player, "stand", 30)
|
player_api.set_animation(player, "stand", 30)
|
||||||
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})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
local player = players[i]
|
local player = players[i]
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local control = player:get_player_control()
|
local control = player:get_player_control()
|
||||||
if default.player_attached[name] and not player:get_attach() and (
|
if player_api.player_attached[name] and not player:get_attach() and (
|
||||||
control.up == true or
|
control.up == true or
|
||||||
control.down == true or
|
control.down == true or
|
||||||
control.left == true or
|
control.left == true or
|
||||||
@ -48,11 +48,11 @@ minetest.register_chatcommand("sit", {
|
|||||||
description = "Sit down",
|
description = "Sit down",
|
||||||
func = function(name)
|
func = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if default.player_attached[name] then
|
if player_api.player_attached[name] then
|
||||||
unfreeze(player)
|
unfreeze(player)
|
||||||
else
|
else
|
||||||
freeze(player)
|
freeze(player)
|
||||||
default.player_set_animation(player, "sit", 30)
|
player_api.set_animation(player, "sit", 30)
|
||||||
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})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -62,11 +62,11 @@ minetest.register_chatcommand("lay", {
|
|||||||
description = "Lay down",
|
description = "Lay down",
|
||||||
func = function(name)
|
func = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if default.player_attached[name] then
|
if player_api.player_attached[name] then
|
||||||
unfreeze(player)
|
unfreeze(player)
|
||||||
else
|
else
|
||||||
freeze(player)
|
freeze(player)
|
||||||
default.player_set_animation(player, "lay", 0)
|
player_api.set_animation(player, "lay", 0)
|
||||||
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})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user