diff --git a/src/itemframe.lua b/src/itemframe.lua index 4cbcd8e..b759d95 100644 --- a/src/itemframe.lua +++ b/src/itemframe.lua @@ -130,6 +130,7 @@ function itemframe.dig(pos, player) return admin or player_name == owner end + xdecor.register("itemframe", { description = "Item Frame", groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, @@ -147,9 +148,257 @@ xdecor.register("itemframe", { on_rightclick = itemframe.rightclick, on_punch = itemframe.punch, can_dig = itemframe.dig, - on_destruct = itemframe.destruct -- Fixed + on_destruct = itemframe.destruct }) +xdecor.register("itemframe_green1", { + description = "Green item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_green1.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_green1.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_green2", { + description = "Dark green item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_green2.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_green2.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + + +xdecor.register("itemframe_red", { + description = "Red item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_red.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_red.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_radioactive", { + description = "Radioactive item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_radioactive.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_radioactive.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_yellow", { + description = "Yellow item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_yellow.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_yellow.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_pink", { + description = "Pink item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_pink.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_pink.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_purple", { + description = "Purple item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_purple.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_purple.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_cyan", { + description = "Cyan item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_cyan.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_cyan.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + + +xdecor.register("itemframe_blue", { + description = "Blue item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_blue.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_blue.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + +xdecor.register("itemframe_grey", { + description = "Grey item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_grey.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_grey.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + + +xdecor.register("itemframe_orange", { + description = "Orange item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_orange.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_orange.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct +}) + + +local table = {"green1", "green2", "red", "yellow", "pink", "purple", "cyan", "blue", "grey", "orange"} +for i=1,10,1 do + xdecor.register("itemframe_"..table[i].. "_radioactive", { + description = table[i].. " radioactive item frame", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + on_rotate = screwdriver.disallow, + sunlight_propagates = true, + inventory_image = "xdecor_itemframe_"..table[i].."_radioactive.png", + node_box = xdecor.nodebox.slab_z(0.9375), + tiles = { + "xdecor_wood.png", "xdecor_wood.png", "xdecor_wood.png", + "xdecor_wood.png", "xdecor_wood.png", "xdecor_itemframe_"..table[i].."_radioactive.png" + }, + after_place_node = itemframe.after_place, + on_timer = itemframe.timer, + on_rightclick = itemframe.rightclick, + on_punch = itemframe.punch, + can_dig = itemframe.dig, + on_destruct = itemframe.destruct + }) +end + + minetest.register_entity("xdecor:f_item", { visual = "wielditem", visual_size = {x = 0.33, y = 0.33}, @@ -158,7 +407,7 @@ minetest.register_entity("xdecor:f_item", { textures = {"air"}, on_activate = function(self, staticdata) local pos = self.object:get_pos() - if minetest.get_node(pos).name ~= "xdecor:itemframe" then + if minetest.get_node(pos).name ~= "xdecor:itemframe" and minetest.get_node(pos).name ~= "xdecor:itemframe_green1" and minetest.get_node(pos).name ~= "xdecor:itemframe_green2" and minetest.get_node(pos).name ~= "xdecor:itemframe_red" and minetest.get_node(pos).name ~= "xdecor:itemframe_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_yellow" and minetest.get_node(pos).name ~= "xdecor:itemframe_pink" and minetest.get_node(pos).name ~= "xdecor:itemframe_purple" and minetest.get_node(pos).name ~= "xdecor:itemframe_cyan" and minetest.get_node(pos).name ~= "xdecor:itemframe_blue" and minetest.get_node(pos).name ~= "xdecor:itemframe_grey" and minetest.get_node(pos).name ~= "xdecor:itemframe_orange" and minetest.get_node(pos).name ~= "xdecor:itemframe_green1_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_green2_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_red_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_yellow_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_pink_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_purple_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_cyan_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_blue_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_grey_radioactive" and minetest.get_node(pos).name ~= "xdecor:itemframe_orange_radioactive" then self.object:remove() end @@ -199,3 +448,142 @@ minetest.register_craft({ {"group:stick", "group:stick", "group:stick"} } }) + +minetest.register_craft({ + output = "xdecor:itemframe_green1", + recipe = { + {"xdecor:itemframe", "dye:dark_green", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_green2", + recipe = { + {"xdecor:itemframe", "dye:green", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_red", + recipe = { + {"xdecor:itemframe", "dye:red", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_radioactive", + recipe = { + {"xdecor:itemframe", "group:uranium", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_yellow", + recipe = { + {"xdecor:itemframe", "dye:yellow", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_pink", + recipe = { + {"xdecor:itemframe", "dye:pink", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_purple", + recipe = { + {"xdecor:itemframe", "dye:violet", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_cyan", + recipe = { + {"xdecor:itemframe", "dye:cyan", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_blue", + recipe = { + {"xdecor:itemframe", "dye:blue", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_grey", + recipe = { + {"xdecor:itemframe", "dye:grey", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_orange", + recipe = { + {"xdecor:itemframe", "dye:orange", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + + +local tablep = {"red", "yellow", "pink", "cyan", "blue", "grey", "orange"} +for x=1,7,1 do + minetest.register_craft({ + output = "xdecor:itemframe_"..tablep[x].."_radioactive", + recipe = { + {"xdecor:itemframe_radioactive", "dye:"..tablep[x], ""}, + {"", "", ""}, + {"", "", ""} + } + }) +end + +minetest.register_craft({ + output = "xdecor:itemframe_green1_radioactive", + recipe = { + {"xdecor:itemframe", "dye:dark_green", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_green2_radioactive", + recipe = { + {"xdecor:itemframe", "dye:green", ""}, + {"", "", ""}, + {"", "", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:itemframe_purple_radioactive", + recipe = { + {"xdecor:itemframe", "dye:violet", ""}, + {"", "", ""}, + {"", "", ""} + } +}) diff --git a/textures/xdecor_itemframe_blue.png b/textures/xdecor_itemframe_blue.png new file mode 100644 index 0000000..6187c12 Binary files /dev/null and b/textures/xdecor_itemframe_blue.png differ diff --git a/textures/xdecor_itemframe_blue_radioactive.png b/textures/xdecor_itemframe_blue_radioactive.png new file mode 100644 index 0000000..5d612c4 Binary files /dev/null and b/textures/xdecor_itemframe_blue_radioactive.png differ diff --git a/textures/xdecor_itemframe_cyan.png b/textures/xdecor_itemframe_cyan.png new file mode 100644 index 0000000..89b5377 Binary files /dev/null and b/textures/xdecor_itemframe_cyan.png differ diff --git a/textures/xdecor_itemframe_cyan_radioactive.png b/textures/xdecor_itemframe_cyan_radioactive.png new file mode 100644 index 0000000..9ff5bd8 Binary files /dev/null and b/textures/xdecor_itemframe_cyan_radioactive.png differ diff --git a/textures/xdecor_itemframe_green1.png b/textures/xdecor_itemframe_green1.png new file mode 100644 index 0000000..62d464f Binary files /dev/null and b/textures/xdecor_itemframe_green1.png differ diff --git a/textures/xdecor_itemframe_green1_radioactive.png b/textures/xdecor_itemframe_green1_radioactive.png new file mode 100644 index 0000000..5a2acc9 Binary files /dev/null and b/textures/xdecor_itemframe_green1_radioactive.png differ diff --git a/textures/xdecor_itemframe_green2.png b/textures/xdecor_itemframe_green2.png new file mode 100644 index 0000000..a2deaa2 Binary files /dev/null and b/textures/xdecor_itemframe_green2.png differ diff --git a/textures/xdecor_itemframe_green2_radioactive.png b/textures/xdecor_itemframe_green2_radioactive.png new file mode 100644 index 0000000..3f31156 Binary files /dev/null and b/textures/xdecor_itemframe_green2_radioactive.png differ diff --git a/textures/xdecor_itemframe_grey.png b/textures/xdecor_itemframe_grey.png new file mode 100644 index 0000000..30c6592 Binary files /dev/null and b/textures/xdecor_itemframe_grey.png differ diff --git a/textures/xdecor_itemframe_grey_radioactive.png b/textures/xdecor_itemframe_grey_radioactive.png new file mode 100644 index 0000000..3cee133 Binary files /dev/null and b/textures/xdecor_itemframe_grey_radioactive.png differ diff --git a/textures/xdecor_itemframe_orange.png b/textures/xdecor_itemframe_orange.png new file mode 100644 index 0000000..e6bb991 Binary files /dev/null and b/textures/xdecor_itemframe_orange.png differ diff --git a/textures/xdecor_itemframe_orange_radioactive.png b/textures/xdecor_itemframe_orange_radioactive.png new file mode 100644 index 0000000..59a7db4 Binary files /dev/null and b/textures/xdecor_itemframe_orange_radioactive.png differ diff --git a/textures/xdecor_itemframe_pink.png b/textures/xdecor_itemframe_pink.png new file mode 100644 index 0000000..80410ef Binary files /dev/null and b/textures/xdecor_itemframe_pink.png differ diff --git a/textures/xdecor_itemframe_pink_radioactive.png b/textures/xdecor_itemframe_pink_radioactive.png new file mode 100644 index 0000000..417a3aa Binary files /dev/null and b/textures/xdecor_itemframe_pink_radioactive.png differ diff --git a/textures/xdecor_itemframe_purple.png b/textures/xdecor_itemframe_purple.png new file mode 100644 index 0000000..5d92eb8 Binary files /dev/null and b/textures/xdecor_itemframe_purple.png differ diff --git a/textures/xdecor_itemframe_purple_radioactive.png b/textures/xdecor_itemframe_purple_radioactive.png new file mode 100644 index 0000000..165f839 Binary files /dev/null and b/textures/xdecor_itemframe_purple_radioactive.png differ diff --git a/textures/xdecor_itemframe_radioactive.png b/textures/xdecor_itemframe_radioactive.png new file mode 100644 index 0000000..27cd218 Binary files /dev/null and b/textures/xdecor_itemframe_radioactive.png differ diff --git a/textures/xdecor_itemframe_red.png b/textures/xdecor_itemframe_red.png new file mode 100644 index 0000000..b2da8c5 Binary files /dev/null and b/textures/xdecor_itemframe_red.png differ diff --git a/textures/xdecor_itemframe_red_radioactive.png b/textures/xdecor_itemframe_red_radioactive.png new file mode 100644 index 0000000..a444da8 Binary files /dev/null and b/textures/xdecor_itemframe_red_radioactive.png differ diff --git a/textures/xdecor_itemframe_yellow.png b/textures/xdecor_itemframe_yellow.png new file mode 100644 index 0000000..1f577bb Binary files /dev/null and b/textures/xdecor_itemframe_yellow.png differ diff --git a/textures/xdecor_itemframe_yellow_radioactive.png b/textures/xdecor_itemframe_yellow_radioactive.png new file mode 100644 index 0000000..838cf4f Binary files /dev/null and b/textures/xdecor_itemframe_yellow_radioactive.png differ