Fix chat message in mailbox
This commit is contained in:
parent
3143f3999a
commit
b4b8af0f5e
16
mailbox.lua
16
mailbox.lua
@ -63,9 +63,13 @@ xdecor.register("mailbox", {
|
|||||||
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("mailbox", stack) then return -1 end
|
if inv:room_for_item("mailbox", stack) then
|
||||||
|
return -1
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(player_name, "The mailbox is full")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(player_name, "The mailbox is full.")
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@ -98,8 +102,8 @@ function mailbox.formspec(pos, owner, num)
|
|||||||
|
|
||||||
return "size[9.5,9]"..xbg..
|
return "size[9.5,9]"..xbg..
|
||||||
default.get_hotbar_bg(0.75,5.25)..
|
default.get_hotbar_bg(0.75,5.25)..
|
||||||
"label[0,0;Mailbox :]"..
|
"label[0,0;Mailbox]"..
|
||||||
"label[6,0;Last donators :]"..
|
"label[6,0;Last donators]"..
|
||||||
"box[6,0.72;3.3,3.5;#555555]"..
|
"box[6,0.72;3.3,3.5;#555555]"..
|
||||||
"tablecolumns[color;text;image,"..img.."0;color;text]"..
|
"tablecolumns[color;text;image,"..img.."0;color;text]"..
|
||||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
|
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
|
||||||
@ -111,7 +115,9 @@ function mailbox.formspec(pos, owner, num)
|
|||||||
else
|
else
|
||||||
return "size[8,5]"..xbg..
|
return "size[8,5]"..xbg..
|
||||||
default.get_hotbar_bg(0,1.25)..
|
default.get_hotbar_bg(0,1.25)..
|
||||||
"label[0.5,0;Send your goods\nto "..owner.." :]"..
|
"tablecolumns[color;text;color;text]"..
|
||||||
|
"tableoptions[background=#00000000;highlight=#00000000;border=false]"..
|
||||||
|
"table[0,0;3,1;sendform;#FFFFFF,Send your goods to,,,#FFFF00,"..owner.."]"..
|
||||||
"list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
|
"list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
|
||||||
"list[current_player;main;0,1.25;8,4;]"
|
"list[current_player;main;0,1.25;8,4;]"
|
||||||
end
|
end
|
||||||
|
@ -179,10 +179,9 @@ function worktable.craftguide_update(pos, filter)
|
|||||||
for name, def in pairs(minetest.registered_items) do
|
for name, def in pairs(minetest.registered_items) do
|
||||||
if not (def.groups.not_in_creative_inventory == 1) and
|
if not (def.groups.not_in_creative_inventory == 1) and
|
||||||
minetest.get_craft_recipe(name).items and
|
minetest.get_craft_recipe(name).items and
|
||||||
def.description and def.description ~= "" then
|
def.description and def.description ~= "" and
|
||||||
if (filter and def.name:find(filter, 1, true)) or not filter then
|
((filter and def.name:find(filter, 1, true)) or not filter) then
|
||||||
inv_items_list[#inv_items_list+1] = name
|
inv_items_list[#inv_items_list+1] = name
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(inv_items_list)
|
table.sort(inv_items_list)
|
||||||
|
Loading…
Reference in New Issue
Block a user