-- These may be _color or _pine_wood -- counter1_ = counter - corner -- counter2_ = counter [color or wood] -- counter3_ = counter - horizontal drawers -- counter4_ = counter - vertical drawers -- _sink = sink local counter_table = { --name, color, colorize(hex or color name:intensity(1-255)) { 'Black' , 'black' , 'black:200' } , { 'Blue' , 'blue' , 'blue:125' } , { 'Brown' , 'brown' , 'brown:75' } , { 'Dark Green' , 'dark_green' , 'green:190' } , { 'Green' , 'green' , '#32cd32:125' } , { 'Orange' , 'orange' , 'orange:125' } , { 'White' , 'white' , 'white:125' } , } local counter_color_list = {} for ii in ipairs (counter_table) do local color = counter_table [ii][2] table.insert (counter_color_list, color) end local counter_color_set = ocutil.make_set (counter_color_list) counter_color_list = nil -- =================================================================== local trashcan_table = { --name, color, colorize(hex or color name:intensity(1-255)) { 'Blue', 'blue', 'blue:125' } , { 'Green', 'green', '#32cd32:125' } , { 'Orange', 'orange', 'orange:125' } , { 'Pink', 'pink', 'pink:190'} , { 'White', 'white', 'white:125' } , } local trashcan_color_list = {} for ii in ipairs (trashcan_table) do local color = trashcan_table [ii][2] table.insert (trashcan_color_list, color) end local trashcan_color_set = ocutil.make_set (trashcan_color_list) trashcan_color_list = nil -- =================================================================== for ii in ipairs (counter_table) do local name = counter_table [ii][1] local color = counter_table [ii][2] local hex = counter_table [ii][3] -- =================================================================== minetest.register_node ("mapop:counter4_"..color, { description = "Mapop " .. name.. " Counter Vertical Drawers" , tiles = { "default_coral_skeleton.png^[colorize:"..hex , "mp_enc_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_right.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_left.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", sounds = moditems.WOOD_SOUNDS, on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.4375, -0.375, -0.4375, -0.0625, 0.3125, -0.375} , {0.0625, -0.375, -0.4375, 0.4375, 0.3125, -0.375} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.1875, -0.0625, -0.5, -0.125, 0, -0.4375} , {0.125, -0.0625, -0.5, 0.1875, 0, -0.4375} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:counter4_" .. color minetest.set_node (pos, node) end end end }) -- =================================================================== minetest.register_node ("mapop:counter2_"..color, { description = name .. " Counter" , tiles = { "default_coral_skeleton.png^[colorize:"..hex, "mp_enc_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_right.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_left.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , sounds = moditems.WOOD_SOUNDS, node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:counter2_" .. color minetest.set_node (pos, node) end end end , }) -- =================================================================== minetest.register_node ("mapop:counter3_"..color, { description = name.. " Counter, Horizontal Drawers" , tiles = { "default_coral_skeleton.png^[colorize:"..hex, "mp_enc_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_right.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_left.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_front2.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", sounds = moditems.WOOD_SOUNDS, on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , {-0.4375, 0, -0.4375, 0.4375, 0.3125, -0.375} , {-0.4375, -0.375, -0.4375, 0.4375, -0.0625, -0.375} , {-0.1875, 0.125, -0.5, 0.1875, 0.1875, -0.4375} , {-0.1875, -0.25, -0.5, 0.1875, -0.1875, -0.4375} , } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:counter3_" .. color minetest.set_node (pos, node) end end end , }) -- =================================================================== minetest.register_node ("mapop:counter1_" ..color, { description = name.. " Counter (Corner)", tiles = { "default_coral_skeleton.png^[colorize:"..hex , "mp_corn_r_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , } , drawtype = "nodebox", paramtype = "light", sounds = moditems.WOOD_SOUNDS, groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {0.5, 0.5, 0.5, -0.5, -0.5, -0.5} , -- NodeBox1 } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:counter1_" .. color minetest.set_node (pos, node) end end end , }) -- =================================================================== minetest.register_node ("mapop:sink_" ..color, { description = name.. " Counter (Sink)", tiles = { "default_coral_skeleton.png^[colorize:"..hex.."^mp_sink_top.png" , "mp_enc_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_right.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_left.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_back.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_enc_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", sounds = moditems.WOOD_SOUNDS, on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , -- NodeBox1 {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , -- NodeBox2 {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , -- NodeBox3 {-0.4375, -0.375, -0.4375, -0.0625, 0.3125, -0.375} , -- NodeBox4 {0.0625, -0.375, -0.4375, 0.4375, 0.3125, -0.375} , -- NodeBox5 {-0.1875, -0.0625, -0.5, -0.125, 0, -0.4375} , -- NodeBox6 {0.125, -0.0625, -0.5, 0.1875, 0, -0.4375} , -- NodeBox7 } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:sink_" .. color minetest.set_node (pos, node) end end end , }) -- =================================================================== minetest.register_node ("mapop:upcabinet_"..color, { description = name.." Upper Cabinets" , tiles = { "default_coral_skeleton.png^[colorize:"..hex.."^mp_up_top.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_up_bottom.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_up_right.png" , "default_coral_skeleton.png^[colorize:"..hex.."^mp_up_left.png" , "default_coral_skeleton.png^[colorize:"..hex , "default_coral_skeleton.png^[colorize:"..hex.."^mp_up_front.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 3*3) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;3,1.3;3,3;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.5, -0.3125, -0.375, 0.5, 0.5, 0.5} , -- NodeBox1 {-0.4375, -0.25, -0.4375, -0.0625, 0.4375, -0.375} , -- NodeBox2 {0.0625, -0.25, -0.4375, 0.4375, 0.4375, -0.375} , -- NodeBox3 {-0.1875, -0.1875, -0.5, -0.125, 0, -0.4375} , -- NodeBox4 {0.125, -0.1875, -0.5, 0.1875, 0, -0.4375} , -- NodeBox5 } } , on_punch = function (pos, node, clicker) local item = clicker:get_wielded_item():get_name() if string.sub (item, 1, 4) == "dye:" then local color = string.sub (item, 5) if counter_color_set [color] ~= nil then node.name = "mapop:upcabinet_" .. color minetest.set_node (pos, node) end end end , }) -- =================================================================== end -- end of "for" loop -- =================================================================== local counter_table = { --name, material -- {'Wooden', 'wood'} , -- {'Acacia', 'acacia_wood'} , -- {'Jungle', 'junglewood' } , { 'Pine' , 'pine_wood' } , -- {'Aspen', 'aspen_wood'} , } -- =================================================================== for i in ipairs (counter_table) do local name = counter_table [i][1] local material = counter_table [i][2] -- =================================================================== minetest.register_node ("mapop:counter4_" .. material, { description = name .. " Counter, Vertical Drawers" , tiles = { "default_"..material..".png" , "mp_enc_bottom.png" , "default_"..material..".png^mp_enc_right.png" , "default_"..material..".png^mp_enc_left.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.4375, -0.375, -0.4375, -0.0625, 0.3125, -0.375} , {0.0625, -0.375, -0.4375, 0.4375, 0.3125, -0.375} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.1875, -0.0625, -0.5, -0.125, 0, -0.4375} , {0.125, -0.0625, -0.5, 0.1875, 0, -0.4375} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , } } , }) -- =================================================================== minetest.register_node ("mapop:counter2_"..material, { description = name .. " Counter", tiles = { "default_"..material..".png" , "mp_enc_bottom.png" , "default_"..material..".png^mp_enc_right.png" , "default_"..material..".png^mp_enc_left.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_back.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , } } , }) -- =================================================================== minetest.register_node ("mapop:counter3_"..material, { description = name .. " Counter, Horizontal Drawers", tiles = { "default_"..material..".png" , "mp_enc_bottom.png" , "default_"..material..".png^mp_enc_right.png" , "default_"..material..".png^mp_enc_left.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_front2.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed", fixed = { {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , {-0.4375, 0, -0.4375, 0.4375, 0.3125, -0.375} , {-0.4375, -0.375, -0.4375, 0.4375, -0.0625, -0.375} , {-0.1875, 0.125, -0.5, 0.1875, 0.1875, -0.4375} , {-0.1875, -0.25, -0.5, 0.1875, -0.1875, -0.4375} , } } , }) -- =================================================================== minetest.register_node ("mapop:counter1_" ..material, { description = "Mapop " .. name .. " Counter Corner" , tiles = { "default_"..material..".png" , "mp_corn_r_bottom.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_back.png" , } , drawtype = "nodebox" , paramtype = "light" , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {0.5, 0.5, 0.5, -0.5, -0.5, -0.5} , -- NodeBox1 } } , }) -- =================================================================== minetest.register_node ("mapop:sink_" ..material, { description = "Mapop " .. name .. " Counter Sink" , tiles = { "default_"..material..".png^mp_sink_top.png" , "mp_enc_bottom.png" , "default_"..material..".png^mp_enc_right.png" , "default_"..material..".png^mp_enc_left.png" , "default_"..material..".png^mp_enc_back.png" , "default_"..material..".png^mp_enc_front.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 6*6) meta:set_string('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;1.5,.2;6,6;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5} , -- NodeBox1 {-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5} , -- NodeBox2 {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5} , -- NodeBox3 {-0.4375, -0.375, -0.4375, -0.0625, 0.3125, -0.375} , -- NodeBox4 {0.0625, -0.375, -0.4375, 0.4375, 0.3125, -0.375} , -- NodeBox5 {-0.1875, -0.0625, -0.5, -0.125, 0, -0.4375} , -- NodeBox6 {0.125, -0.0625, -0.5, 0.1875, 0, -0.4375} , -- NodeBox7 } } , }) -- =================================================================== minetest.register_node ("mapop:upcabinet_"..material, { description = "Mapop " .. name .." Upper Cabinets" , tiles = { "default_"..material..".png^mp_up_top.png" , "default_"..material..".png^mp_up_bottom.png" , "default_"..material..".png^mp_up_right.png" , "default_"..material..".png^mp_up_left.png" , "default_"..material..".png" , "default_"..material..".png^mp_up_front.png" } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , on_construct = function (pos) local meta = minetest.env:get_meta (pos) local inv = meta:get_inventory() inv:set_size ('main', 8*4) inv:set_size ('storage', 3*3) meta:set_string ('formspec', 'size [9,10.5]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;3,1.3;3,3;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty('storage') and inv:is_empty('storage1') end , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.5, -0.3125, -0.375, 0.5, 0.5, 0.5} , -- NodeBox1 {-0.4375, -0.25, -0.4375, -0.0625, 0.4375, -0.375} , -- NodeBox2 {0.0625, -0.25, -0.4375, 0.4375, 0.4375, -0.375} , -- NodeBox3 {-0.1875, -0.1875, -0.5, -0.125, 0, -0.4375} , -- NodeBox4 {0.125, -0.1875, -0.5, 0.1875, 0, -0.4375} , -- NodeBox5 } } , }) end -- =================================================================== minetest.register_node ("mapop:upcabinet_corner", { description = "Mapop Upper Cabinets Corner" , tiles = { "mp_grif_sides.png" , "mp_grif_sides.png" , "mp_grif_sides.png" , "mp_grif_sides.png" , "mp_grif_sides.png" , "mp_grif_sides.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , on_construct = function (pos) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() inv:set_size('main', 8*4) inv:set_size('storage', 3*3) meta:set_string ('formspec', 'size [9,10]'.. 'bgcolor[#080808BB;true]'.. 'list[current_name;storage;3,1.5;3,3;]'.. 'list[current_player;main;0.5,6.5;8,4;]') end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty ('storage') and inv:is_empty ('storage1') end , node_box = { type = "fixed" , fixed = { {-0.5, -0.3125, -0.5, 0.5, 0.5, 0.5} , } } }) -- =================================================================== minetest.register_node ("mapop:dw", { description= "Mapop Dishwasher" , tiles = { "mp_dw_top.png" , "mp_dw_bottom.png" , "mp_dw_left.png" , "mp_dw_right.png" , "mp_dw_back.png" , "mp_dw_front.png" , } , drawtype = "nodebox" , paramtype = "light" , paramtype2 = "facedir" , groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.4375, -0.5, -0.4375, 0.4375, -0.4375, 0.4375} , {-0.5, -0.4375, -0.4375, 0.5, 0.5, 0.5} , {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.4375} , {-0.4375, -0.4375, -0.5, 0.4375, 0.25, 0.5} , } } }) -- =================================================================== minetest.register_node ("mapop:coffee_maker", { description = "Mapop Coffee Maker", tiles = { "mp_cof_top.png" , "mp_cof_bottom.png" , "mp_cof_right.png" , "mp_cof_left.png" , "mp_cof_back.png" , "mp_cof_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.4375, -0.5, -0.0625, 0, -0.4375, 0.4375} , {-0.4375, -0.5, 0.3125, 0, 0.1875, 0.4375} , {-0.4375, -0.0625, 0, 0, 0.25, 0.4375} , {-0.375, -0.4375, 0, -0.0625, -0.125, 0.25} , {-0.25, -0.375, -0.125, -0.1875, -0.1875, 0.0625} , } } }) -- =================================================================== minetest.register_node ("mapop:coffee_cup", { description = "Mapop Coffee Cup" , tiles = { "mp_cof_top.png" , "mp_cof_top.png" , "mp_cof_right.png" , "mp_cof_left.png" , "mp_cof_back.png" , "mp_cof_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1} , node_box = { type = "fixed" , fixed = { {-0.375, -0.5, 0, -0.0625, -0.1875, 0.3125} , -- NodeBox1 {-0.25, -0.3125, -0.125, -0.1875, -0.25, 0} , -- NodeBox2 {-0.25, -0.4375, -0.125, -0.1875, -0.375, 0} , -- NodeBox3 {-0.25, -0.375, -0.125, -0.1875, -0.3125, -0.0625} , -- NodeBox4 } } }) -- =================================================================== minetest.register_node ("mapop:toaster", { description = "Mapop Toaster", tiles = { "mp_toas_top.png" , "mp_toas_bottom.png" , "mp_toas_right.png" , "mp_toas_left.png" , "mp_toas_back.png" , "mp_toas_front.png" , } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1} , node_box = { type = "fixed" , fixed = { {-0.375, -0.5, 0, 0.375, -0.0625, 0.3125} , {-0.4375, -0.1875, 0.0625, -0.375, -0.125, 0.25} , } , } }) -- =================================================================== minetest.register_node ("mapop:cutting_board", { description = "Mapop Cutting Board" , tiles = { "default_wood.png" , "default_wood.png" , "default_wood.png" , "default_wood.png" , "default_wood.png" , "default_wood.png" } , drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} , node_box = { type = "fixed" , fixed = { {-0.4375, -0.5, -0.25, 0.25, -0.4375, 0.25} , {0.25, -0.5, -0.0625, 0.4375, -0.4375, 0.0625} , } , } }) -- =================================================================== minetest.register_node ("mapop:tile_white", { description = "Mapop White Tile", tiles = { "mp_tile_white.png" , "mp_tile_white.png" , "mp_tile_white.png" , "mp_tile_white.png" , "mp_tile_white.png" , "mp_tile_white.png" } , paramtype = "light", paramtype2 = "facedir", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} , }) -- =================================================================== minetest.register_node ("mapop:tile_checkered", { description = "Mapop Checkered Tile" , tiles = { "mp_tile_checkered.png" , "mp_tile_checkered.png" , "mp_tile_checkered.png" , "mp_tile_checkered.png" , "mp_tile_checkered.png" , "mp_tile_checkered.png" , } , paramtype = "light" , paramtype2 = "facedir" , groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} , }) -- =================================================================== for i in ipairs (trashcan_table) do local name = trashcan_table [i][1] local color = trashcan_table [i][2] local hex = trashcan_table [i][3] -- =================================================================== minetest.register_node ("mapop:trashcan_"..color, { description = "Mapop " .. name.. " Trash Can" , tiles = { "default_steel_block.png^[colorize:" .. hex , } , description = 'Trash Can' , drawtype = 'nodebox' , groups = {cracky=2, oddly_breakably_by_hand=2, furniture=1} , paramtype = 'light' , paramtype2 = 'facedir' , node_box = { type = "fixed", fixed = { {-0.375, -0.5, -0.375, 0.375, 0.375, 0.375} , -- NodeBox1 {-0.4375, 0.375, -0.4375, 0.4375, 0.4375, 0.4375} , -- NodeBox2 {-0.125, 0.4375, -0.3125, 0.125, 0.5, 0.3125} , -- NodeBox3 } } , sounds = moditems.WOOD_SOUNDS, on_construct = function (pos) local meta = minetest.get_meta (pos) meta:set_string ("formspec", "size[8,9]" .. "button[0,0;2,1;empty;Empty Trash]" .. "list[context;trashlist;3,1;2,3;]" .. "list[current_player;main;0,5;8,4;]" ) meta:set_string("infotext", "Trash Can") local inv = meta:get_inventory() inv:set_size ("main", 8*4) inv:set_size ("trashlist", 2*3) end , can_dig = function (pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty("main") end , on_metadata_inventory_move = function (pos, from_list, from_index, to_list, to_index, count, player) minetest.log("action", player:get_player_name() .. " moves stuff in trash can at " .. minetest.pos_to_string(pos)) end , on_metadata_inventory_put = function (pos, listname, index, stack, player) minetest.log("action", player:get_player_name() .. " moves stuff to trash can at " .. minetest.pos_to_string(pos)) end , on_metadata_inventory_take = function (pos, listname, index, stack, player) minetest.log("action", player:get_player_name() .. " takes stuff from trash can at " .. minetest.pos_to_string(pos)) end , on_receive_fields = function (pos, formname, fields, sender) if fields.empty then local meta = minetest.get_meta(pos) local inv = meta:get_inventory() inv:set_list("trashlist", {}) minetest.sound_play ("trash", { to_player = sender:get_player_name(), gain = 1.0 }) minetest.log ("action", sender:get_player_name() .. " empties trash can at " .. minetest.pos_to_string (pos)) end end , }) -- =================================================================== end -- =================================================================== minetest.register_alias ('mapop:trashcan' , 'mapop:trashcan_white') minetest.register_alias ('mapop:trash_can' , 'mapop:trashcan_white') -- =================================================================== minetest.register_node ("mapop:pplate", { description = "Porcelain plate" , visual_scale = 0.50 , wield_scale = { x=0.5, y=0.5, z=0.5 } , drawtype = "mesh" , paramtype = "light" , paramtype2 = "facedir" , use_texture_alpha = "clip" , light_source = 2 , mesh = "multidecor_pplate.b3d" , tiles = { "multidecor_porcelain_material.png^multidecor_porcelain_plate_pattern.png" } , groups = { glass=1 , oddly_breakable_by_hand = 1 , } , collision_box = { type = "fixed" , fixed = { -0.3, -0.5, -0.3, 0.3, -0.4, 0.3 } , } , selection_box = { type = "fixed" , fixed = { -0.3, -0.5, -0.3, 0.3, -0.4, 0.3 } , } , }) -- =================================================================== minetest.register_node ("mapop:pplate_knife_fork", { description = "Porcelain plate with knife and fork" , visual_scale = 0.50 , wield_scale = { x=0.5, y=0.5, z=0.5 } , drawtype = "mesh" , paramtype = "light" , paramtype2 = "facedir" , use_texture_alpha = "clip" , light_source = 2 , groups = { glass=1, oddly_breakable_by_hand=1, } , mesh = "multidecor_pplate_knife_fork.b3d" , tiles = { "multidecor_porcelain_material.png^multidecor_porcelain_plate_pattern.png" , "multidecor_metal_material.png" , "multidecor_wood.png" , }, collision_box = { type = "fixed" , fixed = { { -0.30, -0.5, -0.3, 0.30, -0.40, 0.3 } , { -0.45, -0.5, -0.3, -0.35, -0.45, 0.3 } , { 0.35, -0.5, -0.3, 0.45, -0.45, 0.3 } , } , } , selection_box = { type = "fixed" , fixed = { { -0.30, -0.5, -0.3, 0.30, -0.40, 0.3 } , { -0.45, -0.5, -0.3, -0.35, -0.45, 0.3 } , { 0.35, -0.5, -0.3, 0.45, -0.45, 0.3 } , } , } , }) -- =================================================================== -- From MTBAP mod. -- These 4 bowls are from MTBAP by Classic Adam aka Classic Adam's MT -- Block and Asset Pack. -- See "LICENSE-mtbap.txt" for license[s]. -- ------------------------------------------------------------------- minetest.register_node ("mapop:large_gray_bowl", { description = "MTBAP Large Gray Bowl", drawtype = "mesh", mesh = "mtbap_large_bowl.obj", sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", tiles = {"mtbap_gray.png"}, groups = { cracky=2 }, }) -- ------------------------------------------------------------------- minetest.register_node ("mapop:large_white_bowl", { description = "MTBAP Large White Bowl", drawtype = "mesh", mesh = "mtbap_large_bowl.obj", sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", tiles = {"mtbap_off-white.png"}, groups = { cracky=2 }, }) -- ------------------------------------------------------------------- minetest.register_node ("mapop:small_gray_bowl", { description = "MTBAP Small Gray Bowl", drawtype = "mesh", mesh = "mtbap_small_bowl.obj", sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", tiles = {"mtbap_gray.png"}, groups = { cracky=2 }, }) -- ------------------------------------------------------------------- minetest.register_node ("mapop:small_white_bowl", { description = "MTBAP Small White Bowl", drawtype = "mesh", mesh = "mtbap_small_bowl.obj", sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", tiles = {"mtbap_off-white.png"}, groups = { cracky=2 }, }) -- =================================================================== -- End of file.