22i / amc

quickly test - how the Minecraft mobs look like in Minetest
https://github.com/22i/minecraft-voxel-blender-models
GNU General Public License v3.0
12 stars 2 forks source link

Naming conventions #2

Closed Wuzzy2 closed 7 years ago

Wuzzy2 commented 7 years ago

Can you please change the file names so they follow naming conventions? Currently, the names are extremely messy.

The file naming convention dictates that file names should look like this:

<modname>_<rest_of_the_name>

For example, for the MC texture “blaze.png”, the texture name in a mod example should be example_blaze.png.

In mobs_mc we recently changed most of the texture and model file names. So could you please adapt the file names to match the mobs_mc ones? Or would you insist on using your names, but with a leading amc_? If you choose the mobs_mc names, make sure they actually match with the file names of mobs_mc. If you chose amc_, you are almost completely free in naming, but this will require some fixing work on our side again.

Here is a simple Lua script which you can help in bulk-renaming (if you use mobs_mc_ prefix):

-- Returns a table of all files in directory
local function scandir(directory)
    local i, t, popen = 0, {}, io.popen
    local pfile = popen('ls -a "'..directory..'"')
    for filename in pfile:lines() do
        i = i + 1
        t[i] = filename
    end
    pfile:close()
    return t
end

-- Get list of files in working directory
local filez = scandir(".")

-- Check all file names
for k,filename in pairs(filez) do
        -- PNG files
    if string.sub(filename, -4, -1) == ".png" and
               -- filter out particular file names
            string.sub(filename, 1, 5) ~= "mobs_" and
            string.sub(filename, 1, 4) ~= "mcl_" and
            string.sub(filename, -8, -5) ~= "_inv" then -- inventory images
                -- Rename to "mobs_mc_<OLD NAME>", using git mv
        local new = "mobs_mc_" .. filename
        os.execute("git mv "..filename.." "..new)
        -- Different renaming rule for inventory images
    elseif string.sub(filename, -8, -5) == "_inv" then
                -- Rename to "mobs_mc_spawn_icon_<OLD NAME>", using git mv
        local new = "mobs_mc_spawn_icon_"..string.sub(filename, 1, -9)..".png"
        os.execute("git mv "..filename.." "..new)
    end
end

This performs a bulk-rename using git mv. To be executed in the mod directory. Please read and understand this script (and maybe modify, if neccessary) before executing it! It's just a small helper I used, you can ignore it if you don't need it.

But if you decided to use the amc_ prefix, it's even simpler: Just prepend every file name with amc_.

Another request: Can you please try to stick with original MC texture pack file name as close as possible (except for prefix, of course)? I do not like names like cat2.png; amc_cat2.png would not be much better. Suggested syntax:

<prefix>_<orignal_minecraft_file_name>
22i commented 7 years ago

@Wuzzy2

will go for mobs_mc prefix and will fix names to original texture pack file names

could you explain each line of the script and document it?

Wuzzy2 commented 7 years ago

I have added a few comments above. Commenting each line is overkill.

22i commented 7 years ago

@Wuzzy2

adapt the file names to match the mobs_mc ones?

stick to original MC texture pack file name as close as possible

this two conflict a bit since not all texture names in mobs_mc follows the original texture pack file name

for example: enderdragon was supposed to be dragon cat_black is just black but then it conlficts with black rabbit rabbit_black is just black

so what do we do about these?

Wuzzy2 commented 7 years ago

Well cat_black and rabbit_black need to have these names because of directory structure. We do nothing about these names. Those names stay. In this case, the naming rule is mobs_mc_<mobname>_<texturename>.png.

But names like enderdragon can easily be renamed back; I can fix this in mobs_mc. Are the other naming mismatches?

22i commented 7 years ago

i dont think there is.

Wuzzy2 commented 7 years ago

OK. Texture and model names have been fixed in mobs_mc now.

Is the renaming in your mod complete? If so, you can close this issue.

Wuzzy2 commented 7 years ago

Texture names are still a bit weird.

mobs_mc_ should only be used for mob textures and spawn eggs and a few other mob-related textures. As a rule of thumb, everything which does not into the mobs_mc mod should not have the mobs_mc prefix.

Something else should be used for things like signs, beds, etc. Try to use the name used in MCL2 (if already used), otherwise, use the amc_ prefix.

Try to use disambiguations, if needed. Names like mobs_mc_yellow.png are not really useful. E.g. instead of amc_yellow.png, use mcl_beds_bed_yellow.png. For the villagers, I used mobs_mc_villager_*.png.

Wuzzy2 commented 7 years ago

Texture names look good now.