diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-04-17 19:58:21 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-04-17 19:58:21 +0200 |
commit | cd4375fc90606069a0a128c94d29ff36234719d0 (patch) | |
tree | 81e1ccc4d996a077161cfd08266cf5127d360356 | |
parent | 03247e9cfb16350e4d11bcc5ba0186676e53d55d (diff) | |
download | mailbox-cd4375fc90606069a0a128c94d29ff36234719d0.tar.gz mailbox-cd4375fc90606069a0a128c94d29ff36234719d0.tar.bz2 mailbox-cd4375fc90606069a0a128c94d29ff36234719d0.zip |
Added Mailbox for Rent
-rw-r--r-- | init.lua | 36 | ||||
-rw-r--r-- | textures/mailbox_mailbox_free.png | bin | 0 -> 3020 bytes | |||
-rw-r--r-- | textures/mailbox_mailbox_free_bottom.png | bin | 0 -> 2861 bytes | |||
-rw-r--r-- | textures/mailbox_mailbox_free_side.png | bin | 0 -> 2977 bytes | |||
-rw-r--r-- | textures/mailbox_mailbox_free_top.png | bin | 0 -> 2862 bytes |
5 files changed, 36 insertions, 0 deletions
@@ -65,6 +65,20 @@ mailbox.after_place_node = function(pos, placer, _) inv:set_size("drop", 1) end +mailbox.on_rightclick_free = function(pos, _, clicker, _) + 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() @@ -135,6 +149,28 @@ 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 = { diff --git a/textures/mailbox_mailbox_free.png b/textures/mailbox_mailbox_free.png Binary files differnew file mode 100644 index 0000000..aa320ef --- /dev/null +++ b/textures/mailbox_mailbox_free.png diff --git a/textures/mailbox_mailbox_free_bottom.png b/textures/mailbox_mailbox_free_bottom.png Binary files differnew file mode 100644 index 0000000..ece6060 --- /dev/null +++ b/textures/mailbox_mailbox_free_bottom.png diff --git a/textures/mailbox_mailbox_free_side.png b/textures/mailbox_mailbox_free_side.png Binary files differnew file mode 100644 index 0000000..d865e07 --- /dev/null +++ b/textures/mailbox_mailbox_free_side.png diff --git a/textures/mailbox_mailbox_free_top.png b/textures/mailbox_mailbox_free_top.png Binary files differnew file mode 100644 index 0000000..bc7528a --- /dev/null +++ b/textures/mailbox_mailbox_free_top.png |