Compare commits

...

5 Commits

Author SHA1 Message Date
Tai @ Flex 9b8c3f76f3 fleshed out REAMDE details 2017-04-20 20:10:25 +01:00
Tai @ Flex 13dd3b9e79 Revert "Added Mailbox for Rent"
This reverts commit cd4375fc90.
2017-04-20 20:08:48 +01:00
Tai @ Flex 1ae5ef7bfc Revert "Preserve Facedir, added option to unrent mailboxes"
This reverts commit 0623a7dfef.
2017-04-20 20:08:44 +01:00
Tai @ Flex 52eb8f857f Revert "fleshed out REAMDE details"
This reverts commit cf1dc3895a.
2017-04-20 20:08:29 +01:00
Tai @ Flex cf1dc3895a fleshed out REAMDE details 2017-04-19 09:04:25 +01:00
6 changed files with 14 additions and 57 deletions

View File

@ -1,3 +1,13 @@
# mailbox
everamzah:
Thanks to @SmallJoker AKA Krock for helping me with the minetest.swap_node part of the mod!
> # mailbox
>
> Thanks to @SmallJoker AKA Krock for helping me with the minetest.swap_node part of the mod!
This repository is the continuation of everamzah's `mailbox` mod for Minetest.
It provides a modified xdecor mailbox, enhanced to be able to accept books-only as an option (blue box) or the default accept-anything (red box).
Releases are available [on the releases tab](https://github.com/taikedz/everamzah-mailbox/releases) (GitHub)
-- taikedz

View File

@ -21,8 +21,7 @@ function mailbox.get_formspec(pos, owner, fs_type)
"list[current_player;main;0,5.5;8,1;]" ..
"list[current_player;main;0,6.75;8,3;8]" ..
"listring[nodemeta:" .. spos .. ";mailbox]" ..
"listring[current_player;main]" ..
"button_exit[5,0;1,1;unrent;Unrent]"..
"listring[current_player;main]" ..
"button_exit[7,0;1,1;exit;X]"
else
return "size[8,5.5]" .. xbg .. default.get_hotbar_bg(0, 1.5) ..
@ -39,20 +38,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if not formname:match("mailbox:mailbox_") then
return
end
if fields.unrent then
local pos = minetest.string_to_pos(formname:sub(17))
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:is_empty("mailbox") then
local node = minetest.get_node(pos)
node.name = "mailbox:mailbox_free"
minetest.swap_node(pos, node) -- preserve Facedir
-- minetest.swap_node(pos, {name = "mailbox:mailbox" })
mailbox.after_place_free(pos, player)
else
minetest.chat_send_player(player:get_player_name(), "Your mailbox is not empty!")
end
end
if fields.books_only then
local pos = minetest.string_to_pos(formname:sub(17))
local node = minetest.get_node(pos)
@ -79,23 +65,6 @@ mailbox.after_place_node = function(pos, placer, _)
inv:set_size("drop", 1)
end
mailbox.on_rightclick_free = function(pos, _, clicker, _)
local node = minetest.get_node(pos)
node.name = "mailbox:mailbox"
minetest.swap_node(pos, node) -- preserve Facedir
-- minetest.swap_node(pos, {name = "mailbox:mailbox" })
mailbox.after_place_node(pos, clicker)
end
mailbox.after_place_free = function(pos, placer, _)
local meta = minetest.get_meta(pos)
local player_name = placer:get_player_name()
-- meta:set_string("owner", player_name)
meta:set_string("infotext", "Free Mailbox, right-click to claim")
end
mailbox.on_rightclick = function(pos, _, clicker, _)
local meta = minetest.get_meta(pos)
local player = clicker:get_player_name()
@ -166,28 +135,6 @@ minetest.register_node("mailbox:mailbox", {
allow_metadata_inventory_put = mailbox.allow_metadata_inventory_put,
})
minetest.register_node("mailbox:mailbox_free", {
description = "Mailbox for Rent",
tiles = {
"mailbox_mailbox_free_top.png", "mailbox_mailbox_free_bottom.png",
"mailbox_mailbox_free_side.png", "mailbox_mailbox_free_side.png",
"mailbox_mailbox_free.png", "mailbox_mailbox_free.png",
},
groups = {cracky = 3, oddly_breakable_by_hand = 1},
on_rotate = screwdriver.rotate_simple,
sounds = default.node_sound_defaults(),
paramtype2 = "facedir",
after_place_node = mailbox.after_place_free,
on_rightclick = mailbox.on_rightclick_free,
can_dig = mailbox.can_dig,
-- on_metadata_inventory_put = mailbox.on_metadata_inventory_put,
-- allow_metadata_inventory_put = mailbox.allow_metadata_inventory_put,
})
minetest.register_node("mailbox:letterbox", {
description = "Letterbox (you hacker you!)",
tiles = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB