From bc9a8816e207db792e84d27421c60e71ec5d4f51 Mon Sep 17 00:00:00 2001 From: jp Date: Thu, 13 Aug 2015 22:34:21 +0200 Subject: [PATCH] Localize mailbox's functions --- mailbox.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mailbox.lua b/mailbox.lua index f6473b4..6f89bee 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -1,3 +1,5 @@ +local mailbox = {} + xdecor.register("mailbox", { description = "Mailbox", tiles = { @@ -24,9 +26,9 @@ xdecor.register("mailbox", { if owner == player then minetest.show_formspec(player, "default:chest_locked", - xdecor.get_mailbox_formspec(pos)) + mailbox.get_formspec(pos)) else minetest.show_formspec(player, "default:chest_locked", - xdecor.get_mailbox_insert_formspec(pos, owner)) + mailbox.get_insert_formspec(pos, owner)) end end, can_dig = function(pos, player) @@ -57,7 +59,7 @@ xdecor.register("mailbox", { end }) -function xdecor.get_mailbox_formspec(pos) +function mailbox.get_formspec(pos) local spos = pos.x..","..pos.y..","..pos.z local formspec = "size[8,9]"..xdecor.fancy_gui.. @@ -67,7 +69,7 @@ function xdecor.get_mailbox_formspec(pos) return formspec end -function xdecor.get_mailbox_insert_formspec(pos, owner) +function mailbox.get_insert_formspec(pos, owner) local spos = pos.x..","..pos.y..","..pos.z local formspec = "size[8,5]"..xdecor.fancy_gui..