diff --git a/homedecor/misc-nodes.lua b/homedecor/misc-nodes.lua index ed0872b..739aa0c 100644 --- a/homedecor/misc-nodes.lua +++ b/homedecor/misc-nodes.lua @@ -1650,6 +1650,54 @@ minetest.register_node("homedecor:beer_tap", { selection_box = { type = "fixed", fixed = { -0.25, -0.5, -0.4375, 0.25, 0.235, 0 } + }, + on_punch = function(pos, node, puncher, pointed_thing) + local wielditem = puncher:get_wielded_item() + local inv = puncher:get_inventory() + + local wieldname = wielditem:get_name() + if wieldname == "vessels:drinking_glass" then + if inv:room_for_item("main", "homedecor:beer_mug 1") then + wielditem:take_item() + puncher:set_wielded_item(wielditem) + inv:add_item("main", "homedecor:beer_mug 1") + minetest.chat_send_player(puncher:get_player_name(), "Ahh, a frosty cold beer - look in your inventory for it!") + else + minetest.chat_send_player(puncher:get_player_name(), "No room in your inventory to add a beer mug!") + end + end + end +}) + +minetest.register_node("homedecor:beer_mug", { + description = "Beer mug", + tiles = { + "homedecor_beer_top.png", + "homedecor_beer_bottom.png", + "homedecor_beer_right.png", + "homedecor_beer_left.png", + "homedecor_beer_back.png", + "homedecor_beer_front.png" + }, + inventory_image = "homedecor_beer_inv.png", + use_texture_alpha = true, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + groups = { snappy=3, oddly_breakable_by_hand=3 }, + sounds = default.node_sound_glass_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.125, -0.5, -0.25, 0.0625, -0.25, -0.0625}, -- NodeBox1 + {0.0625, -0.3125, -0.18, 0.135, -0.285, -0.14}, -- NodeBox2 + {0.1, -0.465, -0.18, 0.135, -0.285, -0.14}, -- NodeBox3 + {0.0625, -0.465, -0.18, 0.135, -0.4375, -0.14}, -- NodeBox4 + } + }, + selection_box = { + type = "fixed", + fixed = { -0.125, -0.5, -0.25, 0.135, -0.25, -0.0625 } } }) diff --git a/homedecor/textures/homedecor_beer_back.png b/homedecor/textures/homedecor_beer_back.png new file mode 100644 index 0000000..8b5add6 Binary files /dev/null and b/homedecor/textures/homedecor_beer_back.png differ diff --git a/homedecor/textures/homedecor_beer_bottom.png b/homedecor/textures/homedecor_beer_bottom.png new file mode 100644 index 0000000..850b3a6 Binary files /dev/null and b/homedecor/textures/homedecor_beer_bottom.png differ diff --git a/homedecor/textures/homedecor_beer_front.png b/homedecor/textures/homedecor_beer_front.png new file mode 100644 index 0000000..853cf58 Binary files /dev/null and b/homedecor/textures/homedecor_beer_front.png differ diff --git a/homedecor/textures/homedecor_beer_inv.png b/homedecor/textures/homedecor_beer_inv.png new file mode 100644 index 0000000..89e69de Binary files /dev/null and b/homedecor/textures/homedecor_beer_inv.png differ diff --git a/homedecor/textures/homedecor_beer_left.png b/homedecor/textures/homedecor_beer_left.png new file mode 100644 index 0000000..5df7b46 Binary files /dev/null and b/homedecor/textures/homedecor_beer_left.png differ diff --git a/homedecor/textures/homedecor_beer_right.png b/homedecor/textures/homedecor_beer_right.png new file mode 100644 index 0000000..00a701b Binary files /dev/null and b/homedecor/textures/homedecor_beer_right.png differ diff --git a/homedecor/textures/homedecor_beer_top.png b/homedecor/textures/homedecor_beer_top.png new file mode 100644 index 0000000..7943b59 Binary files /dev/null and b/homedecor/textures/homedecor_beer_top.png differ