forked from VoxeLibre/VoxeLibre
some stuff
This commit is contained in:
parent
3312aa3201
commit
409444e3e0
|
@ -1,8 +1,7 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local colorize_value = 125
|
||||
local modifier = "[colorize:<color>:"..colorize_value
|
||||
local modifier = "^[colorize:%s:".. 175
|
||||
|
||||
local str = string
|
||||
local string = string
|
||||
|
||||
local longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive.")
|
||||
local usage = S("To equip it, put it on the corresponding armor slot in your inventory menu.")
|
||||
|
@ -43,7 +42,7 @@ local function get_texture_function(texture)
|
|||
if color == "" or color == nil then
|
||||
return texture
|
||||
else
|
||||
return texture.."[colorize:"..color..":"..colorize_value
|
||||
return texture .. string.format(modifier, color)
|
||||
end
|
||||
end
|
||||
return get_texture
|
||||
|
@ -66,10 +65,10 @@ mcl_armor.register_set({
|
|||
feet = 1,
|
||||
},
|
||||
textures = {
|
||||
head = get_texture_function("mcl_armor_helmet_leather.png"),
|
||||
torso = get_texture_function("mcl_armor_chestplate_leather.png"),
|
||||
legs = get_texture_function("mcl_armor_leggings_leather.png"),
|
||||
feet = get_texture_function("mcl_armor_boots_leather.png"),
|
||||
head = get_texture_function("mcl_armor_helmet_leather_colored.png"),
|
||||
torso = get_texture_function("mcl_armor_chestplate_leather_colored.png"),
|
||||
legs = get_texture_function("mcl_armor_leggings_leather_colored.png"),
|
||||
feet = get_texture_function("mcl_armor_boots_leather_colored.png"),
|
||||
},
|
||||
repair_material = "mcl_mobitems:leather",
|
||||
})
|
||||
|
@ -82,7 +81,23 @@ minetest.register_chatcommand("colort", {
|
|||
if player then
|
||||
local item = player:get_wielded_item()
|
||||
item:get_meta():set_string("color", "#951d1d")
|
||||
player:set_wielded_item(item)
|
||||
mcl_armor.update(player)
|
||||
end
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mcl_armor:leggings_leather_colored",
|
||||
recipe = {
|
||||
"mcl_armor:leggings_leather",
|
||||
"mcl_dye:blue",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if itemstack:get_name() == "mcl_armor:leggings_leather_colored" then
|
||||
return itemstack:get_meta():set_string("color", "#2a2c94")
|
||||
end
|
||||
end)
|
Binary file not shown.
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 5.1 KiB |
Loading…
Reference in New Issue