1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-06-28 04:50:21 +02:00

namespace plasmascreen and inbox (#22)

This commit is contained in:
wsor4035
2022-02-14 17:54:32 -05:00
committed by GitHub
parent 769e14fd11
commit 694bfe5fe7
37 changed files with 43 additions and 38 deletions

View File

@ -0,0 +1,20 @@
unused_args = false
allow_defined_top = true
max_comment_line_length = 999
read_globals = {
"DIR_DELIM",
"minetest", "core",
"unpack",
"dump",
table = { fields = { "copy", "getn" } },
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"default",
"screwdriver", "homedecor",
}
globals = {
}

128
homedecor_inbox/init.lua Normal file
View File

@ -0,0 +1,128 @@
local S = minetest.get_translator("inbox")
local inbox = {}
minetest.register_craft({
output ="homedecor:inbox",
recipe = {
{"","default:steel_ingot",""},
{"default:steel_ingot","","default:steel_ingot"},
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}
}
})
local mb_cbox = {
type = "fixed",
fixed = { -5/16, -8/16, -8/16, 5/16, 2/16, 8/16 }
}
homedecor.register("inbox", {
paramtype = "light",
drawtype = "mesh",
mesh = "homedecor_inbox_mailbox.obj",
description = S("Mailbox"),
tiles = {
"homedecor_inbox_red_metal.png",
"homedecor_inbox_white_metal.png",
"homedecor_inbox_grey_metal.png",
},
inventory_image = "homedecor_mailbox_inv.png",
selection_box = mb_cbox,
collision_box = mb_cbox,
paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
after_place_node = function(pos, placer, itemstack)
local meta = minetest.get_meta(pos)
local owner = placer:get_player_name()
meta:set_string("owner", owner)
meta:set_string("infotext", S("@1's Mailbox", owner))
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
inv:set_size("drop", 1)
end,
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.get_meta(pos)
local player = clicker:get_player_name()
local owner = meta:get_string("owner")
if owner == player or
minetest.check_player_privs(player, "protection_bypass") and
clicker:get_player_control().aux1 then
minetest.show_formspec(
player,
"inbox:mailbox",
inbox.get_inbox_formspec(pos))
else
minetest.show_formspec(
player,
"inbox:mailbox",
inbox.get_inbox_insert_formspec(pos))
end
return itemstack
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local name = player and player:get_player_name()
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
return name == owner and inv:is_empty("main")
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "drop" and inv:room_for_item("main", stack) then
inv:remove_item("drop", stack)
inv:add_item("main", stack)
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "main" then
return 0
end
if listname == "drop" then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:room_for_item("main", stack) then
return -1
else
return 0
end
end
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
if player:get_player_name() == owner or
minetest.check_player_privs(player, "protection_bypass") and
player:get_player_control().aux1 then
return stack:get_count()
end
return 0
end,
allow_metadata_inventory_move = function(pos)
return 0
end,
})
minetest.register_alias("inbox:empty", "homedecor:inbox")
function inbox.get_inbox_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec =
"size[8,9]"..
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]" ..
"listring[]"
return formspec
end
function inbox.get_inbox_insert_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec =
"size[8,9]"..
"list[nodemeta:".. spos .. ";drop;3.5,2;1,1;]"..
"list[current_player;main;0,5;8,4;]"..
"listring[]"
return formspec
end

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Briefkasten von @1
Mailbox=Briefkasten

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Buzón de @1
Mailbox=Buzón

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Boîte aux lettres de @1
Mailbox=Boîte aux lettres

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Peti Surat @1
Mailbox=Peti Surat

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Correio de @1
Mailbox=Correio

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Correio de @1
Mailbox=Correio

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=Почтовый ящик @1
Mailbox=Почтовый ящик

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=@1的邮箱
Mailbox=邮箱

View File

@ -0,0 +1,7 @@
# textdomain: inbox
### init.lua ###
@1's Mailbox=
Mailbox=

3
homedecor_inbox/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = homedecor_inbox
depends = default, homedecor_common
optional_depends = screwdriver

View File

