shift+click support and new textures
16
cobble.lua
@ -29,27 +29,29 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
|
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.env:get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
@ -60,7 +62,7 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
@ -71,7 +73,7 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
|
@ -7,8 +7,8 @@ end
|
|||||||
|
|
||||||
minetest.register_node("more_chests:dropbox", {
|
minetest.register_node("more_chests:dropbox", {
|
||||||
description = "Dropbox",
|
description = "Dropbox",
|
||||||
tiles = {"default_chest_top.png", "default_chest_top.png", "dropbox_right.png",
|
tiles = {"dropbox_top.png", "dropbox_top.png", "dropbox_side.png",
|
||||||
"default_chest_side.png", "default_chest_side.png", "dropbox_front.png"},
|
"dropbox_side.png", "dropbox_side.png", "dropbox_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
||||||
-- Pipeworks
|
-- Pipeworks
|
||||||
@ -39,7 +39,9 @@ minetest.register_node("more_chests:dropbox", {
|
|||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]")
|
||||||
meta:set_string("infotext", "Chest")
|
meta:set_string("infotext", "Chest")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
|
20
secret.lua
@ -8,14 +8,16 @@ end
|
|||||||
local open = "size[8,10]"..
|
local open = "size[8,10]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"..
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]" ..
|
||||||
"button[3,9;2,1;open;close]"
|
"button[3,9;2,1;open;close]"
|
||||||
local closed = "size[2,1]"..
|
local closed = "size[2,1]"..
|
||||||
"button[0,0;2,1;open;open]"
|
"button[0,0;2,1;open;open]"
|
||||||
|
|
||||||
minetest.register_node("more_chests:secret", {
|
minetest.register_node("more_chests:secret", {
|
||||||
description = "Secret Chest",
|
description = "Secret Chest",
|
||||||
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
|
tiles = {"secret_top.png", "secret_top.png", "secret_side.png",
|
||||||
"default_chest_side.png", "default_chest_side.png", "secret_front.png"},
|
"secret_side.png", "secret_side.png", "secret_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
||||||
-- Pipeworks
|
-- Pipeworks
|
||||||
@ -36,13 +38,13 @@ minetest.register_node("more_chests:secret", {
|
|||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Secret Chest (owned by "..
|
meta:set_string("infotext", "Secret Chest (owned by "..
|
||||||
meta:get_string("owner")..")")
|
meta:get_string("owner")..")")
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec", open)
|
meta:set_string("formspec", open)
|
||||||
meta:set_string("infotext", "Secret Chest")
|
meta:set_string("infotext", "Secret Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
@ -50,12 +52,12 @@ minetest.register_node("more_chests:secret", {
|
|||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.env:get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -66,7 +68,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -77,7 +79,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -100,7 +102,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
" takes stuff from secret chest at "..minetest.pos_to_string(pos))
|
" takes stuff from secret chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if has_locked_chest_privilege(meta, sender) then
|
if has_locked_chest_privilege(meta, sender) then
|
||||||
if fields.open == "open" then
|
if fields.open == "open" then
|
||||||
meta:set_string("formspec", open)
|
meta:set_string("formspec", open)
|
||||||
|
24
shared.lua
@ -16,13 +16,15 @@ local function get_formspec(string)
|
|||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"..
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
"field[.25,9.5;6,1;shared;Shared with (separate names with spaces):;"..string.."]"..
|
"field[.25,9.5;6,1;shared;Shared with (separate names with spaces):;"..string.."]"..
|
||||||
"button[6,9;2,1;submit;submit]"
|
"button[6,9;2,1;submit;submit]" ..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]"
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("more_chests:shared", {
|
minetest.register_node("more_chests:shared", {
|
||||||
description = "Shared Chest",
|
description = "Shared Chest",
|
||||||
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
|
tiles = {"shared_top.png", "shared_top.png", "shared_side.png",
|
||||||
"default_chest_side.png", "default_chest_side.png", "shared_front.png"},
|
"shared_side.png", "shared_side.png", "shared_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
||||||
-- Pipeworks
|
-- Pipeworks
|
||||||
@ -43,13 +45,13 @@ minetest.register_node("more_chests:shared", {
|
|||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Shared Chest (owned by "..
|
meta:set_string("infotext", "Shared Chest (owned by "..
|
||||||
meta:get_string("owner")..")")
|
meta:get_string("owner")..")")
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec", get_formspec(""))
|
meta:set_string("formspec", get_formspec(""))
|
||||||
meta:set_string("infotext", "Shared Chest")
|
meta:set_string("infotext", "Shared Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
@ -57,12 +59,12 @@ minetest.register_node("more_chests:shared", {
|
|||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.env:get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -73,7 +75,7 @@ minetest.register_node("more_chests:shared", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -84,7 +86,7 @@ minetest.register_node("more_chests:shared", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -107,8 +109,8 @@ minetest.register_node("more_chests:shared", {
|
|||||||
" takes stuff from shared chest at "..minetest.pos_to_string(pos))
|
" takes stuff from shared chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formspec, fields, sender)
|
on_receive_fields = function(pos, formspec, fields, sender)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.env:get_meta(pos);
|
||||||
if fields.shared then
|
if fields.shared then
|
||||||
if meta:get_string("owner") == sender:get_player_name() then
|
if meta:get_string("owner") == sender:get_player_name() then
|
||||||
meta:set_string("shared", fields.shared);
|
meta:set_string("shared", fields.shared);
|
||||||
meta:set_string("formspec", get_formspec(fields.shared))
|
meta:set_string("formspec", get_formspec(fields.shared))
|
||||||
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 728 B |
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 693 B |
BIN
textures/dropbox_side.png
Normal file
After Width: | Height: | Size: 435 B |
BIN
textures/dropbox_top.png
Normal file
After Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 731 B After Width: | Height: | Size: 455 B |
BIN
textures/secret_side.png
Normal file
After Width: | Height: | Size: 421 B |
BIN
textures/secret_top.png
Normal file
After Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 502 B |
BIN
textures/shared_side.png
Normal file
After Width: | Height: | Size: 435 B |
BIN
textures/shared_top.png
Normal file
After Width: | Height: | Size: 481 B |
BIN
textures/wifi_front.png
Normal file
After Width: | Height: | Size: 864 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 741 B |
10
wifi.lua
@ -1,19 +1,19 @@
|
|||||||
minetest.register_node("more_chests:wifi", {
|
minetest.register_node("more_chests:wifi", {
|
||||||
description = "Wifi Chest",
|
description = "Wifi Chest",
|
||||||
tiles = {"wifi_top.png", "wifi_top.png", "wifi_side.png",
|
tiles = {"wifi_top.png", "wifi_top.png", "wifi_side.png",
|
||||||
"wifi_side.png", "wifi_side.png",
|
"wifi_side.png", "wifi_side.png", "wifi_front.png"},
|
||||||
{name="wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
|
|
||||||
},
|
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_player;more_chests:wifi;0,0;8,4;]"..
|
"list[current_player;more_chests:wifi;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]" ..
|
||||||
|
"listring[current_player;more_chests:wifi]" ..
|
||||||
|
"listring[current_player;main]")
|
||||||
meta:set_string("infotext", "Wifi Chest")
|
meta:set_string("infotext", "Wifi Chest")
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|