mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 00:20:17 +01:00
whitespace cleanup:
* remove all trailing whitespaces * make inbox and computer use the prevalent indentation rules * CRLF->LF where found
This commit is contained in:
parent
29bf986ea8
commit
be4ed12b6c
@ -1,122 +1,122 @@
|
|||||||
|
|
||||||
-- Amiga 500 lookalike
|
-- Amiga 500 lookalike
|
||||||
computer.register("computer:shefriendSOO", {
|
computer.register("computer:shefriendSOO", {
|
||||||
description = "SheFriendSOO";
|
description = "SheFriendSOO";
|
||||||
tiles_off = { front=true; };
|
tiles_off = { front=true; };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 17, 32, 32, 12 }, -- Monitor Screen
|
{ 0, 0, 17, 32, 32, 12 }, -- Monitor Screen
|
||||||
{ 3, 3, 29, 26, 26, 3 }, -- Monitor Tube
|
{ 3, 3, 29, 26, 26, 3 }, -- Monitor Tube
|
||||||
{ 0, 0, 0, 32, 4, 17 }, -- Keyboard
|
{ 0, 0, 0, 32, 4, 17 }, -- Keyboard
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Some generic laptop
|
-- Some generic laptop
|
||||||
computer.register("computer:vanio", {
|
computer.register("computer:vanio", {
|
||||||
description = "Pony Vanio";
|
description = "Pony Vanio";
|
||||||
tiles_off = { front=true; top=true; left=true; right=true; back=true; };
|
tiles_off = { front=true; top=true; left=true; right=true; back=true; };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
|
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
|
||||||
{ 0, 3, 25, 32, 21, 3 }, -- Screen
|
{ 0, 3, 25, 32, 21, 3 }, -- Screen
|
||||||
});
|
});
|
||||||
node_box_off = computer.pixelnodebox(32, {
|
node_box_off = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
|
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
|
||||||
{ 0, 3, 4, 32, 3, 24 }, -- Screen
|
{ 0, 3, 4, 32, 3, 24 }, -- Screen
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Sony PlayStation lookalike
|
-- Sony PlayStation lookalike
|
||||||
computer.register("computer:slaystation", {
|
computer.register("computer:slaystation", {
|
||||||
description = "Pony SlayStation";
|
description = "Pony SlayStation";
|
||||||
tiles_off = { top=true; };
|
tiles_off = { top=true; };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 11, 32, 6, 21 }, -- Console
|
{ 0, 0, 11, 32, 6, 21 }, -- Console
|
||||||
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
|
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
|
||||||
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
|
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
|
||||||
{ 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center
|
{ 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center
|
||||||
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
|
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
|
||||||
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
|
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
|
||||||
{ 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center
|
{ 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Sony PlayStation 2 lookalike
|
-- Sony PlayStation 2 lookalike
|
||||||
computer.register("computer:slaystation2", {
|
computer.register("computer:slaystation2", {
|
||||||
description = "Pony SlayStation 2";
|
description = "Pony SlayStation 2";
|
||||||
tiles_off = { front=true; };
|
tiles_off = { front=true; };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 2, 2, 11, 28, 3, 19 }, -- Console (Upper part)
|
{ 2, 2, 11, 28, 3, 19 }, -- Console (Upper part)
|
||||||
{ 2, 0, 11, 26, 2, 19 }, -- Console (Lower part)
|
{ 2, 0, 11, 26, 2, 19 }, -- Console (Lower part)
|
||||||
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
|
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
|
||||||
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
|
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
|
||||||
{ 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center
|
{ 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center
|
||||||
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
|
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
|
||||||
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
|
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
|
||||||
{ 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center
|
{ 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Sinclair ZX Spectrum lookalike
|
-- Sinclair ZX Spectrum lookalike
|
||||||
computer.register("computer:specter", {
|
computer.register("computer:specter", {
|
||||||
description = "SX Specter";
|
description = "SX Specter";
|
||||||
tiles_off = { };
|
tiles_off = { };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 3, 0, 0, 26, 4, 17 }, -- Keyboard
|
{ 3, 0, 0, 26, 4, 17 }, -- Keyboard
|
||||||
{ 18, 0, 18, 12, 6, 14 }, -- Tape Player
|
{ 18, 0, 18, 12, 6, 14 }, -- Tape Player
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Nintendo Wii lookalike
|
-- Nintendo Wii lookalike
|
||||||
computer.register("computer:wee", {
|
computer.register("computer:wee", {
|
||||||
description = "Nientiendo Wee";
|
description = "Nientiendo Wee";
|
||||||
tiles_off = { front=true; };
|
tiles_off = { front=true; };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 11, 0, 3, 10, 6, 26 }, -- Base
|
{ 11, 0, 3, 10, 6, 26 }, -- Base
|
||||||
{ 12, 6, 4, 8, 22, 24 }, -- Top
|
{ 12, 6, 4, 8, 22, 24 }, -- Top
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Apple iPad lookalike
|
-- Apple iPad lookalike
|
||||||
minetest.register_node("computer:piepad", {
|
minetest.register_node("computer:piepad", {
|
||||||
description = "Snapple Piepad",
|
description = "Snapple Piepad",
|
||||||
drawtype = "signlike",
|
drawtype = "signlike",
|
||||||
tiles = {"computer_piepad_inv.png"},
|
tiles = {"computer_piepad_inv.png"},
|
||||||
inventory_image = "computer_piepad_inv.png",
|
inventory_image = "computer_piepad_inv.png",
|
||||||
wield_image = "computer_piepad_inv.png",
|
wield_image = "computer_piepad_inv.png",
|
||||||
sunlight_propagates = false,
|
sunlight_propagates = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
light_source = 10,
|
light_source = 10,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = { snappy=3, cracky=3, choppy=3, oddly_breakable_by_hand=3},
|
groups = { snappy=3, cracky=3, choppy=3, oddly_breakable_by_hand=3},
|
||||||
selection_box = {type = "wallmounted"},
|
selection_box = {type = "wallmounted"},
|
||||||
sounds = default.node_sound_wood_defaults()
|
sounds = default.node_sound_wood_defaults()
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Commodore 64 lookalike
|
-- Commodore 64 lookalike
|
||||||
computer.register("computer:admiral64", {
|
computer.register("computer:admiral64", {
|
||||||
description = "Admiral64";
|
description = "Admiral64";
|
||||||
tiles_off = { };
|
tiles_off = { };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 0, 32, 4, 18 }, -- Keyboard
|
{ 0, 0, 0, 32, 4, 18 }, -- Keyboard
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
-- Commodore 128 lookalike
|
-- Commodore 128 lookalike
|
||||||
computer.register("computer:admiral128", {
|
computer.register("computer:admiral128", {
|
||||||
description = "Admiral128";
|
description = "Admiral128";
|
||||||
tiles_off = { };
|
tiles_off = { };
|
||||||
node_box = computer.pixelnodebox(32, {
|
node_box = computer.pixelnodebox(32, {
|
||||||
-- X Y Z W H L
|
-- X Y Z W H L
|
||||||
{ 0, 0, 0, 32, 4, 27 }, -- Keyboard
|
{ 0, 0, 0, 32, 4, 27 }, -- Keyboard
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
---------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------
|
||||||
@ -127,8 +127,8 @@ computer.register("computer:admiral128", {
|
|||||||
minetest.register_node("computer:monitor_on", {
|
minetest.register_node("computer:monitor_on", {
|
||||||
description = "Monitor and keyboard",
|
description = "Monitor and keyboard",
|
||||||
tiles = {"computer_monitor_t.png","computer_monitor_bt.png",
|
tiles = {"computer_monitor_t.png","computer_monitor_bt.png",
|
||||||
"computer_monitor_l.png","computer_monitor_r.png",
|
"computer_monitor_l.png","computer_monitor_r.png",
|
||||||
"computer_monitor_b.png","computer_monitor_f_desktop.png"}, --"computer_monitor_f_on.png"}, --till i get a boot abm inplace
|
"computer_monitor_b.png","computer_monitor_f_desktop.png"}, --"computer_monitor_f_on.png"}, --till i get a boot abm inplace
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
light_source = 4,
|
light_source = 4,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -150,16 +150,16 @@ minetest.register_node("computer:monitor_on", {
|
|||||||
},
|
},
|
||||||
drop = 'computer:monitor',
|
drop = 'computer:monitor',
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:monitor";
|
node.name = "computer:monitor";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("computer:monitor_bios", {
|
minetest.register_node("computer:monitor_bios", {
|
||||||
description = "Monitor and keyboard",
|
description = "Monitor and keyboard",
|
||||||
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
|
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
|
||||||
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_bios.png"},
|
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_bios.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
light_source = 4,
|
light_source = 4,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -263,7 +263,7 @@ minetest.register_node("computer:monitor_desktop", {
|
|||||||
minetest.register_node("computer:monitor", {
|
minetest.register_node("computer:monitor", {
|
||||||
description = "Monitor and keyboard",
|
description = "Monitor and keyboard",
|
||||||
tiles = {"computer_monitor_t_off.png","computer_monitor_bt.png","computer_monitor_l.png",
|
tiles = {"computer_monitor_t_off.png","computer_monitor_bt.png","computer_monitor_l.png",
|
||||||
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_off.png"},
|
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_off.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
light_source = 4,
|
light_source = 4,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -284,9 +284,9 @@ minetest.register_node("computer:monitor", {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:monitor_on";
|
node.name = "computer:monitor_on";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -341,9 +341,9 @@ minetest.register_node("computer:tower_on", {
|
|||||||
},
|
},
|
||||||
drop = 'computer:tower',
|
drop = 'computer:tower',
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:tower";
|
node.name = "computer:tower";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -373,9 +373,9 @@ minetest.register_node("computer:tower", {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:tower_on";
|
node.name = "computer:tower_on";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -408,76 +408,76 @@ minetest.register_node("computer:printer", {
|
|||||||
|
|
||||||
--Rack Server
|
--Rack Server
|
||||||
minetest.register_node("computer:server", {
|
minetest.register_node("computer:server", {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
description = "Rack Server",
|
description = "Rack Server",
|
||||||
tiles = {
|
tiles = {
|
||||||
'computer_server_t.png',
|
'computer_server_t.png',
|
||||||
'computer_server_bt.png',
|
'computer_server_bt.png',
|
||||||
'computer_server_l.png',
|
'computer_server_l.png',
|
||||||
'computer_server_r.png',
|
'computer_server_r.png',
|
||||||
'computer_server_bt.png',
|
'computer_server_bt.png',
|
||||||
'computer_server_f_off.png'
|
'computer_server_f_off.png'
|
||||||
},
|
},
|
||||||
inventory_image = "computer_server_inv.png",
|
inventory_image = "computer_server_inv.png",
|
||||||
sunlight_propagates = false,
|
sunlight_propagates = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
walkable = true,
|
walkable = true,
|
||||||
groups = {snappy=3},
|
groups = {snappy=3},
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:server_on";
|
node.name = "computer:server_on";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end,
|
end,
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
local pos = pointed_thing.above
|
local pos = pointed_thing.above
|
||||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
|
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
|
||||||
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" )
|
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("computer:server_on", {
|
minetest.register_node("computer:server_on", {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
description = "Rack Server",
|
description = "Rack Server",
|
||||||
tiles = {
|
tiles = {
|
||||||
'computer_server_t.png',
|
'computer_server_t.png',
|
||||||
'computer_server_bt.png',
|
'computer_server_bt.png',
|
||||||
'computer_server_r.png',
|
'computer_server_r.png',
|
||||||
'computer_server_l.png',
|
'computer_server_l.png',
|
||||||
'computer_server_bt.png',
|
'computer_server_bt.png',
|
||||||
'computer_server_f_on.png',
|
'computer_server_f_on.png',
|
||||||
},
|
},
|
||||||
inventory_image = "computer_server_inv.png",
|
inventory_image = "computer_server_inv.png",
|
||||||
sunlight_propagates = false,
|
sunlight_propagates = false,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
walkable = true,
|
walkable = true,
|
||||||
groups = {snappy=3,not_in_creative_inventory=1},
|
groups = {snappy=3,not_in_creative_inventory=1},
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
||||||
},
|
},
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
drop = 'computer:server',
|
drop = 'computer:server',
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
node.name = "computer:server";
|
node.name = "computer:server";
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -2,99 +2,99 @@
|
|||||||
computer = { };
|
computer = { };
|
||||||
|
|
||||||
computer.register = function ( name, def )
|
computer.register = function ( name, def )
|
||||||
local nodename = name;
|
local nodename = name;
|
||||||
if (name:sub(1, 1) == ":") then name = name:sub(2); end
|
if (name:sub(1, 1) == ":") then name = name:sub(2); end
|
||||||
local modname, basename = name:match("^([^:]+):(.*)");
|
local modname, basename = name:match("^([^:]+):(.*)");
|
||||||
local TEXPFX = modname.."_"..basename.."_";
|
local TEXPFX = modname.."_"..basename.."_";
|
||||||
local ONSTATE = modname..":"..basename;
|
local ONSTATE = modname..":"..basename;
|
||||||
local OFFSTATE = modname..":"..basename.."_off";
|
local OFFSTATE = modname..":"..basename.."_off";
|
||||||
local def = def;
|
local def = def;
|
||||||
minetest.register_node(ONSTATE, {
|
minetest.register_node(ONSTATE, {
|
||||||
drawtype = "nodebox";
|
drawtype = "nodebox";
|
||||||
paramtype = "light";
|
paramtype = "light";
|
||||||
paramtype2 = "facedir";
|
paramtype2 = "facedir";
|
||||||
description = def.description;
|
description = def.description;
|
||||||
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 };
|
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 };
|
||||||
tiles = {
|
tiles = {
|
||||||
TEXPFX.."tp.png",
|
TEXPFX.."tp.png",
|
||||||
TEXPFX.."bt.png",
|
TEXPFX.."bt.png",
|
||||||
TEXPFX.."rt.png",
|
TEXPFX.."rt.png",
|
||||||
TEXPFX.."lt.png",
|
TEXPFX.."lt.png",
|
||||||
TEXPFX.."bk.png",
|
TEXPFX.."bk.png",
|
||||||
TEXPFX.."ft.png",
|
TEXPFX.."ft.png",
|
||||||
};
|
};
|
||||||
node_box = def.node_box;
|
node_box = def.node_box;
|
||||||
selection_box = def.node_box;
|
selection_box = def.node_box;
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
if (def.on_turn_off) then
|
if (def.on_turn_off) then
|
||||||
if (def.on_turn_off(pos, node, clicker, itemstack)) then return; end
|
if (def.on_turn_off(pos, node, clicker, itemstack)) then return; end
|
||||||
end
|
end
|
||||||
node.name = OFFSTATE;
|
node.name = OFFSTATE;
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos);
|
nodeupdate(pos);
|
||||||
end;
|
end;
|
||||||
});
|
});
|
||||||
minetest.register_node(OFFSTATE, {
|
minetest.register_node(OFFSTATE, {
|
||||||
drawtype = "nodebox";
|
drawtype = "nodebox";
|
||||||
paramtype = "light";
|
paramtype = "light";
|
||||||
paramtype2 = "facedir";
|
paramtype2 = "facedir";
|
||||||
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2,
|
||||||
not_in_creative_inventory=1 };
|
not_in_creative_inventory=1 };
|
||||||
tiles = {
|
tiles = {
|
||||||
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
|
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
|
||||||
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
|
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
|
||||||
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
|
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
|
||||||
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
|
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
|
||||||
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
|
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
|
||||||
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png"),
|
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png"),
|
||||||
};
|
};
|
||||||
node_box = def.node_box_off or def.node_box;
|
node_box = def.node_box_off or def.node_box;
|
||||||
selection_box = def.node_box_off or def.node_box;
|
selection_box = def.node_box_off or def.node_box;
|
||||||
on_rightclick = function ( pos, node, clicker, itemstack)
|
on_rightclick = function ( pos, node, clicker, itemstack)
|
||||||
if (def.on_turn_on) then
|
if (def.on_turn_on) then
|
||||||
if (def.on_turn_on(pos, node, clicker, itemstack)) then return; end
|
if (def.on_turn_on(pos, node, clicker, itemstack)) then return; end
|
||||||
end
|
end
|
||||||
node.name = ONSTATE;
|
node.name = ONSTATE;
|
||||||
minetest.set_node(pos, node);
|
minetest.set_node(pos, node);
|
||||||
nodeupdate(pos);
|
nodeupdate(pos);
|
||||||
end;
|
end;
|
||||||
drop = ONSTATE;
|
drop = ONSTATE;
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
|
|
||||||
computer.register_handheld = function ( name, def )
|
computer.register_handheld = function ( name, def )
|
||||||
local nodename = name;
|
local nodename = name;
|
||||||
if (name:sub(1, 1) == ":") then name = name:sub(2); end
|
if (name:sub(1, 1) == ":") then name = name:sub(2); end
|
||||||
local modname, basename = name:match("^([^:]+):(.*)");
|
local modname, basename = name:match("^([^:]+):(.*)");
|
||||||
local TEXPFX = modname.."_"..basename.."_inv";
|
local TEXPFX = modname.."_"..basename.."_inv";
|
||||||
local ONSTATE = modname..":"..basename;
|
local ONSTATE = modname..":"..basename;
|
||||||
local OFFSTATE = modname..":"..basename.."_off";
|
local OFFSTATE = modname..":"..basename.."_off";
|
||||||
local on_use = def.on_use;
|
local on_use = def.on_use;
|
||||||
minetest.register_craftitem(ONSTATE, {
|
minetest.register_craftitem(ONSTATE, {
|
||||||
description = def.description;
|
description = def.description;
|
||||||
inventory_image = TEXPFX..".png";
|
inventory_image = TEXPFX..".png";
|
||||||
wield_image = TEXPFX..".png";
|
wield_image = TEXPFX..".png";
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
|
|
||||||
computer.pixelnodebox = function ( size, boxes )
|
computer.pixelnodebox = function ( size, boxes )
|
||||||
local fixed = { };
|
local fixed = { };
|
||||||
local i, box;
|
local i, box;
|
||||||
for i, box in ipairs(boxes) do
|
for i, box in ipairs(boxes) do
|
||||||
local x, y, z, w, h, l = unpack(box);
|
local x, y, z, w, h, l = unpack(box);
|
||||||
fixed[#fixed + 1] = {
|
fixed[#fixed + 1] = {
|
||||||
(x / size) - 0.5,
|
(x / size) - 0.5,
|
||||||
(y / size) - 0.5,
|
(y / size) - 0.5,
|
||||||
(z / size) - 0.5,
|
(z / size) - 0.5,
|
||||||
((x + w) / size) - 0.5,
|
((x + w) / size) - 0.5,
|
||||||
((y + h) / size) - 0.5,
|
((y + h) / size) - 0.5,
|
||||||
((z + l) / size) - 0.5,
|
((z + l) / size) - 0.5,
|
||||||
};
|
};
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
type = "fixed";
|
type = "fixed";
|
||||||
fixed = fixed;
|
fixed = fixed;
|
||||||
};
|
};
|
||||||
end
|
end
|
||||||
|
|
||||||
local MODPATH = minetest.get_modpath("computer");
|
local MODPATH = minetest.get_modpath("computer");
|
||||||
|
@ -14,63 +14,63 @@ end
|
|||||||
|
|
||||||
if (not minetest.get_modpath("homedecor")) then
|
if (not minetest.get_modpath("homedecor")) then
|
||||||
|
|
||||||
minetest.register_craftitem(":homedecor:plastic_sheeting", {
|
minetest.register_craftitem(":homedecor:plastic_sheeting", {
|
||||||
description = S("Plastic sheet"),
|
description = S("Plastic sheet"),
|
||||||
inventory_image = "homedecor_plastic_sheeting.png",
|
inventory_image = "homedecor_plastic_sheeting.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem(":homedecor:plastic_base", {
|
minetest.register_craftitem(":homedecor:plastic_base", {
|
||||||
description = S("Unprocessed Plastic base"),
|
description = S("Unprocessed Plastic base"),
|
||||||
wield_image = "homedecor_plastic_base.png",
|
wield_image = "homedecor_plastic_base.png",
|
||||||
inventory_image = "homedecor_plastic_base_inv.png",
|
inventory_image = "homedecor_plastic_base_inv.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'homedecor:plastic_base 6',
|
output = 'homedecor:plastic_base 6',
|
||||||
recipe = { "default:junglegrass",
|
recipe = { "default:junglegrass",
|
||||||
"default:junglegrass",
|
"default:junglegrass",
|
||||||
"default:junglegrass"
|
"default:junglegrass"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'homedecor:plastic_base 3',
|
output = 'homedecor:plastic_base 3',
|
||||||
recipe = { "default:dry_shrub",
|
recipe = { "default:dry_shrub",
|
||||||
"default:dry_shrub",
|
"default:dry_shrub",
|
||||||
"default:dry_shrub"
|
"default:dry_shrub"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = 'homedecor:plastic_base 4',
|
output = 'homedecor:plastic_base 4',
|
||||||
recipe = { "default:leaves",
|
recipe = { "default:leaves",
|
||||||
"default:leaves",
|
"default:leaves",
|
||||||
"default:leaves",
|
"default:leaves",
|
||||||
"default:leaves",
|
"default:leaves",
|
||||||
"default:leaves",
|
"default:leaves",
|
||||||
"default:leaves"
|
"default:leaves"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "homedecor:plastic_sheeting",
|
output = "homedecor:plastic_sheeting",
|
||||||
recipe = "homedecor:plastic_base",
|
recipe = "homedecor:plastic_base",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = 'fuel',
|
type = 'fuel',
|
||||||
recipe = 'homedecor:plastic_base',
|
recipe = 'homedecor:plastic_base',
|
||||||
burntime = 30,
|
burntime = 30,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = 'fuel',
|
type = 'fuel',
|
||||||
recipe = 'homedecor:plastic_sheeting',
|
recipe = 'homedecor:plastic_sheeting',
|
||||||
burntime = 30,
|
burntime = 30,
|
||||||
})
|
})
|
||||||
|
|
||||||
end -- not homedecor
|
end -- not homedecor
|
||||||
|
@ -3,132 +3,132 @@
|
|||||||
-- License is WTFPL (see README.txt).
|
-- License is WTFPL (see README.txt).
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:shefriendSOO";
|
output = "computer:shefriendSOO";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:slaystation";
|
output = "computer:slaystation";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:vanio";
|
output = "computer:vanio";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "", "", },
|
{ "homedecor:plastic_sheeting", "", "", },
|
||||||
{ "default:glass", "", "" },
|
{ "default:glass", "", "" },
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:specter";
|
output = "computer:specter";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "", "", "homedecor:plastic_sheeting", },
|
{ "", "", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:slaystation2";
|
output = "computer:slaystation2";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:admiral64";
|
output = "computer:admiral64";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "default:wood", "default:wood", "default:wood", },
|
{ "default:wood", "default:wood", "default:wood", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:admiral128";
|
output = "computer:admiral128";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", },
|
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:wee";
|
output = "computer:wee";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:copper_ingot", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:copper_ingot", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:piepad";
|
output = "computer:piepad";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
--new stuff
|
--new stuff
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:monitor";
|
output = "computer:monitor";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "default:glass","", },
|
{ "homedecor:plastic_sheeting", "default:glass","", },
|
||||||
{ "homedecor:plastic_sheeting", "default:glass","", },
|
{ "homedecor:plastic_sheeting", "default:glass","", },
|
||||||
{ "homedecor:plastic_sheeting", "default:mese_crystal_fragment", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:mese_crystal_fragment", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:router";
|
output = "computer:router";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "default:steel_ingot","","", },
|
{ "default:steel_ingot","","", },
|
||||||
{ "default:steel_ingot" ,"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "default:steel_ingot" ,"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
{ "default:mese_crystal_fragment","homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
{ "default:mese_crystal_fragment","homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:tower";
|
output = "computer:tower";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:printer";
|
output = "computer:printer";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
|
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
|
||||||
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "default:coal_lump", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:coal_lump", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:printer";
|
output = "computer:printer";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
|
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
|
||||||
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
|
||||||
{ "homedecor:plastic_sheeting", "dye:black", "homedecor:plastic_sheeting", },
|
{ "homedecor:plastic_sheeting", "dye:black", "homedecor:plastic_sheeting", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "computer:server";
|
output = "computer:server";
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "computer:tower", "computer:tower", "computer:tower", },
|
{ "computer:tower", "computer:tower", "computer:tower", },
|
||||||
{ "computer:tower", "computer:tower", "computer:tower", },
|
{ "computer:tower", "computer:tower", "computer:tower", },
|
||||||
{ "computer:tower", "computer:tower", "computer:tower", },
|
{ "computer:tower", "computer:tower", "computer:tower", },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
154
inbox/init.lua
154
inbox/init.lua
@ -6,86 +6,86 @@ TODO
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output ="inbox:empty",
|
output ="inbox:empty",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"","default:steel_ingot",""},
|
{"","default:steel_ingot",""},
|
||||||
{"default:steel_ingot","","default:steel_ingot"},
|
{"default:steel_ingot","","default:steel_ingot"},
|
||||||
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}
|
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("inbox:empty", {
|
minetest.register_node("inbox:empty", {
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-4/12, -6/12, -6/12, 4/12, 0/12, 6/12},
|
{-4/12, -6/12, -6/12, 4/12, 0/12, 6/12},
|
||||||
{-3/12, 0/12, -6/12, 3/12, 2/12, 6/12},
|
{-3/12, 0/12, -6/12, 3/12, 2/12, 6/12},
|
||||||
{3/12, 0/12, -4/12, 4/12, 5/12, -2/12},
|
{3/12, 0/12, -4/12, 4/12, 5/12, -2/12},
|
||||||
{3/12, 3/12, -2/12, 4/12, 5/12, 0/12}
|
{3/12, 3/12, -2/12, 4/12, 5/12, 0/12}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
description = "Mailbox",
|
description = "Mailbox",
|
||||||
tiles = {"inbox_top.png", "inbox_bottom.png", "inbox_east.png",
|
tiles = {"inbox_top.png", "inbox_bottom.png", "inbox_east.png",
|
||||||
"inbox_west.png", "inbox_back.png", "inbox_front.png"},
|
"inbox_west.png", "inbox_back.png", "inbox_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {choppy=2,oddly_breakable_by_hand=2},
|
groups = {choppy=2,oddly_breakable_by_hand=2},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer, itemstack)
|
after_place_node = function(pos, placer, itemstack)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local owner = placer:get_player_name()
|
local owner = placer:get_player_name()
|
||||||
meta:set_string("owner", owner)
|
meta:set_string("owner", owner)
|
||||||
meta:set_string("infotext", owner.."'s Mailbox")
|
meta:set_string("infotext", owner.."'s Mailbox")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
inv:set_size("drop", 1)
|
inv:set_size("drop", 1)
|
||||||
end,
|
end,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local player = clicker:get_player_name()
|
local player = clicker:get_player_name()
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if owner == player then
|
if owner == player then
|
||||||
minetest.show_formspec(
|
minetest.show_formspec(
|
||||||
clicker:get_player_name(),
|
clicker:get_player_name(),
|
||||||
"default:chest_locked",
|
"default:chest_locked",
|
||||||
inbox.get_inbox_formspec(pos))
|
inbox.get_inbox_formspec(pos))
|
||||||
else
|
else
|
||||||
minetest.show_formspec(
|
minetest.show_formspec(
|
||||||
clicker:get_player_name(),
|
clicker:get_player_name(),
|
||||||
"default:chest_locked",
|
"default:chest_locked",
|
||||||
inbox.get_inbox_insert_formspec(pos))
|
inbox.get_inbox_insert_formspec(pos))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return player:get_player_name() == owner and inv:is_empty("main")
|
return player:get_player_name() == owner and inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "drop" and inv:room_for_item("main", stack) then
|
if listname == "drop" and inv:room_for_item("main", stack) then
|
||||||
inv:remove_item("drop", stack)
|
inv:remove_item("drop", stack)
|
||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
if listname == "main" then
|
if listname == "main" then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
if listname == "drop" then
|
if listname == "drop" then
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if inv:room_for_item("main", stack) then
|
if inv:room_for_item("main", stack) then
|
||||||
return -1
|
return -1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
function inbox.get_inbox_formspec(pos)
|
function inbox.get_inbox_formspec(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user