Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_node("luxury_decor:luxury_wooden_chair_with_cushion", {
- description = "Luxury Wooden Chair (with cushion)",
- visual_scale = 0.5,
- mesh = "luxury_wooden_chair_with_cushion.obj",
- tiles = {"luxury_wooden_chair_with_cushion.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {snappy = 1.2},
- drawtype = "mesh",
- collision_box = {
- type = "fixed",
- fixed = {
- {-0.3, -0.5, -0.25, 0.45, 0.22, 0.38},
- {-0.3, -0.5, 0.38, 0.45, 1, 0.48}
- --[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
- {-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
- }
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.3, -0.5, -0.25, 0.45, 0.22, 0.38},
- {-0.3, -0.5, 0.38, 0.45, 1, 0.48}
- }
- },
- sounds = default.node_sound_wood_defaults(),
- on_right_click = function (pos, node, clicker, itemstack, pointed_thing)
- local meta = clicker:get_meta()
- local is_attached_to = minetest.deserialize(meta:get_string("attached_to"))
- if is_attached_to == nil or is_attached_to == "" then
- chairs.sit_player(clicker, {pos, node.name, node.param1, node.param2}, {x=pos.x, y=pos.y+0.4, z=pos.z}, {x=81, y=81})
- elseif clicker:get_player_name() ~= is_attached_to[3] and is_attached_to ~= nil then
- minetest.chat_send_player(clicker:get_player_name(), "This bed is already busy!")
- elseif clicker:get_player_name() == is_attached_to[3] and pos == is_attached_to[1][1] and minetest.get_node(pos).name == is_attached_to[1][2] then
- chairs.standup_player(clicker)
- end
- --[[if minetest.get_node(pos).name ~= node.name then
- is_chair_busy_by = nil
- clicker:set_physics_override({speed=1.0})
- default.player_set_animation(clicker, "stand", 30)
- end]]
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement