New item frames

master
pseudonym-2669 2021-06-01 14:05:40 +00:00 committed by Hume2
parent 075a4bf7f5
commit f9fab541fe
22 changed files with 390 additions and 2 deletions

View File

@ -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", ""},
{"", "", ""},
{"", "", ""}
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB