some work on colored leathered armors

This commit is contained in:
AFCMS 2021-11-14 18:28:57 +01:00
parent c49c5dec67
commit 3312aa3201
5 changed files with 8 additions and 5 deletions

View File

@ -66,4 +66,4 @@ dofile(modpath .. "/player.lua")
dofile(modpath .. "/damage.lua")
dofile(modpath .. "/register.lua")
dofile(modpath .. "/alias.lua")
dofile(modpath.."/leather.lua")
dofile(modpath .. "/leather.lua")

View File

@ -34,7 +34,7 @@ local colors = {
local function calculate_color(first, last)
--local first_r = tonumber(str.sub(first, 2, 3))
--local first_g = tonumber(str.sub(first, 4, 5))
return tonumber(first)*tonumber(last)
return tonumber(first)*tonumber(last)
end
local function get_texture_function(texture)
@ -75,11 +75,14 @@ mcl_armor.register_set({
})
minetest.register_chatcommand("colort", {
params = "<name> <privilege>", -- Short parameter description
params = "", -- Short parameter description
description = "Remove privilege from player", -- Full description
func = function(name, param)
local player = minetest.get_player_by_name(name)
local item = player:get_wielded_item()
item:get_meta():set_string("color", "#951d1d")
if player then
local item = player:get_wielded_item()
item:get_meta():set_string("color", "#951d1d")
mcl_armor.update(player)
end
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B