forked from rudzik8/mcl_decor
Add early implementation of sitting by right-click
currently uses function from homedecor_seating/armchairs.lua... need to work on it
This commit is contained in:
parent
525d1f37c3
commit
13201c0b98
11
api.lua
11
api.lua
|
@ -33,7 +33,16 @@ function mcl_decor:register_chair(name, def)
|
|||
_mcl_hardness = def._mcl_hardness,
|
||||
_mcl_blast_resistance = def._mcl_blast_resistance,
|
||||
sounds = def.sounds,
|
||||
-- TODO: make player sit on the chair by rightclick (maybe via homedecor funcs?)
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if not clicker:is_player() then
|
||||
return itemstack
|
||||
end
|
||||
mcl_player.player_set_animation(clicker, "sit_mount", 30)
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue