diff --git a/closet/api/api_container.lua b/closet/api/api_container.lua index 9dca902..9474c1b 100644 --- a/closet/api/api_container.lua +++ b/closet/api/api_container.lua @@ -7,7 +7,7 @@ function closet.container.get_container_formspec(pos, clicker) local texture if minetest.get_modpath("3d_armor")~=nil then local clicker_name = clicker:get_player_name() - texture = armor.textures[clicker_name].skin..",".. + texture = minetest.formspec_escape(armor.textures[clicker_name].skin)..",".. armor.textures[clicker_name].armor..","..armor.textures[clicker_name].wielditem else texture = clicker:get_properties().textures[1] @@ -16,6 +16,7 @@ function closet.container.get_container_formspec(pos, clicker) local formspec = "size[8,8.25]" .. + "style[preview_model;frame_loop=0,79]".. "model[0,0;5,5;preview_model;"..model..";"..texture..";-10,195]" .. "list[current_player;cloths;3,0.25;1,4]" .. "list[nodemeta:" .. spos .. ";closet;5,0.25;3,12;]" .. @@ -29,12 +30,14 @@ end minetest.register_allow_player_inventory_action(function(player, action, inventory, inventory_info) local stack - if action == "move" and inventory_info.to_list == "cloths" then --for moving items from player inventory list 'main' to 'cloths' + if action == "move" and inventory_info.to_list == "cloths" then + --for moving items from player inventory list 'main' to 'cloths' if inventory_info.from_list == inventory_info.to_list then --for moving inside the 'cloths' inventory return 1 end stack = inventory:get_stack(inventory_info.from_list, inventory_info.from_index) - elseif action == "put" and inventory_info.listname == "cloths" then --for moving from node inventory 'closet' to player inventory 'cloths' + elseif action == "put" and inventory_info.listname == "cloths" then + --for moving from node inventory 'closet' to player inventory 'cloths' stack = inventory_info.stack else return diff --git a/default_cloths/init.lua b/default_cloths/init.lua new file mode 100644 index 0000000..598792f --- /dev/null +++ b/default_cloths/init.lua @@ -0,0 +1,58 @@ +-- +-- default_cloths +-- License:GPLv3 +-- + +-- +-- Default Cloths +-- + +minetest.register_craft({ + output = "player_api:cloth_female_upper_default", + type = "shaped", + recipe = { + {"fabric:violet", "", "fabric:violet"}, + {"fabric:dark_grey", "fabric:dark_grey", "fabric:dark_grey"}, + {"fabric:violet", "fabric:violet", "fabric:violet"}, + } +}) + +minetest.register_craft({ + output = "player_api:cloth_male_upper_default", + type = "shaped", + recipe = { + {"fabric:black", "", "fabric:black"}, + {"fabric:green", "fabric:green", "fabric:green"}, + {"fabric:brown", "fabric:brown", "fabric:brown"}, + } +}) + +minetest.register_craft({ + output = "player_api:cloth_male_lower_default", + type = "shaped", + recipe = { + {"fabric:blue", "fabric:blue", "fabric:blue"}, + {"fabric:blue", "", "fabric:blue"}, + {"fabric:black", "", "fabric:black"}, + } +}) + +minetest.register_craft({ + output = "player_api:cloth_female_lower_default", + type = "shaped", + recipe = { + {"fabric:blue", "fabric:blue", "fabric:blue"}, + {"fabric:white", "", "fabric:white"}, + {"", "", ""}, + } +}) + +minetest.register_craft({ + output = "player_api:cloth_female_head_default", + type = "shaped", + recipe = { + {"fabric:pink", "", ""}, + {"", "fabric:pink", ""}, + {"", "", ""}, + } +}) diff --git a/default_cloths/locale/default_cloths.es.tr b/default_cloths/locale/default_cloths.es.tr new file mode 100644 index 0000000..aa08efd --- /dev/null +++ b/default_cloths/locale/default_cloths.es.tr @@ -0,0 +1,17 @@ +# textdomain: fabric +@1 Cotton Fabric=Tela de algodón @1 +White=blanca +Grey=gris +Dark Grey=gris oscura +Black=negra +Violet=violeta +Blue=azul +Cyan=azul claro +Dark Green=verde oscuro +Green=verde +Yellow=amarilla +Brown=marrón +Orange=naranja +Red=roja +Magenta=magenta +Pink=rosa diff --git a/default_cloths/mod.conf b/default_cloths/mod.conf new file mode 100644 index 0000000..cba00b9 --- /dev/null +++ b/default_cloths/mod.conf @@ -0,0 +1,5 @@ +name = default_cloths +description = Craft the default player_api cloths +depends = player_api +optional_depends = +version = diff --git a/default_cloths/textures/fabric_fabric.png b/default_cloths/textures/fabric_fabric.png new file mode 100644 index 0000000..22b4b8d Binary files /dev/null and b/default_cloths/textures/fabric_fabric.png differ diff --git a/fabric/init.lua b/fabric/init.lua new file mode 100644 index 0000000..f1a370f --- /dev/null +++ b/fabric/init.lua @@ -0,0 +1,69 @@ +-- +-- fabric +-- License:GPLv3 +-- + +-- internationalization boilerplate +local S = minetest.get_translator(minetest.get_current_modname()) + +-- +-- Fabric Mod +-- + +local fabric_dyes = dye.dyes + +for i = 1, #fabric_dyes do + if fabric_dyes[i][1] == "white" then + fabric_dyes[i][3] = "FFFFFF" + elseif fabric_dyes[i][1] == "grey" then + fabric_dyes[i][3] = "808080" + elseif fabric_dyes[i][1] == "dark_grey" then + fabric_dyes[i][3] = "A9A9A9" + elseif fabric_dyes[i][1] == "black" then + fabric_dyes[i][3] = "000000" + elseif fabric_dyes[i][1] == "violet" then + fabric_dyes[i][3] = "EE82EE" + elseif fabric_dyes[i][1] == "blue" then + fabric_dyes[i][3] = "0000FF" + elseif fabric_dyes[i][1] == "cyan" then + fabric_dyes[i][3] = "00FFFF" + elseif fabric_dyes[i][1] == "dark_green" then + fabric_dyes[i][3] = "006400" + elseif fabric_dyes[i][1] == "green" then + fabric_dyes[i][3] = "008000" + elseif fabric_dyes[i][1] == "yellow" then + fabric_dyes[i][3] = "FFFF00" + elseif fabric_dyes[i][1] == "brown" then + fabric_dyes[i][3] = "A52A2A" + elseif fabric_dyes[i][1] == "orange" then + fabric_dyes[i][3] = "FFA500" + elseif fabric_dyes[i][1] == "red" then + fabric_dyes[i][3] = "FF0000" + elseif fabric_dyes[i][1] == "magenta" then + fabric_dyes[i][3] = "FF00FF" + elseif fabric_dyes[i][1] == "pink" then + fabric_dyes[i][3] = "FFC0CB" + end +end + +for i = 1, #fabric_dyes do + + local name, desc, rgb = unpack(fabric_dyes[i]) + + desc = S(desc) + + minetest.register_craftitem("fabric:".. name, { + description = S("@1 Cotton Fabric", desc), + inventory_image = "fabric_fabric.png^[colorize:#"..rgb..":180", + }) + + minetest.register_craft({ + output = "fabric:".. name, + type = "shaped", + recipe = { + {"", "", ""}, + {"", "group:dye,color_" .. name, ""}, + {"farming:cotton", "farming:cotton", "farming:cotton"}, + } + }) +end diff --git a/fabric/locale/fabric.es.tr b/fabric/locale/fabric.es.tr new file mode 100644 index 0000000..aa08efd --- /dev/null +++ b/fabric/locale/fabric.es.tr @@ -0,0 +1,17 @@ +# textdomain: fabric +@1 Cotton Fabric=Tela de algodón @1 +White=blanca +Grey=gris +Dark Grey=gris oscura +Black=negra +Violet=violeta +Blue=azul +Cyan=azul claro +Dark Green=verde oscuro +Green=verde +Yellow=amarilla +Brown=marrón +Orange=naranja +Red=roja +Magenta=magenta +Pink=rosa diff --git a/fabric/mod.conf b/fabric/mod.conf new file mode 100644 index 0000000..89e5e11 --- /dev/null +++ b/fabric/mod.conf @@ -0,0 +1,5 @@ +name = fabric +description = Craft fabrics thru cotton +depends = farming, dye +optional_depends = +version = diff --git a/fabric/textures/fabric_fabric.png b/fabric/textures/fabric_fabric.png new file mode 100644 index 0000000..22b4b8d Binary files /dev/null and b/fabric/textures/fabric_fabric.png differ diff --git a/mirrors/init.lua b/mirrors/init.lua index cf998e3..deb14cd 100644 --- a/mirrors/init.lua +++ b/mirrors/init.lua @@ -3,8 +3,6 @@ -- License:GPLv3 -- -local modname = "mirrors" -local modpath = minetest.get_modpath(modname) -- internationalization boilerplate local S = minetest.get_translator(minetest.get_current_modname())