@ -0,0 +1,272 @@
v 0.313 -0.5 -0.5
v 0.313 -0.5 0.5
v -0.312 -0.5 0.5
v -0.312 -0.5 -0.5
v -0.231 -0.083 0.438
v -0.25 -0.178 0.438
v 0.25 -0.178 0.438
v 0.231 -0.083 0.438
v 0 0.125 0.5
v 0 0.125 -0.5
v -0.12 0.101 0.5
v -0.12 0.101 -0.5
v -0.221 0.033 0.5
v -0.221 0.033 -0.5
v -0.289 -0.068 0.5
v -0.289 -0.068 -0.5
v -0.312 -0.187 0.5
v -0.312 -0.187 -0.5
v 0.177 -0.002 0.438
v 0.096 0.053 0.438
v 0.096 0.053 -0.5
v 0.177 -0.002 -0.5
v 0.231 -0.083 -0.5
v 0.25 -0.178 -0.5
v -0.25 -0.178 -0.5
v -0.231 -0.083 -0.5
v -0.177 -0.002 -0.5
v -0.096 0.053 -0.5
v 0 0.072 -0.5
v -0.25 -0.438 -0.5
v 0.25 -0.438 -0.5
v 0 -0.068 0.5
v 0.313 -0.187 0.5
v 0.313 -0.187 -0.5
v 0.289 -0.068 0.5
v 0.289 -0.068 -0.5
v 0.221 0.033 0.5
v 0.221 0.033 -0.5
v 0.12 0.101 0.5
v 0.12 0.101 -0.5
v -0.177 -0.002 0.438
v -0.096 0.053 0.438
v 0 0.072 0.438
v -0.25 -0.438 0.438
v 0.25 -0.438 0.438
v 0 -0.083 0.438
v -0.312 -0.25 -0.375
v -0.312 -0.25 -0.312
v -0.344 -0.25 -0.312
v -0.344 -0.25 -0.375
v -0.312 0.25 -0.375
v -0.312 0.25 -0.312
v -0.344 0.25 -0.312
v -0.344 0.25 -0.375
v -0.32 0.125 -0.312
v -0.32 0.125 -0.187
v -0.336 0.125 -0.187
v -0.336 0.125 -0.312
v -0.32 0.25 -0.312
v -0.32 0.25 -0.187
v -0.336 0.25 -0.187
v -0.336 0.25 -0.312
vt 0 0
vt 0.182 0
vt 0.182 1
vt 0 1
vt 0.818 0
vt 0.909 0
vt 0.909 1
vt 0.818 1
vt 0.364 1
vt 0.364 0
vt 0.455 0
vt 0.455 1
vt 0.545 0.5
vt 0.545 0.625
vt 0.455 0.625
vt 0.455 0.5
vt 0.636 0.5
vt 0.636 0.625
vt 0.455 0.25
vt 0.818 0.25
vt 0.818 0.5
vt 0.955 0
vt 0.955 0.25
vt 0.909 0.25
vt 0.909 0.5
vt 0.955 0.5
vt 1 0
vt 1 0.25
vt 0.974 0.716
vt 0.934 0.767
vt 0.804 0.716
vt 0.438 0.5
vt 0.508 0.512
vt 0.494 0.536
vt 0.438 0.527
vt 0.988 0.656
vt 0.567 0.546
vt 0.607 0.596
vt 0.573 0.604
vt 0.541 0.563
vt 0 0.5
vt 0.367 0
vt 0.367 0.5
vt 0.874 0.801
vt 0.621 0.656
vt 0.635 0.716
vt 0.675 0.767
vt 0.734 0.801
vt 0.804 0.813
vt 0.988 0.5
vt 0.621 0.5
vt 0.584 0.652
vt 0.621 0.813
vt 0.584 0.781
vt 0.254 0.813
vt 0.254 0.656
vt 0.291 0.652
vt 0.291 0.781
vt 0.268 0.596
vt 0.302 0.604
vt 0.308 0.546
vt 0.334 0.563
vt 0.367 0.512
vt 0.381 0.536
vt 0.117 0.5
vt 0.117 1
vt 0.051 1
vt 0.051 0.5
vt 1 0.5
vt 0.937 0.5
vt 0.937 0
vt 0.866 0.5
vt 0.866 0
vt 0.683 0
vt 0.683 0.5
vt 0.549 0
vt 0.549 0.5
vt 0.62 0
vt 0.62 0.5
vt 0.188 0.5
vt 0.188 1
vt 0.254 0.5
vt 0.254 1
vt 0 0.704
vt 0 0.415
vt 0.648 0.415
vt 0.648 0.704
vt 0.821 0.711
vt 1 0.711
vt 1 1
vt 0.821 1
vt 0.648 0.856
vt 0.661 0.8
vt 0.755 0.856
vt 0.699 0.754
vt 0.755 0.722
vt 0.755 0.989
vt 0.699 0.958
vt 0.661 0.911
vt 0 0.16
vt 0 0.108
vt 0.648 0.108
vt 0.648 0.16
vt 0.648 0.958
vt 0.648 1
vt 0 0.958
vt 0.648 0.904
vt 0 0.904
vt 0.648 0.848
vt 0 0.848
vt 0 0.309
vt 0.648 0.309
vt 0 0.365
vt 0.648 0.365
vt 0 0.052
vt 0.648 0
vt 0.648 0.052
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 0 -1
vn 0 -1 0
vn 0 1 0
vn -0.383 0.924 0
vn -0.707 0.707 0
vn -0.924 0.383 0
vn -0.995 0.098 0
vn 0.995 0.098 0
vn 0.924 0.383 0
vn 0.707 0.707 0
vn 0.383 0.924 0
vn 0.383 -0.924 0
vn 0.707 -0.707 0
vn 0.924 -0.383 0
vn 0.995 -0.098 0
vn -0.995 -0.098 0
vn -0.924 -0.383 0
vn -0.707 -0.707 0
vn -0.383 -0.924 0
g 1
s off
f 51/1/1 52/2/1 48/3/1 47/4/1
f 52/5/2 53/6/2 49/7/2 48/8/2
f 53/9/3 54/3/3 50/2/3 49/10/3
f 54/10/4 51/11/4 47/12/4 50/9/4
f 47/13/5 48/14/5 49/15/5 50/16/5
f 54/14/6 53/13/6 52/17/6 51/18/6
f 59/16/1 60/19/1 56/20/1 55/21/1
f 60/6/2 61/22/2 57/23/2 56/24/2
f 61/19/3 62/11/3 58/5/3 57/20/3
f 55/25/5 56/24/5 57/23/5 58/26/5
f 62/27/6 61/28/6 60/23/6 59/22/6
g 2
f 35/29/2 37/30/2 32/31/2
f 10/32/4 40/33/4 21/34/4 29/35/4
f 33/36/2 35/29/2 32/31/2
f 38/37/4 36/38/4 23/39/4 22/40/4
f 1/41/5 2/1/5 3/42/5 4/43/5
f 37/30/2 39/44/2 32/31/2
f 17/45/2 33/36/2 32/31/2
f 15/46/2 17/45/2 32/31/2
f 13/47/2 15/46/2 32/31/2
f 11/48/2 13/47/2 32/31/2
f 9/49/2 11/48/2 32/31/2
f 2/50/2 33/36/2 17/45/2 3/51/2
f 39/44/2 9/49/2 32/31/2
f 40/33/4 38/37/4 22/40/4 21/34/4
f 36/38/4 34/45/4 24/52/4 23/39/4
f 34/45/4 1/53/4 31/54/4 24/52/4
f 4/55/4 18/56/4 25/57/4 30/58/4
f 18/56/4 16/59/4 26/60/4 25/57/4
f 16/59/4 14/61/4 27/62/4 26/60/4
f 14/61/4 12/63/4 28/64/4 27/62/4
f 12/63/4 10/32/4 29/35/4 28/64/4
f 1/53/4 4/55/4 30/58/4 31/54/4
s 1
f 9/65/6 10/66/6 12/67/7 11/68/7
f 11/68/7 12/67/7 14/4/8 13/41/8
f 13/27/8 14/69/8 16/70/9 15/71/9
f 15/71/9 16/70/9 18/72/10 17/73/10
f 3/74/3 17/73/10 18/72/10 4/75/3
f 2/43/1 1/42/1 34/76/11 33/77/11
f 33/77/11 34/76/11 36/78/12 35/79/12
f 35/79/12 36/78/12 38/74/13 37/75/13
f 39/80/14 40/81/14 10/66/6 9/65/6
f 37/82/13 38/83/13 40/81/14 39/80/14
g 3
s off
f 31/84/6 30/85/6 44/86/6 45/87/6
f 7/88/4 45/89/4 44/90/4 6/91/4
f 43/92/4 20/93/4 46/94/4
f 20/93/4 19/95/4 46/94/4
f 19/95/4 8/96/4 46/94/4
f 8/96/4 7/88/4 46/94/4
f 7/88/4 6/91/4 46/94/4
f 6/91/4 5/97/4 46/94/4
f 5/97/4 41/98/4 46/94/4
f 41/98/4 42/99/4 46/94/4
f 42/99/4 43/92/4 46/94/4
s 1
f 28/100/15 29/101/5 43/102/5 42/103/15
f 27/104/16 28/105/15 42/4/15 41/106/16
f 26/107/17 27/104/16 41/106/16 5/108/17
f 25/109/18 26/107/17 5/108/17 6/110/18
f 30/87/1 25/109/18 6/110/18 44/84/1
f 24/111/19 31/100/3 45/103/3 7/112/19
f 23/113/20 24/111/19 7/112/19 8/114/20
f 22/85/21 23/113/20 8/114/20 19/86/21
f 21/115/22 22/1/21 19/116/21 20/117/22
f 29/101/5 21/115/22 20/117/22 43/102/5

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB