diff options
author | tenplus1 <kinsellaja@yahoo.com> | 2015-04-01 11:13:07 +0100 |
---|---|---|
committer | tenplus1 <kinsellaja@yahoo.com> | 2015-04-01 11:13:07 +0100 |
commit | 8de8a271d17061a71600798d257d5f7346fce0a1 (patch) | |
tree | 74a79458c76ce91ad105726e73b44a6437c7802c | |
parent | e4e98aed949bdc40ba8cefde349c02785ae1986b (diff) |
updated to work with 0.4.12
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | init.lua | 55 | ||||
-rw-r--r-- | textures/door_brown.png | bin | 127 -> 0 bytes | |||
-rw-r--r-- | textures/door_grey.png | bin | 115 -> 0 bytes | |||
-rw-r--r-- | textures/door_steel.png | bin | 132 -> 0 bytes | |||
-rw-r--r-- | textures/door_steel_a.png | bin | 449 -> 0 bytes | |||
-rw-r--r-- | textures/door_steel_b.png | bin | 461 -> 0 bytes | |||
-rw-r--r-- | textures/door_wood.png | bin | 130 -> 0 bytes | |||
-rw-r--r-- | textures/door_wood_a.png | bin | 555 -> 0 bytes | |||
-rw-r--r-- | textures/door_wood_b.png | bin | 539 -> 0 bytes | |||
-rw-r--r-- | textures/moreblocks_circle_stone_bricks.png | bin | 0 -> 267 bytes | |||
-rw-r--r-- | textures/protector_logo.png | bin | 179 -> 138 bytes | |||
-rw-r--r-- | textures/protector_side.png | bin | 256 -> 0 bytes | |||
-rw-r--r-- | textures/protector_top.png | bin | 272 -> 0 bytes |
14 files changed, 27 insertions, 29 deletions
@@ -13,3 +13,4 @@ Released under WTFPL 0.5 - Added protector.radius variable in init.lua (default: 5) 0.6 - Added Protected Doors (wood and steel) and Protected Chest 0.7 - Protected Chests now have "To Chest" and "To Inventory" buttons to copy contents across, also chests can be named +0.8 - Updated to work with Minetest 0.4.12, simplified textures
\ No newline at end of file @@ -176,7 +176,7 @@ end minetest.register_node("protector:protect", { description = "Protection Block", - tiles = {"protector_top.png","protector_top.png","protector_side.png"}, + tiles = {"moreblocks_circle_stone_bricks.png","moreblocks_circle_stone_bricks.png","moreblocks_circle_stone_bricks.png^protector_logo.png"}, sounds = default.node_sound_stone_defaults(), groups = {dig_immediate=2}, drawtype = "nodebox", @@ -401,11 +401,11 @@ local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) pos.y = pos.y-dir minetest.swap_node(pos, {name=replace, param2=p2}) - local snd_1 = "door_close" - local snd_2 = "door_open" + local snd_1 = "doors_door_close" + local snd_2 = "doors_door_open" if params[1] == 3 then - snd_1 = "door_open" - snd_2 = "door_close" + snd_1 = "doors_door_open" + snd_2 = "doors_door_close" end if minetest.get_meta(pos):get_int("right") ~= 0 then @@ -421,10 +421,10 @@ local name = "protector:door_wood" doors.register_door(name, { description = "Protected Wooden Door", - inventory_image = "door_wood.png^protector_logo.png", + inventory_image = "doors_wood.png^protector_logo.png", groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, - tiles_bottom = {"door_wood_b.png^protector_logo.png", "door_brown.png"}, - tiles_top = {"door_wood_a.png", "door_brown.png"}, + tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"}, + tiles_top = {"doors_wood_a.png", "doors_brown.png"}, sounds = default.node_sound_wood_defaults(), sunlight = false, }) @@ -483,10 +483,10 @@ local name = "protector:door_steel" doors.register_door(name, { description = "Protected Steel Door", - inventory_image = "door_steel.png^protector_logo.png", + inventory_image = "doors_steel.png^protector_logo.png", groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, - tiles_bottom = {"door_steel_b.png^protector_logo.png", "door_grey.png"}, - tiles_top = {"door_steel_a.png", "door_grey.png"}, + tiles_bottom = {"doors_steel_b.png^protector_logo.png", "doors_grey.png"}, + tiles_top = {"doors_steel_a.png", "doors_grey.png"}, sounds = default.node_sound_wood_defaults(), sunlight = false, }) @@ -539,23 +539,6 @@ minetest.register_craft({ } }) -local function get_locked_chest_formspec(pos) - local spos = pos.x .. "," .. pos.y .. "," ..pos.z - local formspec = - "size[8,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. - "button[0,4.5;2,0.25;toup;To Chest]".. - "field[2.3,4.8;4,0.25;chestname;;]".. - "button[6,4.5;2,0.25;todn;To Inventory]".. - "list[current_player;main;0,5;8,1;]".. - "list[current_player;main;0,6.08;8,3;8]".. - default.get_hotbar_bg(0,5) - return formspec -end - -- Protected Chest minetest.register_node("protector:chest", { @@ -570,6 +553,7 @@ minetest.register_node("protector:chest", { on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", "Protected Chest") + meta:set_string("name", "") local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -602,10 +586,22 @@ minetest.register_node("protector:chest", { on_rightclick = function(pos, node, clicker) local meta = minetest.get_meta(pos) if not minetest.is_protected(pos, clicker:get_player_name()) then + + local spos = pos.x .. "," .. pos.y .. "," ..pos.z + local formspec = "size[8,9]".. + default.gui_bg..default.gui_bg_img..default.gui_slots.. + "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. + "button[0,4.5;2,0.25;toup;To Chest]".. + "field[2.3,4.8;4,0.25;chestname;;"..meta:get_string("name").."]".. + "button[6,4.5;2,0.25;todn;To Inventory]".. + "list[current_player;main;0,5;8,1;]".. + "list[current_player;main;0,6.08;8,3;8]".. + default.get_hotbar_bg(0,5) + minetest.show_formspec( clicker:get_player_name(), "protector:chest_"..minetest.pos_to_string(pos), - get_locked_chest_formspec(pos) + formspec ) end end, @@ -654,6 +650,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields) -- change chest infotext to display name if fields.chestname ~= "" then + meta:set_string("name", fields.chestname) meta:set_string("infotext", "Protected Chest ("..fields.chestname..")") else meta:set_string("infotext", "Protected Chest") diff --git a/textures/door_brown.png b/textures/door_brown.png Binary files differdeleted file mode 100644 index 77f748d..0000000 --- a/textures/door_brown.png +++ /dev/null diff --git a/textures/door_grey.png b/textures/door_grey.png Binary files differdeleted file mode 100644 index 13665d2..0000000 --- a/textures/door_grey.png +++ /dev/null diff --git a/textures/door_steel.png b/textures/door_steel.png Binary files differdeleted file mode 100644 index 042a1bc..0000000 --- a/textures/door_steel.png +++ /dev/null diff --git a/textures/door_steel_a.png b/textures/door_steel_a.png Binary files differdeleted file mode 100644 index 515dafc..0000000 --- a/textures/door_steel_a.png +++ /dev/null diff --git a/textures/door_steel_b.png b/textures/door_steel_b.png Binary files differdeleted file mode 100644 index c1b75a4..0000000 --- a/textures/door_steel_b.png +++ /dev/null diff --git a/textures/door_wood.png b/textures/door_wood.png Binary files differdeleted file mode 100644 index d3a62ab..0000000 --- a/textures/door_wood.png +++ /dev/null diff --git a/textures/door_wood_a.png b/textures/door_wood_a.png Binary files differdeleted file mode 100644 index 0317b1f..0000000 --- a/textures/door_wood_a.png +++ /dev/null diff --git a/textures/door_wood_b.png b/textures/door_wood_b.png Binary files differdeleted file mode 100644 index f016933..0000000 --- a/textures/door_wood_b.png +++ /dev/null diff --git a/textures/moreblocks_circle_stone_bricks.png b/textures/moreblocks_circle_stone_bricks.png Binary files differnew file mode 100644 index 0000000..1782c00 --- /dev/null +++ b/textures/moreblocks_circle_stone_bricks.png diff --git a/textures/protector_logo.png b/textures/protector_logo.png Binary files differindex 20c0b8e..c6f6f51 100644 --- a/textures/protector_logo.png +++ b/textures/protector_logo.png diff --git a/textures/protector_side.png b/textures/protector_side.png Binary files differdeleted file mode 100644 index 73ec762..0000000 --- a/textures/protector_side.png +++ /dev/null diff --git a/textures/protector_top.png b/textures/protector_top.png Binary files differdeleted file mode 100644 index a4bf3f8..0000000 --- a/textures/protector_top.png +++ /dev/null |