Initial commit

master
Your Name 2020-01-20 14:09:45 -05:00
parent ca71882af7
commit b54976a6c4
80 changed files with 1160 additions and 535 deletions

View File

@ -1,5 +1,5 @@
minetest.register_node("ma_pops_furniture:bath_faucet", {
description = "ma_pops_furniture Faucet",
description = "Bathroom Faucet",
tiles = {
"mp_knob_top.png",
"mp_knob_bottom.png",
@ -59,7 +59,7 @@ minetest.register_node('ma_pops_furniture:toilet_open', {
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'ma_pops_furniture:toilet_close',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {
@ -90,7 +90,7 @@ minetest.register_node('ma_pops_furniture:toilet_close', {
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {
@ -114,7 +114,7 @@ minetest.register_node('ma_pops_furniture:toilet_close', {
})
minetest.register_node("ma_pops_furniture:br_sink", {
description = "Sink (ma_pops_furniture)",
description = "Sink (Bathroom)",
tiles = {
"mp_hw_top.png",
"mp_hw_bottom.png",
@ -265,14 +265,14 @@ minetest.register_node("ma_pops_furniture:shower_top", {
})
minetest.register_node('ma_pops_furniture:br_tile', {
description = 'ma_pops_furniture Tile',
description = 'Bathroom Tile',
drawtype = 'nodebox',
tiles = {
"mp_ma_pops_furniture_tile.png"
"mp_bathroom_tile.png"
},
groups = {cracky=2, oddly_breakable_by_hand=5, furniture=1},
paramtype = 'light',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {

View File

@ -18,7 +18,7 @@ minetest.register_node('ma_pops_furniture:nightstand_'..material, {
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1, flammable=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
@ -28,7 +28,7 @@ minetest.register_node('ma_pops_furniture:nightstand_'..material, {
'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;]')
'list[current_player;main;0.5,6.2;8,4;]')
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);

View File

@ -7,6 +7,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'ma_pops_furniture:br_tile',
recipe = {
{'dye:black','dye:white','dye:black',},
{'','default:stone_block','',},
{'dye:black','','dye:black',},
}
})
minetest.register_craft({
output = 'ma_pops_furniture:ceiling_lamp',
recipe = {
@ -38,7 +47,7 @@ minetest.register_craft({
output = 'ma_pops_furniture:toilet_paper_roll_dispenser',
recipe = {
{'default:stone','default:stone','default:stone',},
{'default:paper','default:water','default:paper',},
{'default:paper','bucket:water','default:paper',},
{'','default:paper','',},
}
})
@ -314,6 +323,7 @@ end
local counter_table = { --name, material
{'Wooden', 'wood'},
{'Acacia', 'acacia_wood'},
{'Aspen', 'aspen_wood'},
{'Jungle', 'junglewood' },
{'Pine', 'pine_wood'},
}
@ -346,6 +356,13 @@ minetest.register_craft({
{'ma_pops_furniture:counter3_'..material}
})
minetest.register_craft({
type = "shapeless",
output = 'ma_pops_furniture:counter1_'..material,
recipe =
{'ma_pops_furniture:counter2_'..material}
})
minetest.register_craft({
output = 'ma_pops_furniture:upcabinet_'..material,
recipe = {
@ -771,12 +788,35 @@ minetest.register_craft({
}
})
local unit_table = { --name, material
{'Wood Entertainment Unit', 'wood'},
{'Acacia Wood Entertainment Unit', 'acacia_wood'},
{'Aspen Wood Entertainment Unit', 'aspen_wood'},
{'Pine Wood Entertainment Unit', 'pine_wood'},
{'Jungle Wood Entertainment Unit', 'junglewood'}
}
for i in ipairs (unit_table) do
local name = unit_table[i][1]
local material = unit_table[i][2]
local invimg = unit_table[i][3]
minetest.register_craft({
output = 'ma_pops_furniture:entertainment_unit',
output = 'ma_pops_furniture:e_u_'..material,
recipe = {
{'default:wood','default:wood','default:wood',},
{'default:wood','default:chest','default:wood',},
{'default:wood','default:wood','default:wood',},
{'default:'..material,'default:'..material,'default:'..material,},
{'default:'..material,'default:chest','default:'..material,},
{'default:'..material,'','default:'..material,},
}
})
end
minetest.register_craft({
output = "ma_pops_furniture:trampoline",
recipe = {
{"farming:string", "farming:string", "farming:string"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"}
}
})
@ -911,28 +951,6 @@ minetest.register_craft({
})
end
local end_table = { --name, material, invimg
{'wood'},
{'aspen_wood'},
{'junglewood'},
{'acacia_wood'},
{'pine_wood'},
{'cobble'}
}
for i in ipairs (end_table) do
local material = end_table[i][1]
minetest.register_craft({
output = 'ma_pops_furniture:end_table_'..material,
recipe = {
{'default:'..material, 'default:'..material, 'default:'..material},
{'default:'..material, '', 'default:'..material},
{'default:'..material, '', 'default:'..material}
}
})
end
minetest.register_craft({
output = 'ma_pops_furniture:computer',
recipe = {
@ -957,9 +975,18 @@ for i in ipairs (table) do
minetest.register_craft({
output = 'ma_pops_furniture:table_'..material,
recipe = {
{'default:'..material, 'default:'..material, 'default:'..material},
{'', 'default:'..material, ''},
{'', 'default:'..material, ''}
{'stairs:slab_'..material..'wood', 'stairs:slab_'..material..'wood', 'stairs:slab_'..material..'wood'},
{'', 'default:stick', ''},
{'', 'default:stick', ''}
}
})
minetest.register_craft({
output = 'ma_pops_furniture:table_'..material,
recipe = {
{'stairs:slab_wood', 'stairs:slab_wood', 'stairs:slab_wood'},
{'', 'default:stick', ''},
{'', 'default:stick', ''}
}
})
end
@ -984,6 +1011,7 @@ minetest.register_craft({
}
})
end
--added craft
minetest.register_craft({
output = 'ma_pops_furniture:birdbath',
@ -993,6 +1021,25 @@ minetest.register_craft({
{'default:stone','default:stone','default:stone',},
}
})
--added craft
minetest.register_craft({
output = 'ma_pops_furniture:tile_kitchen',
recipe = {
{'default:stone_block','dye:white','default:stone_block',},
{'dye:black','default:stone_block','dye:black',},
{'default:stone_block','dye:white','default:stone_block',},
}
})
--added craft
minetest.register_craft({
output = 'ma_pops_furniture:tile_floor_kitchen',
recipe = {
{'default:stone_block','ma_pops_furniture:hammer',},
}
})
--added craft
minetest.register_craft({
output = 'ma_pops_furniture:doorbell 4',
@ -1058,6 +1105,40 @@ minetest.register_craft({
{'default:steel_ingot','','default:steel_ingot',},
}
})
minetest.register_craft({
output = 'ma_pops_furniture:fridge_white',
recipe = {
{'default:steelblock','default:steelblock','default:steelblock',},
{'default:steelblock','default:chest','default:steelblock',},
{'default:steelblock','default:furnace','default:steelblock',}
}
})
--added craft
local fridges_list = {
{"black", "Darkened Fridge", color1},
{"blue", "Blue Fridge", color2},
{"green", "Green Fridge", color3},
{"orange", "Orange Fridge", color5},
{"red", "Red Fridge", color6},
{"yellow", "Yellow Fridge", color7},
{"pink", "Pink Fridge", color8}
}
for i, fridge in ipairs(fridges_list) do
local colour = fridge[1]
local fridgedesc = fridge[2]
local colour2 = fridge[3]
minetest.register_craft({
type = "shapeless",
output = 'ma_pops_furniture:fridge_'..colour,
recipe =
{'ma_pops_furniture:fridge_white', 'dye:'..colour}
})
end
--added craft
minetest.register_craft({
output = 'ma_pops_furniture:stone_path_1 5',

View File

@ -19,7 +19,7 @@ minetest.register_node('ma_pops_furniture:chair_'..material, {
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1, flammable=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
can_dig = ma_pops_furniture.sit_dig,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y + 0 -- Sitting position
@ -29,12 +29,12 @@ minetest.register_node('ma_pops_furniture:chair_'..material, {
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.4375, -0.1875, 0, -0.25}, -- NodeBox1
{-0.375, -0.5, 0.25, -0.1875, 0, 0.4375}, -- NodeBox2
{0.1875, -0.5, 0.25, 0.375, 0, 0.4375}, -- NodeBox3
{0.1875, -0.5, -0.4375, 0.375, 0, -0.25}, -- NodeBox4
{-0.375, 0, -0.4375, 0.375, 0.1875, 0.4375}, -- NodeBox5
{-0.375, 0.1875, 0.3125, 0.375, 0.875, 0.4375}, -- NodeBox6
{-0.4375, -0.5, 0.3125, -0.3125, -0.0625, 0.4375}, -- NodeBox10
{0.3125, -0.5, 0.3125, 0.4375, -0.0625, 0.4375}, -- NodeBox11
{-0.4375, -0.5, -0.4375, -0.3125, -0.0625, -0.3125}, -- NodeBox12
{0.3125, -0.5, -0.4375, 0.4375, -0.0625, -0.3125}, -- NodeBox13
{-0.4375, -0.0625, -0.4375, 0.4375, 0.0625, 0.4375}, -- NodeBox14
{-0.4375, 0.0625, 0.3125, 0.4375, 0.8125, 0.4375}, -- NodeBox15
}
}
})
@ -58,15 +58,16 @@ minetest.register_node('ma_pops_furniture:table_'..material, {
description = name,
drawtype = 'nodebox',
tiles = {'default_'..material..'.png'},
align_style="world",
groups = {snappy = 2, oddly_breakable_by_hand = 2, furniture = 1, flammable = 1, table = 1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.125, 0.125, 0.3125, 0.125}, -- NodeBox2
{-0.5, 0.3125, -0.5, 0.5, 0.5, 0.5}, -- NodeBox3
{-0.125, -0.5, -0.125, 0.125, 0.375, 0.125}, -- NodeBox8
{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox9
}
},
@ -76,6 +77,42 @@ minetest.register_node('ma_pops_furniture:table_'..material, {
})
end
local table2_table = { --name, material, invimg
{'Stone Table', 'cobble', 'mp_table_stone.png'},
{'Wood Table', 'wood', 'mp_table_wood.png'},
{'Acacia Wood Table', 'acacia_wood', 'mp_table_wood_acacia.png'},
{'Aspen Wood Table', 'aspen_wood', 'mp_table_wood_aspen.png'},
{'Pine Wood Table', 'pine_wood', 'mp_table_wood_pine.png'},
{'Jungle Wood Table', 'junglewood', 'mp_table_wood_jungle.png'}
}
for i in ipairs (table2_table) do
local name = table2_table[i][1]
local material = table2_table[i][2]
local invimg = table2_table[i][3]
minetest.register_node('ma_pops_furniture:table2_'..material, {
description = name,
drawtype = 'nodebox',
tiles = {'default_'..material..'.png'},
align_style="world",
groups = {snappy = 2, oddly_breakable_by_hand = 2, furniture = 1, flammable = 1, table = 1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5
{-0.4375, -0.5, -0.4375, -0.3125, 0.375, -0.3125}, -- NodeBox6
{-0.4375, -0.5, 0.3125, -0.3125, 0.375, 0.4375}, -- NodeBox7
{0.3125, -0.5, 0.3125, 0.4375, 0.375, 0.4375}, -- NodeBox8
{0.3125, -0.5, -0.4375, 0.4375, 0.375, -0.3125}, -- NodeBox9
}
},
})
end
local table_c_table = { --name, material, invimg
{'Stone Corner Table', 'cobble', 'mp_table_stone.png'},
{'Wood Corner Table', 'wood', 'mp_table_wood.png'},
@ -94,11 +131,12 @@ minetest.register_node('ma_pops_furniture:table_c_'..material, {
description = name,
drawtype = 'nodebox',
tiles = {'default_'..material..'.png'},
align_style="world",
groups = {snappy = 2, oddly_breakable_by_hand = 2, furniture = 1, flammable = 1, table = 1, not_in_creative_inventory = 1},
drop = 'ma_pops_furniture:table_'..material,
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -131,11 +169,12 @@ minetest.register_node('ma_pops_furniture:table_center_'..material, {
description = name,
drawtype = 'nodebox',
tiles = {'default_'..material..'.png'},
align_style="user",
groups = {snappy = 2, oddly_breakable_by_hand = 2, furniture = 1, flammable = 1, table = 1, not_in_creative_inventory = 1},
drop = 'ma_pops_furniture:table_'..material,
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {

View File

@ -1,227 +1,300 @@
--
-- Freezer for mintest: a device which turns water (in buckets) into ice
-- And does a couple of other tricks, discovering which is left as a pleasant
-- surprise for the player.
--
-- enable extra popsicle types provided there are both vessels and fruits/veggies available
-- fruit + glass -> juice; juice @ freezer -> popsicle + empty glass
--
-- Formspecs
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.5,1;1,1;]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;3,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
return formspec
end
local inactive_formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.5,1.5;1,1;]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;3,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
--
-- Node callback functions that are the same for active and inactive freezer
--
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("dst") and inv:is_empty("src")
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
end
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function freezer_node_timer(pos, elapsed)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local src_time = meta:get_float("src_time") or 0
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local dstlist = inv:get_list("dst")
--
-- Cooking
--
-- takes both regular and river water
if inv:contains_item("src", "bucket:bucket_water") or
inv:contains_item("src", "bucket:bucket_river_water") then
if inv:room_for_item("dst", "default:ice") then
inv:remove_item("src", "bucket:bucket_water")
inv:remove_item("src", "bucket:bucket_river_water")
inv:add_item("dst", "default:ice")
inv:add_item("dst", "bucket:bucket_empty")
end
end
-- Check if we have cookable content
return
end
--
-- Node definitions
--
minetest.register_node("ma_pops_furniture:freezer", {
description = "Freezer",
tiles = {
"mp_froz_top.png",
"mp_froz_bottom.png",
"mp_froz_right.png",
"mp_froz_left.png",
"mp_froz_back.png",
"mp_froz_front.png"
},
paramtype2 = "facedir",
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.4375, -0.375, 0.4375, 0.5, -0.3125}, -- NodeBox2
{0.3125, -0.25, -0.5, 0.375, 0.25, -0.4375}, -- NodeBox6
{0.3125, -0.25, -0.4375, 0.375, -0.1875, -0.375}, -- NodeBox7
{0.3125, 0.1875, -0.4375, 0.375, 0.25, -0.375}, -- NodeBox8
}
},
tube = (function() if minetest.get_modpath("pipeworks") then return {
-- using a different stack from defaut when inserting
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(1.0)
end
return inv:add_item("src", stack)
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("src", stack)
end,
-- the default stack, from which objects will be taken
input_inventory = "dst",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
} end end)(),
can_dig = can_dig,
on_timer = freezer_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec)
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('dst', 6)
end,
on_metadata_inventory_move = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether freezer will work or not.
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "src", drops)
default.get_inventory_drops(pos, "dst", drops)
drops[#drops+1] = "ma_pops_furniture:freezer"
minetest.remove_node(pos)
return drops
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
minetest.register_craft({
output = "default:snowblock 3",
type = "shapeless",
recipe = {
"default:ice"
}
})
--
-- Freezer for mintest: a device which turns water (in buckets) into ice
-- And does a couple of other tricks, discovering which is left as a pleasant
-- surprise for the player.
--
-- enable extra popsicle types provided there are both vessels and fruits/veggies available
-- fruit + glass -> juice; juice @ freezer -> popsicle + empty glass
--
-- Formspecs
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.5,1;1,1;]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;3,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
return formspec
end
local inactive_formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.5,1.5;1,1;]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;3,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
--
-- Node callback functions that are the same for active and inactive freezer
--
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("dst") and inv:is_empty("src")
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
end
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function freezer_node_timer(pos, elapsed)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local src_time = meta:get_float("src_time") or 0
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local dstlist = inv:get_list("dst")
--
-- Cooking
--
-- takes both regular and river water
if inv:contains_item("src", "bucket:bucket_water") or
inv:contains_item("src", "bucket:bucket_river_water") then
if inv:room_for_item("dst", "default:ice") then
inv:remove_item("src", "bucket:bucket_water")
inv:remove_item("src", "bucket:bucket_river_water")
inv:add_item("dst", "default:ice")
inv:add_item("dst", "bucket:bucket_empty")
end
end
-- Check if we have cookable content
return
end
--
-- Node definitions
--
color1 = minetest.setting_get("color1") or "292421"
color2 = minetest.setting_get("color2") or "0000FF"
color3 = minetest.setting_get("color3") or "00FF00"
color4 = minetest.setting_get("color4") or "F5F5F5"
color5 = minetest.setting_get("color5") or "FF6103"
color6 = minetest.setting_get("color6") or "FF0000"
color7 = minetest.setting_get("color7") or "FFFF00"
color8 = minetest.setting_get("color8") or "FF69B4"
local fridges_list = {
{"black", "Darkened Fridge", color1},
{"blue", "Blue Fridge", color2},
{"green", "Green Fridge", color3},
{"white", "White Fridge", color4},
{"orange", "Orange Fridge", color5},
{"red", "Red Fridge", color6},
{"yellow", "Yellow Fridge", color7},
{"pink", "Pink Fridge", color8}
}
for i, fridge in ipairs(fridges_list) do
local colour = fridge[1]
local fridgedesc = fridge[2]
local colour2 = fridge[3]
minetest.register_node("ma_pops_furniture:fridge_"..colour, {
description = fridgedesc,
drawtype = "nodebox",
tiles = {
"mp_dfridge_top.png^[colorize:#"..colour2..":70",
"mp_dfridge_bottom.png^[colorize:#"..colour2..":70",
"mp_dfridge_right.png^[colorize:#"..colour2..":70",
"mp_dfridge_left.png^[colorize:#"..colour2..":70",
"mp_dfridge_back.png^[colorize:#"..colour2..":70",
"mp_dfridge_front.png^[colorize:#"..colour2..":70"
},
paramtype = "light",
paramtype2 = "facedir",
stack_max = 1,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.25, -0.375, 0.5, 0.5, -0.3125}, -- NodeBox2
{-0.5, -0.5, -0.375, 0.5, -0.3125, -0.3125}, -- NodeBox3
{0.375, 0, -0.4375, 0.4375, 0.5, -0.375}, -- NodeBox4
}
},
after_place_node = function(pos, placer, itemstack)
local node = minetest.env:get_node(pos)
local p = {x=pos.x, y=pos.y, z=pos.z}
local param2 = node.param2
node.name = "ma_pops_furniture:fridge_top_"..colour
pos.y = pos.y+1
if minetest.registered_nodes[minetest.env:get_node(pos).name].buildable_to then
minetest.env:set_node(pos, node)
else
minetest.env:remove_node(p)
return true
end
end,
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*4)
meta:set_string('formspec',
'size [9,10]'..
'bgcolor[#080808BB;true]'..
'list[current_name;storage;2,1.5;6,4;]'..
'list[current_player;main;0.5,6.2;8,4;]')
end,
on_destruct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
local abovepos = {x=pos.x, y=pos.y+1, z=pos.z}
local abovenode = minetest.env:get_node(abovepos)
if abovenode.name == "ma_pops_furniture:fridge_top_"..colour and
abovenode.param2 == param2 then
minetest.env:remove_node(abovepos)
end
end,
})
minetest.register_node("ma_pops_furniture:fridge_top_"..colour, {
description = fridgedesc,
drawtype = "nodebox",
tiles = {
"mp_ufridge_top.png^[colorize:#"..colour2..":70",
"default_wood.png^[colorize:#"..colour2..":70",
"mp_ufridge_right.png^[colorize:#"..colour2..":70",
"mp_ufridge_left.png^[colorize:#"..colour2..":70",
"mp_fridge_back.png^[colorize:#"..colour2..":70",
"mp_ufridge_front.png^[colorize:#"..colour2..":70"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, 0.3125, -0.375, 0.5, 0.5, -0.3125}, -- NodeBox2
{-0.5, -0.3125, -0.375, 0.5, 0.25, -0.3125}, -- NodeBox3
{-0.5, -0.5, -0.375, 0.5, -0.375, -0.3125}, -- NodeBox4
{0.375, -0.25, -0.4375, 0.4375, 0.125, -0.375}, -- NodeBox6
}
},
can_dig = can_dig,
on_timer = freezer_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", inactive_formspec)
local inv = meta:get_inventory()
inv:set_size('src', 1)
inv:set_size('dst', 6)
end,
on_metadata_inventory_move = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether freezer will work or not.
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_blast = function(pos)
local drops = {}
default.get_inventory_drops(pos, "src", drops)
default.get_inventory_drops(pos, "dst", drops)
drops[#drops+1] = "ma_pops_furniture:freezer"
minetest.remove_node(pos)
return drops
end,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
minetest.register_alias("fridges:fridge_"..colour, "fridges:fridge_bottom_"..colour)
end
minetest.register_craft({
output = "default:snowblock 3",
type = "shapeless",
recipe = {
"default:ice"
}
})

View File

@ -191,4 +191,4 @@ function ma_pops_furniture.check_table(pos, material, check_this, check_others)
end
end
end
end
end

View File

@ -86,6 +86,7 @@ minetest.register_node(grill_name, {
drawtype = "nodebox",
drop = grill_name,
paramtype = "light",
sounds = moditems.WOOD_SOUNDS,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
minetest.swap_node(pos, {name = grill_on_name})
end,
@ -107,6 +108,7 @@ minetest.register_node("ma_pops_furniture:grill_on", {
drop = grill_name,
paramtype = "light",
light_source = 10,
sounds = moditems.WOOD_SOUNDS,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
minetest.swap_node(pos, {name = grill_name})
end,
@ -127,6 +129,7 @@ minetest.register_node(grill2_off_name, {
drawtype = "nodebox",
drop = grill2_off_name,
paramtype = "light",
sounds = moditems.WOOD_SOUNDS,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
local node_above = minetest.get_node(above(pos))

View File

@ -1,9 +1,60 @@
ma_pops_furniture = {}
--GreenDimond's code from waffle mod
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
ma_pops_furniture.intllib = S
dofile(minetest.get_modpath('ma_pops_furniture')..'/intllib.lua')
moditems = {} -- switcher
if core.get_modpath("mcl_core") and mcl_core then -- means MineClone 2 is loaded, this is its core mod
moditems.IRON_ITEM = "mcl_core:iron_ingot" -- MCL version of iron ingot
moditems.COAL_ITEM = "mcl_core:coalblock" -- MCL version of coal block
moditems.CORAL_SKELETON = "mcl_nether:quartz_block" -- MCL version of green dye
moditems.SILVER_SANDSTONE = "mcl_nether:quartz_block" -- MCL version of green dye
moditems.INVENTORY = "mcl_inventory:crafting_formspec_bg2" -- MCL version of green dye
moditems.INFOBOX_CAN = {}
moditems.INFOBOX_DUMP = {}
moditems.BOXART = "bgcolor[#d0d0d0;false]listcolors[#9d9d9d;#9d9d9d;#5c5c5c;#000000;#ffffff]" -- trying to imitate MCL boxart
else -- fallback, assume default (MineTest Game) is loaded, otherwise it will error anyway here.
moditems.IRON_ITEM = "default:steel_ingot" -- MTG iron ingot
moditems.COAL_ITEM = "default:coalblock" -- MTG coal block
moditems.CORAL_SKELETON = "default:coral_skeleton" -- MCL version of green dye
moditems.SILVER_SANDSTONE = "default:silver_sandstone" -- MCL version of green dye
moditems.INVENTORY = "default:silver_sandstone" -- MCL version of green dye
moditems.INFOBOX_CAN = "Trash Can"
moditems.INFOBOX_DUMP = "Dumpster"
moditems.BOXART = ""
end
-- actual use in the code down somewhere.
material = moditems.IRON_ITEM
sounds = moditems.WOOD_SOUNDS
_doc_items_longdesc = moditems.STRING_ITEM
local sounds
if mcl_sounds then
sounds = mcl_sounds.node_sound_metal_defaults()
else
if default.node_sound_metal_defaults then
sounds = default.node_sound_metal_defaults()
else
sounds = default.node_sound_stone_defaults()
end
end
dofile(minetest.get_modpath('ma_pops_furniture')..'/toaster.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/abm.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/bathroom.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/bedroom.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/kitchen.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/living_room.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/microwave.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/dining_room.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/outside.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/misc.lua')
@ -12,12 +63,9 @@ dofile(minetest.get_modpath('ma_pops_furniture')..'/joyb.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/stereo.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/sofa.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/tv.lua')
--GreenDimond's code from waffle mod
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
ma_pops_furniture.intllib = S
dofile(minetest.get_modpath('ma_pops_furniture')..'/toaster.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/intllib.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/toys.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/tools.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/functions.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/formspecs.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/fridge.lua')
dofile(minetest.get_modpath('ma_pops_furniture')..'/crafts.lua')

View File

@ -1,7 +1,7 @@
minetest.register_node("ma_pops_furniture:venext_console", {
description = "jOyBoX",
tiles = {
"mp_venext_top.png",
"mp_venext_top1.png",
"mp_venext_bottom.png",
"mp_venext_side.png",
"mp_venext_side2.png",
@ -9,6 +9,7 @@ minetest.register_node("ma_pops_furniture:venext_console", {
"mp_venext_front.png",
},
groups = {snappy=1,bendy=2,cracky=1},
sounds = moditems.WOOD_SOUNDS,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = 'facedir',
@ -19,7 +20,6 @@ minetest.register_node("ma_pops_furniture:venext_console", {
{-0.375, -0.1875, -0.375, 0.375, -0.0625, 0.375},
{0.3125, -0.4375, -0.5, 0.375, -0.375, -0.4375},
{0.1875, -0.4375, -0.5, 0.25, -0.375, -0.4375},
{0.25, 0.1, -0.07, -0.25, -0.4375, 0.14},
}
}
})
@ -39,6 +39,7 @@ minetest.register_node("ma_pops_furniture:jOyBoX_cart", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = 'facedir',
sounds = moditems.WOOD_SOUNDS,
on_rightclick = function(pos, node, player)
for _, obj in ipairs (minetest.get_connected_players()) do
local item = obj:get_wielded_item():get_name()
@ -48,34 +49,6 @@ minetest.register_node("ma_pops_furniture:jOyBoX_cart", {
end
end
end,
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, 0.4375, -0.1875, 0.4375},
{-0.375, -0.1875, -0.375, 0.375, -0.0625, 0.375},
{0.3125, -0.4375, -0.5, 0.375, -0.375, -0.4375},
{0.1875, -0.4375, -0.5, 0.25, -0.375, -0.4375},
}
}
})
minetest.register_node("ma_pops_furniture:jOyBoXrcartridge", {
description = "jOyBoX cartridge",
tiles = {
"mp_venext_cartridge_top.png",
"mp_venext_bottom.png",
"mp_venext_cartridge_side.png",
"mp_venext_cartridge_side2.png",
"mp_venext_cartridge_back.png",
"mp_venext_cartridge_front.png",
},
groups = {snappy=1,bendy=2,cracky=1},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = 'facedir',
node_box = {
type = "fixed",
fixed = {
@ -92,14 +65,15 @@ minetest.register_node("ma_pops_furniture:cartridge", {
description = "cartridge",
tiles = {
"cartridge.png",
"cartridge_bottom.png",
"cartridge.png",
"cartridge.png",
"cartridge_back.png",
"cartridge_front.png",
"mp_cartridge.png",
"mp_cartridge_bottom.png",
"mp_cartridge.png",
"mp_cartridge.png",
"mp_cartridge_back.png",
"mp_cartridge_front.png",
},
groups = {snappy=1,bendy=2,cracky=1},
sounds = moditems.WOOD_SOUNDS,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = 'facedir',

View File

@ -34,6 +34,7 @@ minetest.register_node("ma_pops_furniture:counter_"..color, {
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()
@ -158,6 +159,7 @@ minetest.register_node("ma_pops_furniture:counter2_"..color, {
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1},
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -260,6 +262,7 @@ minetest.register_node("ma_pops_furniture:counter3_"..color, {
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()
@ -382,6 +385,7 @@ minetest.register_node("ma_pops_furniture:counter1_" ..color, {
},
drawtype = "nodebox",
paramtype = "light",
sounds = moditems.WOOD_SOUNDS,
groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1},
node_box = {
type = "fixed",
@ -483,6 +487,7 @@ minetest.register_node("ma_pops_furniture:sink_" ..color, {
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()
@ -503,13 +508,13 @@ minetest.register_node("ma_pops_furniture:sink_" ..color, {
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5}, -- NodeBox2
{-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, 0.3125, -0.375}, -- NodeBox4
{-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.5}, -- NodeBox7
{0.125, -0.0625, -0.5, 0.1875, 0, -0.4375}, -- NodeBox7
}
},
on_punch = function(pos, node, clicker)
@ -893,13 +898,13 @@ minetest.register_node("ma_pops_furniture:sink_" ..material, {
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.4375, -0.375, 0.5, 0.375, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.3125, 0.5, -0.4375, 0.5}, -- NodeBox2
{-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, 0.3125, -0.375}, -- NodeBox4
{-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.5}, -- NodeBox7
{0.125, -0.0625, -0.5, 0.1875, 0, -0.4375}, -- NodeBox7
}
},
})
@ -985,51 +990,6 @@ description = "Upper Cabinets(corner)",
}
})
minetest.register_node("ma_pops_furniture:fridge", {
description= "Fridge",
tiles = {
"mp_fridge_top.png",
"mp_fridge_bottom.png",
"mp_fridge_right.png",
"mp_fridge_left.png",
"mp_fridge_back.png",
"mp_fridge_front.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', 6*4)
meta:set_string('formspec',
'size [9,10]'..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
'bgcolor[#080808BB;true]'..
'list[current_name;storage;1.5,1;6,4;]'..
'list[current_player;main;0.5,6;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.5, -0.3125, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.4375, -0.375, 0.4375, 0.5, -0.3125}, -- NodeBox2
{0.3125, -0.25, -0.5, 0.375, 0.25, -0.4375}, -- NodeBox6
{0.3125, -0.25, -0.4375, 0.375, -0.1875, -0.375}, -- NodeBox7
{0.3125, 0.1875, -0.4375, 0.375, 0.25, -0.375}, -- NodeBox8
}
}
})
minetest.register_node("ma_pops_furniture:dw", {
description= "Dishwasher",
tiles = {
@ -1175,8 +1135,8 @@ minetest.register_node("ma_pops_furniture:toaster", {
}
})
minetest.register_node("ma_pops_furniture:br_faucet", {
description = "Bathroom Faucet",
minetest.register_node("ma_pops_furniture:faucet_kitchen", {
description = "Kitchen Faucet",
tiles = {
"mp_grif_top.png",
"mp_grif_sides.png",
@ -1224,6 +1184,36 @@ minetest.register_node("ma_pops_furniture:cutting_board", {
}
})
minetest.register_node("ma_pops_furniture:tile_kitchen", {
description = "White Kitchen Tile",
tiles = {
"mp_kitchen_tile.png",
"mp_kitchen_tile.png",
"mp_kitchen_tile.png",
"mp_kitchen_tile.png",
"mp_kitchen_tile.png",
"mp_kitchen_tile.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
})
minetest.register_node("ma_pops_furniture:tile_floor_kitchen", {
description = "Checker Kitchen Floor Tile",
tiles = {
"mp_kitchen_floor_tile.png",
"mp_kitchen_floor_tile.png",
"mp_kitchen_floor_tile.png",
"mp_kitchen_floor_tile.png",
"mp_kitchen_floor_tile.png",
"mp_kitchen_floor_tile.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
})
minetest.register_node('ma_pops_furniture:trash_can', {
description = 'Trash Can',
drawtype = 'nodebox',
@ -1240,7 +1230,7 @@ minetest.register_node('ma_pops_furniture:trash_can', {
{-0.125, 0.4375, -0.3125, 0.125, 0.5, 0.3125}, -- NodeBox3
}
},
sounds = default.node_sound_stone_defaults(),
sounds = moditems.WOOD_SOUNDS,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",

View File

@ -6,7 +6,7 @@ minetest.register_node('ma_pops_furniture:fireplace', {
groups = {cracky=2, oddly_breakable_by_hand=6, furniture=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
@ -32,7 +32,7 @@ minetest.register_node('ma_pops_furniture:fireplace_on', {
paramtype = 'light',
paramtype2 = 'facedir',
drops = 'ma_pops_furniture:fireplace',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
@ -61,7 +61,17 @@ minetest.register_node('ma_pops_furniture:c_'..material, {
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1, flammable=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
for _, obj in ipairs (minetest.get_connected_players()) do
local item = obj:get_wielded_item():get_name()
if item == 'ma_pops_furniture:c_'..material then
node.name = 'ma_pops_furniture:end_table_'..material
minetest.set_node(pos, node)
else
end
end
end,
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -97,7 +107,7 @@ minetest.register_node('ma_pops_furniture:end_table_'..material, {
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1, flammable=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -131,6 +141,7 @@ minetest.register_node("ma_pops_furniture:e_u_"..material, {
drawtype= "nodebox",
paramtype= "light",
paramtype2 = "facedir",
sounds = moditems.WOOD_SOUNDS,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, furniture = 1},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
@ -175,6 +186,7 @@ minetest.register_node('ma_pops_furniture:vcr_on', {
paramtype= "light",
paramtype2 = "facedir",
drop = 'ma_pops_furniture:vcr_off',
sounds = moditems.WOOD_SOUNDS,
groups = {choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory=1, furniture = 1},
node_box= {
type= "fixed",
@ -203,6 +215,7 @@ minetest.register_node('ma_pops_furniture:vcr_off', {
paramtype= "light",
paramtype2 = "facedir",
drop = 'ma_pops_furniture:vcr_off',
sounds = moditems.WOOD_SOUNDS,
groups = {choppy = 2, oddly_breakable_by_hand = 2, furniture = 1},
node_box= {
type= "fixed",
@ -383,6 +396,7 @@ minetest.register_node("ma_pops_furniture:fs_"..color, {
tiles = {"wool_"..color..".png","wool_"..color..".png^mp_cb.png","wool_"..color..".png^mp_cf.png","wool_"..color..".png^mp_cf.png","wool_"..color..".png^mp_cf.png","wool_"..color..".png^mp_cf.png",},
drawtype = "nodebox",
paramtype = "light",
sounds = moditems.WOOD_SOUNDS,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, furniture = 1},
node_box = {
type = "fixed",

View File

@ -2,25 +2,27 @@
--item_percent code by Noodlemire
local microwave_fs =
"size[8,7]"
.."button[6.5,1.5;1.5,2;btn_start;START]"
.."image[6.5,.2;1.5,.5;mp_mw_bar.png^[transformR270]"
.."list[current_player;main;0,3;8,1;]"
.."list[current_player;main;0,4.25;8,3;8]"
.."list[context;cook_slot;3.5,1.25;1,1;]"
.."label[3,0.5;Microwave]"
"size[9,9.5]"
.."background[0,0;9,4.5;mp_microwave_GUI.png]"
.."image_button[6.88,3.45;.85,.84;mp_microwave_start.png;btn_start;start]"
.."image[7.05,.05;2,.4;mp_mw_bar.png^[transformR270]"
.."list[current_player;main;.5,5;8,1;]"
.."list[current_player;main;.5,6.5;8,3;8]"
.."list[context;cook_slot;3.3,3;1,1;]"
.."label[1.5,0.4;Microwave]"
-- possibly add "fire" image?
local function get_active_microwave_fs(item_percent)
return "size[8,7]"
.."button[6.5,1.5;1.5,2;button_start;START]"
.."image[6.5,.2;1.5,.5;mp_mw_bar.png^[lowpart:"
..(item_percent)..":mp_mw_bar_on.png^[transformR270]"
.."list[current_player;main;0,3;8,1;]"
.."list[current_player;main;0,4.25;8,3;8]"
.."list[context;cook_slot;3.5,1.25;1,1;]"
.."label[3,0.5;Microwave]"
-- possibly add "fire" image?
return "size[9,9.5]"
.."background[0,0;9,4.5;mp_microwave_GUI.png]"
.."image_button[6.88,3.45;.85,.84;mp_microwave_start.png;btn_start;start]"
.."image[7.05,.05;2,.4;mp_mw_bar.png^[lowpart:"
..(item_percent)..":mp_mw_bar_on.png^[transformR270]"
.."list[current_player;main;.5,5;8,1;]"
.."list[current_player;main;.5,6.5;8,3;8]"
.."list[context;cook_slot;3.3,3;1,1;]"
.."label[1.5,0.4;Microwave]"
-- possibly add "fire" image?
end
--x,y;w,h
@ -32,34 +34,34 @@ microwave.recipes = {}
function microwave.register_recipe(input, output) microwave.recipes[input] = output end
local function update_formspec(progress, goal, meta)
local formspec
local formspec
if progress > 0 and progress <= goal then
local item_percent = math.floor(progress / goal * 100)
formspec = get_active_microwave_fs(item_percent)
else
formspec = microwave_fs
end
if progress > 0 and progress <= goal then
local item_percent = math.floor(progress / goal * 100)
formspec = get_active_microwave_fs(item_percent)
else
formspec = microwave_fs
end
meta:set_string("formspec", formspec)
meta:set_string("formspec", formspec)
end
local function recalculate(pos)
local meta, timer = minetest.get_meta(pos), minetest.get_node_timer(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack("cook_slot", 1)
local goal = 3 * stack:get_count()
local goal = 3 * stack:get_count()
local k = microwave.recipes[stack:get_name()]
if not k then return end
timer:stop()
update_formspec(0, goal, meta)
timer:start(1)
update_formspec(0, goal, meta)
timer:start(1)
end
local function do_cook_all(pos)
local meta = minetest.get_meta(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = meta:get_inventory():get_stack("cook_slot", 1)
local food_uncooked = inv:remove_item("cook_slot", inv:get_stack("cook_slot", 1)) -- Clear the slot
@ -72,12 +74,12 @@ minetest.register_node("ma_pops_furniture:microwave", {
tiles = {"mp_mw_top.png", "mp_mw_bottom.png", "mp_mw_right.png", "mp_mw_left.png", "mp_mw_back.png", "mp_mw_front.png"},
paramtype2 = "facedir",
groups = {cracky = 2}, -- currently no pipeworks compat as I don't know how it works
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.4375, -0.3125, 0.4375, 0.0625, 0.3125},
{-0.4375, -0.4375, -0.3125, 0.4375, 0.0625, 0.3125},
{-0.375, -0.5, -0.25, 0.375, -0.4375, 0.25},
},
},
@ -89,23 +91,23 @@ minetest.register_node("ma_pops_furniture:microwave", {
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local stack = meta:get_inventory():get_stack("cook_slot", 1)
local goal = 3 * stack:get_count()
local cooking_time = meta:get_int("cooking_time") or 0
cooking_time = cooking_time + 1
local stack = meta:get_inventory():get_stack("cook_slot", 1)
local goal = 3 * stack:get_count()
local cooking_time = meta:get_int("cooking_time") or 0
cooking_time = cooking_time + 1
update_formspec(cooking_time, goal, meta)
meta:set_int("cooking_time", cooking_time)
update_formspec(cooking_time, goal, meta)
meta:set_int("cooking_time", cooking_time)
--Keep cooking until there is nothing left to cook.
if cooking_time <= goal then
return true
else
do_cook_all(pos)
meta:set_int("cooking_time", 0)
update_formspec(0, goal, meta)
return false
end
--Keep cooking until there is nothing left to cook.
if cooking_time <= goal then
return true
else
do_cook_all(pos)
meta:set_int("cooking_time", 0)
update_formspec(0, goal, meta)
return false
end
end,
--on_metadata_inventory_put = recalculate,
@ -117,12 +119,13 @@ minetest.register_node("ma_pops_furniture:microwave", {
local inv = meta:get_inventory()
inv:set_size("cook_slot", 1)
end,
on_receive_fields = function(pos, _, fields)
if fields.quit then return end
if fields.btn_start then
recalculate(pos)
end
end,
on_receive_fields = function(pos, _, fields)
if fields.quit then return end
if fields.btn_start then
recalculate(pos)
end
end,
on_blast = function(pos)
local drops = {}
@ -136,22 +139,24 @@ minetest.register_node("ma_pops_furniture:microwave", {
return microwave.recipes[stack:get_name()] and stack:get_count() or 0
end,
--Only allow items to be taken if the microwave hasn't started yet
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if not minetest.get_node_timer(pos):is_started() then
return stack:get_count()
else
return 0
end
end
--Only allow items to be taken if the microwave hasn't started yet
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if not minetest.get_node_timer(pos):is_started() then
return stack:get_count()
else
return 0
end
end
})
-- Recipe Registration
microwave.register_recipe("default:ice", "default:water_source")
-- No milk bucket as this doesn't support substitutes for now
microwave.register_recipe("mobs_mc:chicken_raw", "test:chicken_cooked")
microwave.register_recipe("mobs_mc:chicken_raw", "mobs_mc:chicken_cooked")
--[[ We don't need to check mod existance when registering recipe
Recipe won't even be executed if there is no raw chicken in input ]]--
microwave.register_recipe("mobs_mc:beef_raw", "test:beef_cooked")
microwave.register_recipe("mobs_mc:beef_raw", "mobs_mc:beef_cooked")
microwave.register_recipe("mobs:meat_raw", "mobs:meat")
microwave.register_recipe("farming:coffee_cup", "farming:coffee_cup_hot") -- What a crutch there was...
microwave.register_recipe("farming:corn", "farming:corn_cob")
-- Add needed recipes as you go, note that other mods can add more recipes too

155
misc.lua
View File

@ -110,7 +110,7 @@ minetest.register_node("ma_pops_furniture:smoke_detector_on", {
end,
drawtype = "nodebox",
paramtype = "light",
light_source = default.LIGHT_MAX - 1,
light_source = light,
node_box = {
type = "fixed",
fixed = {
@ -138,12 +138,12 @@ minetest.register_node("ma_pops_furniture:barrel", {
paramtype2 = "facedir",
place_param2 = 0,
tiles = {
"ws_barrel.png", --top
"ws_barrel.png", --bottom
"ws_barrel.png^[transformR90", --right
"ws_barrel.png^[transformR90", --left
"ws_barrel_top.png", --back
"ws_barrel_top.png" --front
"mp_barrel.png", --top
"mp_barrel.png", --bottom
"mp_barrel.png^[transformR90", --right
"mp_barrel.png^[transformR90", --left
"mp_barrel_top.png", --back
"mp_barrel_top.png" --front
},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
@ -310,7 +310,7 @@ end,
})
minetest.register_node("ma_pops_furniture:fan_on", {
description = "fan (on)",
description = "Fan (on)",
tiles = {
"default_coral_skeleton.png",
"default_coral_skeleton.png",
@ -342,7 +342,7 @@ end,
}
})
minetest.register_node("ma_pops_furniture:fan_off", {
description = "fan",
description = "Fan",
tiles = {
"default_coral_skeleton.png",
"default_coral_skeleton.png",
@ -354,7 +354,6 @@ minetest.register_node("ma_pops_furniture:fan_off", {
drawtype = "nodebox",
drop = 'ma_pops_furniture:fan_off',
paramtype2 = "facedir",
light_source = 14,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
node.name = "ma_pops_furniture:fan_on"
minetest.set_node(pos, node)
@ -1063,7 +1062,7 @@ minetest.register_node("ma_pops_furniture:computer", {
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=2, oddly_breakable_by_hand=2, furniture=1, flammable=1},
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -1217,4 +1216,136 @@ minetest.register_node("ma_pops_furniture:stool_"..color, {
end
end
})
end
end
minetest.register_node("ma_pops_furniture:stairs", {
description= "Stairs",
tiles = {
"default_coral_skeleton.png",
"default_coral_skeleton.png",
"default_coral_skeleton.png^mp_stairs_side.png",
"default_coral_skeleton.png^mp_stairs_side.png^[transformFX",
"default_coral_skeleton.png^mp_stairs_back.png",
"default_coral_skeleton.png^mp_stairs_front.png"
},
drawtype = "mesh",
mesh= "stairs.obj",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, oddly_breakable_by_hand = 3},
node_box = {
type = "fixed",
fixed = {
{-0.5, 0.375, 0, 0.5, 0.5, 0.5}, -- NodeBox18
{-0.5, -0.125, -0.5, 0.5, 0, 0}, -- NodeBox19
{-0.0625, -0.375, -0.3125, 0.0625, -0.125, -0.1875}, -- NodeBox20
{-0.0625, -0.25, 0.1875, 0.0625, 0.375, 0.3125}, -- NodeBox21
{-0.0625, -0.375, -0.1875, 0.0625, -0.25, 0.3125}, -- NodeBox23
{-0.0625, -0.25, 0.0625, 0.0625, -0.125, 0.1875}, -- NodeBox24
}
}
})
minetest.register_node("ma_pops_furniture:lamp_1", {
description = "lamp",
tiles = {
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png",
"default_stone.png"
},
groups = {cracky=2, oddly_breakable_by_hand=3},
on_construct = function(pos)
if minetest.get_node(vector.add(pos, vector.new(0, 1, 0))).name == "air" then
minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "ma_pops_furniture:lamp_2_off"})
end
if minetest.get_node(vector.add(pos, vector.new(0, 1, 0))).name ~= "air" then
if minetest.get_node(vector.add(pos, vector.new(0, 1, 0))).name ~= "ma_pops_furniture:lamp_2_off" then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "air"})
end
end
end,
on_dig = function(pos, node, player)
minetest.set_node({x = pos.x , y = pos.y + 1, z = pos.z}, {name = "air"})
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.25, 0.25, -0.375, 0.25}, -- NodeBox16
{-0.0625, -0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox17
}
}
})
minetest.register_node("ma_pops_furniture:lamp_2_on", {
description = "lamp2",
tiles = {
"mp_lt.png",
"mp_lt.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png"
},
groups = {cracky=2, oddly_breakable_by_hand=3, not_in_creative_inventory = 1},
drop = "test:node_1",
on_dig = function(pos, node, player)
minetest.set_node({x = pos.x , y = pos.y - 1, z = pos.z}, {name = "air"})
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end,
drawtype = "nodebox",
paramtype = "light",
light_source = 14,
drop = 'ma_pops_furniture:lamp_2_off',
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
node.name = "ma_pops_furniture:lamp_2_off"
minetest.set_node(pos, node)
end,
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.0625, -0.375, 0.375, 0.5, 0.375}, -- NodeBox16
{-0.0625, -0.5, -0.0625, 0.0625, 0.1875, 0.0625}, -- NodeBox17
}
}
})
minetest.register_node("ma_pops_furniture:lamp_2_off", {
description = "lamp2",
tiles = {
"mp_lt.png",
"mp_lt.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png",
"default_stone.png^mp_ls_top.png"
},
groups = {cracky=2, oddly_breakable_by_hand=3, not_in_creative_inventory = 1},
drop = "test:node_1",
on_dig = function(pos, node, player)
minetest.set_node({x = pos.x , y = pos.y - 1, z = pos.z}, {name = "air"})
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end,
drawtype = "nodebox",
paramtype = "light",
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
node.name = "ma_pops_furniture:lamp_2_on"
minetest.set_node(pos, node)
end,
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.0625, -0.375, 0.375, 0.5, 0.375}, -- NodeBox16
{-0.0625, -0.5, -0.0625, 0.0625, 0.1875, 0.0625}, -- NodeBox17
}
}
})

View File

@ -1,5 +1,3 @@
name = ma_pops_furniture
description = A revamp of Ma and Pop's Furniture Mod
depends = default, fire, wool, dye, farming
optional_depends = mobs_mc
optional_depends = default, fire, wool, dye, farming, mobs_mc, mcl_farming

89
models/lever1.obj Normal file
View File

@ -0,0 +1,89 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib lever1.mtl
o Cube
v -0.171906 -0.523666 0.171906
v -0.171906 -0.523666 -0.171906
v 0.171906 -0.523666 -0.171906
v 0.171906 -0.523666 0.171906
v -0.171906 -0.386141 0.171906
v -0.171906 -0.386141 -0.171906
v 0.171906 -0.386141 -0.171906
v 0.171906 -0.386141 0.171906
v -0.068762 -0.400288 0.079551
v -0.068762 -0.461698 -0.043501
v 0.068762 -0.461698 -0.043501
v 0.068762 -0.400288 0.079551
v -0.068762 0.030396 -0.135383
v -0.068762 -0.031014 -0.258436
v 0.068762 -0.031014 -0.258436
v 0.068762 0.030396 -0.135383
vt 0.999929 0.500000
vt 0.000071 0.500000
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 0.999929 0.500000
vt 0.000071 0.500000
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000000 0.187500
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000071 0.000071
vt 1.000000 1.000000
vt -0.000000 1.000000
vt 0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.500000
vt 0.000000 1.000000
vt -0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt 0.000035 0.999965
vt -0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt -0.000000 0.500000
vt 0.000000 1.000000
vt 0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn -1.0000 0.0000 -0.0000
vn 0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 0.0000
vn -0.0000 0.0000 1.0000
vn 0.0000 0.8948 -0.4465
vn 0.0000 -0.4465 -0.8948
vn -0.0000 0.4465 0.8948
vn 0.0000 -0.8948 0.4465
usemtl Material
s off
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/2 8/6/2 7/7/2 6/8/2
f 1/9/3 5/10/3 6/11/3 2/12/3
f 2/13/4 6/14/4 7/15/4 3/3/4
f 3/16/5 7/7/5 8/17/5 4/18/5
f 5/19/6 1/20/6 4/21/6 8/22/6
f 13/23/7 16/24/7 15/25/7 14/26/7
f 9/27/3 13/23/3 14/28/3 10/29/3
f 10/30/8 14/31/8 15/32/8 11/33/8
f 11/34/5 15/35/5 16/24/5 12/36/5
f 13/37/9 9/38/9 12/39/9 16/40/9
usemtl Material_NONE
f 9/41/10 10/42/10 11/43/10 12/44/10

89
models/lever2.obj Normal file
View File

@ -0,0 +1,89 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib lever2.mtl
o Cube
v 0.171906 -0.523666 -0.171906
v 0.171906 -0.523666 0.171906
v -0.171906 -0.523666 0.171906
v -0.171906 -0.523666 -0.171906
v 0.171906 -0.386141 -0.171906
v 0.171906 -0.386141 0.171906
v -0.171906 -0.386141 0.171906
v -0.171906 -0.386141 -0.171906
v 0.068762 -0.400288 -0.079551
v 0.068762 -0.461698 0.043501
v -0.068762 -0.461698 0.043501
v -0.068762 -0.400288 -0.079551
v 0.068762 0.030396 0.135383
v 0.068762 -0.031014 0.258436
v -0.068762 -0.031014 0.258436
v -0.068762 0.030396 0.135383
vt 0.999929 0.500000
vt 0.000071 0.500000
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 0.999929 0.500000
vt 0.000071 0.500000
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000071 0.000071
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000000 0.187500
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.999929 0.000071
vt 1.000000 0.187500
vt 0.000000 0.187500
vt 0.000071 0.000071
vt 1.000000 1.000000
vt -0.000000 1.000000
vt 0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 0.500000
vt 0.000000 1.000000
vt -0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt 0.000035 0.999965
vt -0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt -0.000000 0.500000
vt 0.000000 1.000000
vt 0.000000 0.500000
vt 1.000000 0.500000
vt 1.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn -0.0000 0.8948 0.4465
vn -0.0000 -0.4465 0.8948
vn 0.0000 0.4465 -0.8948
vn 0.0000 -0.8948 -0.4465
usemtl Material
s off
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/2 8/6/2 7/7/2 6/8/2
f 1/9/3 5/10/3 6/11/3 2/12/3
f 2/13/4 6/14/4 7/15/4 3/3/4
f 3/16/5 7/7/5 8/17/5 4/18/5
f 5/19/6 1/20/6 4/21/6 8/22/6
f 13/23/7 16/24/7 15/25/7 14/26/7
f 9/27/3 13/23/3 14/28/3 10/29/3
f 10/30/8 14/31/8 15/32/8 11/33/8
f 11/34/5 15/35/5 16/24/5 12/36/5
f 13/37/9 9/38/9 12/39/9 16/40/9
usemtl Material_NONE
f 9/41/10 10/42/10 11/43/10 12/44/10

BIN
models/mp_ceiling_fan.fbx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

12
models/stairs.mtl Normal file
View File

@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

86
models/stairs.obj Normal file
View File

@ -0,0 +1,86 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib stairs.mtl
o Cube.003_Cube.004
v -0.145056 -0.155475 -0.315349
v -0.003360 -0.155475 -0.315288
v -0.003419 -0.155475 -0.180255
v -0.145114 -0.155475 -0.180316
v -0.145056 -0.297056 -0.315349
v -0.003360 -0.297056 -0.315288
v -0.003419 -0.297056 -0.180255
v -0.145114 -0.297056 -0.180316
v -0.144081 -0.482542 -0.560711
v -0.004195 -0.482544 -0.560650
v -0.004623 0.545783 0.468518
v -0.144509 0.545785 0.468457
v -0.144121 -0.572912 -0.470414
v -0.004235 -0.572914 -0.470353
v -0.004664 0.455413 0.558814
v -0.144549 0.455415 0.558754
v -0.152012 0.474149 0.261187
v 0.003098 0.474149 0.261254
v 0.003040 0.474149 0.396288
v -0.152071 0.474149 0.396220
v -0.152012 0.332569 0.261187
v 0.003098 0.332569 0.261254
v 0.003039 0.332569 0.396288
v -0.152071 0.332569 0.396221
v -0.574097 -0.097822 -0.570914
v 0.425903 -0.097822 -0.570481
v 0.425694 -0.097822 -0.087989
v -0.574306 -0.097822 -0.088422
v -0.574097 -0.153023 -0.570914
v 0.425903 -0.153023 -0.570481
v 0.425694 -0.153023 -0.087989
v -0.574306 -0.153023 -0.088422
v -0.574319 0.518663 -0.057371
v 0.425680 0.518663 -0.056939
v 0.425472 0.518663 0.425554
v -0.574528 0.518663 0.425121
v -0.574319 0.463462 -0.057371
v 0.425681 0.463462 -0.056938
v 0.425472 0.463462 0.425554
v -0.574528 0.463462 0.425121
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0004 0.0000 -1.0000
vn 1.0000 0.0000 0.0004
vn -0.0004 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0004
vn 0.0003 0.7074 -0.7068
vn -0.0003 -0.7074 0.7068
vn 0.0003 -0.7068 -0.7074
vn -0.0003 0.7068 0.7074
usemtl Material
s off
f 1//1 4//1 3//1 2//1
f 5//2 6//2 7//2 8//2
f 1//3 2//3 6//3 5//3
f 2//4 3//4 7//4 6//4
f 3//5 4//5 8//5 7//5
f 5//6 8//6 4//6 1//6
f 9//7 12//7 11//7 10//7
f 13//8 14//8 15//8 16//8
f 9//9 10//9 14//9 13//9
f 10//4 11//4 15//4 14//4
f 11//10 12//10 16//10 15//10
f 13//6 16//6 12//6 9//6
f 17//1 20//1 19//1 18//1
f 21//2 22//2 23//2 24//2
f 17//3 18//3 22//3 21//3
f 18//4 19//4 23//4 22//4
f 19//5 20//5 24//5 23//5
f 21//6 24//6 20//6 17//6
f 25//1 28//1 27//1 26//1
f 29//2 30//2 31//2 32//2
f 25//3 26//3 30//3 29//3
f 26//4 27//4 31//4 30//4
f 27//5 28//5 32//5 31//5
f 29//6 32//6 28//6 25//6
f 33//1 36//1 35//1 34//1
f 37//2 38//2 39//2 40//2
f 33//3 34//3 38//3 37//3
f 34//4 35//4 39//4 38//4
f 35//5 36//5 40//5 39//5
f 37//6 40//6 36//6 33//6

Binary file not shown.

View File

@ -1,56 +1,3 @@
local night_table = { --name, material, invimg
{'Wood Mailbox', 'wood'},
{'Acacia Wood Mailbox', 'acacia_wood'},
{'Aspen Wood Mailbox', 'aspen_wood'},
{'Pine Wood Mailbox', 'pine_wood'},
{'Jungle Wood Mailbox', 'junglewood'}
}
for i in ipairs (night_table) do
local name = night_table[i][1]
local material = night_table[i][2]
local invimg = night_table[i][3]
minetest.register_node('ma_pops_furniture:mailbox_'..material, {
description = name,
drawtype = 'nodebox',
tiles = {'default_'..material..'.png'},
groups = {choppy=2, oddly_breakably_by_hand=2, furniture=1, flammable=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_wood_defaults(),
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.125, -0.5, -0.125, 0.125, 0.75, 0.125}, -- NodeBox7
{-0.25, 0.75, -0.3125, 0.25, 1.25, 0.3125}, -- NodeBox8
{-0.25, 0.75, -0.5, 0.25, 0.8125, -0.25}, -- NodeBox9
{-0.25, 1.1875, -0.5, 0.25, 1.25, -0.3125}, -- NodeBox10
{-0.25, 0.8125, -0.5, -0.1875, 1.1875, -0.3125}, -- NodeBox11
{0.1875, 0.75, -0.5, 0.25, 1.25, -0.3125}, -- NodeBox12
{-0.1875, 1.125, -0.5, 0.1875, 1.1875, -0.3125}, -- NodeBox13
{-0.1875, 0.8125, -0.5, 0.1875, 1, -0.4375}, -- NodeBox14
}
}
})
end
function ma_pops_furniture.register_hedge(name, def)
-- register nodes
@ -203,7 +150,7 @@ minetest.register_node('ma_pops_furniture:birdbath', {
groups = {cracky=2, oddly_breakable_by_hand=5, furniture=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
})
minetest.register_node('ma_pops_furniture:doorbell', {
@ -220,13 +167,14 @@ minetest.register_node('ma_pops_furniture:doorbell', {
groups = {cracky=2, oddly_breakable_by_hand=5, furniture=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = moditems.STONE_SOUNDS,
on_rightclick = function(pos, node, clicker, itemstack)
node.name = "ma_pops_furniture:doorbell_ring"
minetest.swap_node(pos, node)
-- one second ring.
minetest.get_node_timer(pos):start(1.0)
end,
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -256,7 +204,7 @@ minetest.register_node('ma_pops_furniture:doorbell_ring', {
end,
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
node_box = {
type = "fixed",
fixed = {
@ -275,7 +223,7 @@ minetest.register_node('ma_pops_furniture:stone_path_1', {
groups = {cracky=2, oddly_breakable_by_hand=5, furniture=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.5, -.5, -.5, .5, -.4, .5},
@ -301,7 +249,7 @@ minetest.register_node('ma_pops_furniture:stone_path_'..i, {
groups = {cracky=2, oddly_breakable_by_hand=5, furniture=1, not_in_creative_inventory=1},
paramtype = 'light',
paramtype2 = 'facedir',
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
drop = 'ma_pops_furniture:stone_path_1',
selection_box = {
type = 'fixed',
@ -327,6 +275,7 @@ minetest.register_node("ma_pops_furniture:outdoor_lamp", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sounds = moditems.STONE_SOUNDS,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
node.name = "ma_pops_furniture:outdoor_lamp_on"
minetest.set_node(pos, node)
@ -355,6 +304,7 @@ minetest.register_node("ma_pops_furniture:outdoor_lamp_on", {
paramtype2 = "facedir",
light_source = 14,
drop = 'ma_pops_furniture:outdoor_lamp',
sounds = moditems.STONE_SOUNDS,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
node.name = "ma_pops_furniture:outdoor_lamp"
minetest.set_node(pos, node)
@ -366,4 +316,24 @@ end,
{-0.125, 0.25, -0.125, 0.125, 0.5, 0.125},
},
}
})
minetest.register_node("ma_pops_furniture:trampoline", {
description = "Trampoline",
tiles = {"mp_trampoline_top.png", "default_coal_block.png", "mp_trampoline_side.png"},
drawtype="nodebox",
paramtype2="facedir",
paramtype="light",
groups = {cracky=3, oddly_breakable_by_hand=1, fall_damage_add_percent=-80, bouncy=90},
sounds = {wood = {name="xdecor_bouncy", gain=0.8}},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, -0.5, 0.5, 0, 0.5}, -- NodeBox1
{0.1875, -0.5, 0.1875, 0.5, -0.3125, 0.5}, -- NodeBox2
{-0.5, -0.5, 0.1875, -0.1875, -0.3125, 0.5}, -- NodeBox3
{-0.5, -0.5, -0.5, -0.1875, -0.3125, -0.1875}, -- NodeBox4
{0.1875, -0.5, -0.5, 0.5, -0.3125, -0.1875}, -- NodeBox5
},
}
})

View File

@ -87,7 +87,7 @@ minetest.register_node("ma_pops_furniture:oven", {
groups = {cracky = 2, tubedevice = 1, tubedevice_receiver = 1},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
sounds = moditems.STONE_SOUNDS,
drawtype = "nodebox",
node_box = {
type = "fixed",

View File

@ -57,7 +57,7 @@ minetest.register_node('ma_pops_furniture:sofa_'..color, {
description = name..' Sofa',
drawtype = 'mesh',
mesh = 'FM_sofa.obj',
tiles = {'wool_'..color..'.png'},
tiles = {'wool_'..color..'.png'},
groups = {cracky=3, oddly_breakable_by_hand=2, flammable=1, furniture=1, fall_damage_add_percent=-80, bouncy=80},
--inventory_image = 'mp_sofa.png^[colorize:'..hex,
paramtype = "light",
@ -97,7 +97,7 @@ minetest.register_node('ma_pops_furniture:sofa_l_'..color, {
description = name..' Sofa',
drawtype = 'mesh',
mesh = 'FM_sofa_l.obj',
tiles = {'wool_'..color..'.png'},
tiles = {'wool_'..color..'.png'},
groups = {cracky=3, oddly_breakable_by_hand=2, flammable=1, not_in_creative_inventory=1, fall_damage_add_percent=-80, bouncy=80},
drop = 'ma_pops_furniture:sofa_'..color,
paramtype = "light",
@ -136,7 +136,7 @@ minetest.register_node('ma_pops_furniture:sofa_m_'..color, {
description = name..' Sofa',
drawtype = 'mesh',
mesh = 'FM_sofa_m.obj',
tiles = {'wool_'..color..'.png'},
tiles = {'wool_'..color..'.png'},
groups = {cracky=3, oddly_breakable_by_hand=2, flammable=1, not_in_creative_inventory=1, fall_damage_add_percent=-80, bouncy=80},
drop = 'ma_pops_furniture:sofa_'..color,
paramtype = "light",
@ -208,7 +208,7 @@ minetest.register_node('ma_pops_furniture:sofa_c_'..color, {
description = name..' Sofa',
drawtype = 'mesh',
mesh = 'FM_sofa_c.obj',
tiles = {'wool_'..color..'.png'},
tiles = {'wool_'..color..'.png'},
groups = {cracky=3, oddly_breakable_by_hand=2, flammable=1, not_in_creative_inventory=1, furniture=1, fall_damage_add_percent=-80, bouncy=80},
drop = 'ma_pops_furniture:sofa_'..color,
paramtype = "light",

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

View File

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 538 B

View File

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

BIN
textures/mp_boygame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
textures/mp_boygame_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
textures/mp_dfridge_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
textures/mp_lp_base.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

BIN
textures/mp_lp_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

BIN
textures/mp_oven_GUI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

BIN
textures/mp_stairs_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
textures/mp_stairs_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
textures/mp_ufridge_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
textures/mp_venext_top1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

View File

@ -26,10 +26,6 @@ minetest.register_node("ma_pops_furniture:toaster", {
},
})
minetest.override_item("farming:bread", {
description = S("Bread"),
})
local function breadslice_on_use(itemstack, user, pointed_thing)
local node, pos
if pointed_thing.under then
@ -182,5 +178,6 @@ if not minetest.registered_items["farming:bread_slice"] then
output = 'ma_pops_furniture:breadslice 2',
type = "shapeless",
recipe = {"farming:bread", "ma_pops_furniture:knife"},
replacements = {{"ma_pops_furniture:knife", "ma_pops_furniture:knife"}},
})
end

26
toys.lua Normal file
View File

@ -0,0 +1,26 @@
-- GENERATED CODE
-- Node Box Editor, version 0.9.0
-- Namespace: test
minetest.register_node("ma_pops_furniture:boy_game", {
description = "BoyGame",
tiles = {
"default_silver_sandstone.png^mp_boygame.png",
"default_silver_sandstone.png^mp_boygame_back.png^[transformR180]",
"default_silver_sandstone.png^mp_boygame_right.png",
"default_silver_sandstone.png^mp_boygame_left.png",
"default_silver_sandstone.png^mp_boygame_top.png",
"default_silver_sandstone.png^mp_boygame_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 1, oddly_breakable_by_hand = 1},
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.5, -0.4375, 0.3125, -0.3125, 0.4375},
}
}
})

16
tv.lua
View File

@ -8,7 +8,7 @@ minetest.register_node('ma_pops_furniture:tv_rainbow', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 14,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.45, -.5, -.5, .45, .4, .45}, -- Right, Bottom, Back, Left, Top, Front
@ -44,7 +44,7 @@ minetest.register_node('ma_pops_furniture:tv_blast', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 14,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.45, -.5, -.5, .45, .4, .45}, -- Right, Bottom, Back, Left, Top, Front
@ -80,7 +80,7 @@ minetest.register_node('ma_pops_furniture:tv_static', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 14,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.45, -.5, -.5, .45, .4, .45}, -- Right, Bottom, Back, Left, Top, Front
@ -116,7 +116,7 @@ minetest.register_node('ma_pops_furniture:tv_cube', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 14,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.45, -.5, -.5, .45, .4, .45}, -- Right, Bottom, Back, Left, Top, Front
@ -149,7 +149,7 @@ minetest.register_node('ma_pops_furniture:tv_off', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 1,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.WOOD_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-.45, -.5, -.5, .45, .4, .45}, -- Right, Bottom, Back, Left, Top, Front
@ -184,7 +184,7 @@ minetest.register_node('ma_pops_furniture:lcd_tv_off', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 1,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.STONE_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-0.98, -.5, -.10, 0.98, .8, .10}, -- Right, Bottom, Back, Left, Top, Front
@ -219,7 +219,7 @@ minetest.register_node('ma_pops_furniture:lcd_tv_rainbow', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 1,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.STONE_SOUNDS,
drop = "ma_pops_furniture:lcd_tv_off",
selection_box = {
type = 'fixed',
@ -256,7 +256,7 @@ minetest.register_node('ma_pops_furniture:lcd_tv_blast', {
paramtype = 'light',
paramtype2 = 'facedir',
light_source = 14,
sounds = default.node_sound_wood_defaults(),
sounds = moditems.STONE_SOUNDS,
selection_box = {
type = 'fixed',
fixed = {-0.98, -.5, -.10, 0.98, .8, .10}, -- Right, Bottom, Back, Left, Top, Front