-- function
clone_registered = function(case,name)
local params = {}
local list
if case == "item" then list = minetest.registered_items end
if case == "node" then list = minetest.registered_nodes end
if case == "craftitem" then list = minetest.registered_craftitems end
if case == "tool" then list = minetest.registered_tools end
if case == "entity" then list = minetest.registered_entities end
if list then
for k,v in pairs(list[name]) do
params[k] = v
end
end
return params
end
-- usage
local node = clone_registered("node","default:stone")
node.tiles = {"default_stoneTEST.png"}
minetest.register_node(":default:stone", node)
Much better. Thanks for suggesting it.rubenwardy wrote:Or you could use Minetest.override_item
Evergreen wrote:This will be absolutely amazing once it's finished! I would love to contribute to this.
Neuromancer wrote:Evergreen wrote:This will be absolutely amazing once it's finished! I would love to contribute to this.
Awesome! I added you as a contributor to the GitHub.
Evergreen wrote: You should make a roadmap as to what needs to be worked on. I can't contribute unless I know what needs to be contributed.
rubenwardy wrote:I thought this was going to be an automatic process. Reading the models and textures and names from the resource pack.
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function mod_path()
local dir = minetest.get_modpath(minetest.get_current_modname())
return dir
end
function map_resource(node, file)
if file_exists(mod_path().."\\textures\\"..file) then
minetest.override_item(node, {
tiles = {file},
})
end
end
map_resource( "default:brick", "brick.png")
map_resource( "stairs:stair_brick", "brick.png")Neuromancer wrote:Evergreen wrote: You should make a roadmap as to what needs to be worked on. I can't contribute unless I know what needs to be contributed.
I'm working through adding support for the *.png files for existing blocks in minetest_game in a resource pack working from A-Z. You could start at the Z's and work your way back until we meet.
Or you could work on registering standard cube blocks that don't exist in minetest game, or even working on nodeboxes for things like cake or cauldron's that don't exist in minetest game and aren't simple blocks, and register them. Whatever you find most interesting. Just let me know. Again it might be best if you work your way backwards from Z. Then just check in to github like me after you have finished each batch of nodes.
Evergreen wrote:I'm not really familiar with the structure of a minetest resource pack directory, so I don't have a clear idea of what the minecraft texture names are. EDIT: I really could just download one to see what the structure looks like. :P
Evergreen wrote:I can see a potential issue with some tesxtures though, like the cactus texture. To make it fit properly, you would need to use some sort of automatic growing/shrinking tool to make it fit the current cactus model.
Users browsing this forum: No registered users and 9 guests