mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Changed the Item Frames' LBM method.
Moved the custom lbm function call out of create_custom_frame() into init. Changed how the custom lbm handles frames lbm regeneration.
This commit is contained in:
parent
2be75c9628
commit
c277229c1b
2 changed files with 23 additions and 31 deletions
|
@ -14,11 +14,11 @@ mcl_itemframes.backwards_compatibility()
|
||||||
|
|
||||||
-- Define the standard frames.
|
-- Define the standard frames.
|
||||||
mcl_itemframes.create_custom_frame("false", "item_frame", false,
|
mcl_itemframes.create_custom_frame("false", "item_frame", false,
|
||||||
"mcl_itemframes_item_frame.png", mcl_colors.WHITE, "Item Frame",
|
"mcl_itemframes_item_frame.png", mcl_colors.WHITE, "Can hold an item.",
|
||||||
"Can hold an item.","")
|
"Item Frame", "")
|
||||||
mcl_itemframes.create_custom_frame("false", "glow_item_frame", true,
|
mcl_itemframes.create_custom_frame("false", "glow_item_frame", true,
|
||||||
"mcl_itemframes_glow_item_frame.png", mcl_colors.WHITE, "Glowing Item Frame",
|
"mcl_itemframes_glow_item_frame.png", mcl_colors.WHITE, "Can hold an item and glows.",
|
||||||
"Can hold an item and glows.","")
|
"Glowing Item Frame", "")
|
||||||
|
|
||||||
-- Register the base frame's recipes.
|
-- Register the base frame's recipes.
|
||||||
-- was going to make it a specialized function, but minetest refuses to play nice.
|
-- was going to make it a specialized function, but minetest refuses to play nice.
|
||||||
|
@ -37,26 +37,4 @@ minetest.register_craft({
|
||||||
recipe = { 'mcl_mobitems:glow_ink_sac', 'mcl_itemframes:item_frame' },
|
recipe = { 'mcl_mobitems:glow_ink_sac', 'mcl_itemframes:item_frame' },
|
||||||
})
|
})
|
||||||
|
|
||||||
--[[ green frames just for testing
|
mcl_itemframes.custom_register_lbm()
|
||||||
mcl_itemframes.create_custom_frame("false", "my_regular_frame", false,
|
|
||||||
"mcl_itemframes_item_frame.png", mcl_colors.DARK_GREEN, "A Green frame",
|
|
||||||
"My Green Frame")
|
|
||||||
mcl_itemframes.create_custom_frame("false", "my_glowing_frame", true,
|
|
||||||
"mcl_itemframes_glow_item_frame.png", mcl_colors.DARK_GREEN, "A Green glowing frame",
|
|
||||||
"My Green glowing Frame")
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "mcl_itemframes:my_regular_frame",
|
|
||||||
recipe = {
|
|
||||||
{ "", "mcl_core:stick", "" },
|
|
||||||
{ "mcl_core:stick", "", "mcl_core:stick" },
|
|
||||||
{ "", "mcl_core:stick", "" },
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = "mcl_itemframes:my_glowing_frame",
|
|
||||||
recipe = { "mcl_mobitems:glow_ink_sac", "mcl_itemframes:my_regular_frame" },
|
|
||||||
})
|
|
||||||
--]]
|
|
||||||
|
|
|
@ -529,17 +529,30 @@ function mcl_itemframes.create_custom_frame(modname, name, has_glow, tiles, colo
|
||||||
minetest.register_node(":" .. working_name, custom_itemframe_definition)
|
minetest.register_node(":" .. working_name, custom_itemframe_definition)
|
||||||
|
|
||||||
mcl_itemframes.update_frame_registry(modname, working_name, has_glow)
|
mcl_itemframes.update_frame_registry(modname, working_name, has_glow)
|
||||||
mcl_itemframes.custom_register_lbm(working_name)
|
|
||||||
|
-- register Doc entry
|
||||||
|
if minetest.get_modpath("doc") then
|
||||||
|
doc.add_entry_alias("nodes", "mcl_itemframes:item_frame", "nodes", working_name)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_itemframes.custom_register_lbm(name)
|
function mcl_itemframes.custom_register_lbm()
|
||||||
|
|
||||||
|
local registered_frame_nodenames = {}
|
||||||
|
|
||||||
|
for i = 0, #mcl_itemframes.frames_registered.glowing do
|
||||||
|
table.insert(registered_frame_nodenames, mcl_itemframes.frames_registered.glowing[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 0, #mcl_itemframes.frames_registered.standard do
|
||||||
|
table.insert(registered_frame_nodenames, mcl_itemframes.frames_registered.standard[i])
|
||||||
|
end
|
||||||
|
|
||||||
-- Item entities can get destroyed by /clearobjects; LBM regenerates them.
|
|
||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
label = "Respawn item frame item entities",
|
label = "Respawn item frame item entities",
|
||||||
name = "mcl_itemframes:respawn_entities",
|
name = "mcl_itemframes:respawn_entities",
|
||||||
nodenames = {"mcl_itemframes:item_frame","mcl_itemframes:glow_item_frame"},
|
nodenames = { registered_frame_nodenames },
|
||||||
run_at_every_load = true,
|
run_at_every_load = true,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
mcl_itemframes.update_item_entity(pos, node)
|
mcl_itemframes.update_item_entity(pos, node)
|
||||||
|
@ -561,6 +574,7 @@ function mcl_itemframes.create_base_definitions()
|
||||||
|
|
||||||
mcl_itemframes.item_frame_base = {
|
mcl_itemframes.item_frame_base = {
|
||||||
description = S("Item Frame"),
|
description = S("Item Frame"),
|
||||||
|
name = "mcl_itemframes:item_frame",
|
||||||
_tt_help = S("Can hold an item"),
|
_tt_help = S("Can hold an item"),
|
||||||
_doc_items_longdesc = S("Item frames are decorative blocks in which items can be placed."),
|
_doc_items_longdesc = S("Item frames are decorative blocks in which items can be placed."),
|
||||||
_doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."),
|
_doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."),
|
||||||
|
|
Loading…
Reference in a new issue