From 3004b23be741d0ae8fa1ecf606dc1ac05c8ae499 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 27 Aug 2023 13:26:11 -0400 Subject: [PATCH] add rosay support of mod rosay from tunelerabyss is not present --- README.md | 19 ++++++++ init.lua | 4 ++ src/rosary.lua | 100 ++++++++++++++++++++++++++++++++++++++ textures/rosary_big.png | Bin 0 -> 1015 bytes textures/rosary_dot.png | Bin 0 -> 202 bytes textures/rosary_small.png | Bin 0 -> 477 bytes 6 files changed, 123 insertions(+) create mode 100644 src/rosary.lua create mode 100644 textures/rosary_big.png create mode 100644 textures/rosary_dot.png create mode 100644 textures/rosary_small.png diff --git a/README.md b/README.md index 9f076ca..d67cb35 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,8 @@ Optional: | xdecor:woodframed_glass | Wood Framed Glass | | xdecor:rope | Rope | | xdecor:hammer | Hammer, use it on workbench | +| rosary:small_<0-12> | A rosay, small parts | +| rosary:big_<0-12> | A rosay, big one | | xdecor:workbench | Work Bench, to reapir tools | #### Crafts @@ -211,6 +213,23 @@ xdecor:hammer 1 {"", "group:stick", ""} ``` +rosary:small_0 + +``` + {"default:steel_ingot","farming:string","default:steel_ingot"}, + {"farming:string","","farming:string"}, + {"default:steel_ingot","farming:string","default:steel_ingot"}, +``` + +rosary:big_0 + +``` + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", +``` xdecor:workbench 1 diff --git a/init.lua b/init.lua index ad13908..69606d4 100644 --- a/init.lua +++ b/init.lua @@ -53,6 +53,10 @@ local subpart = { "workbench", } +if not minetest.get_modpath("rosary") then + table.insert(subpart, "rosary") +end + for _, name in ipairs(subpart) do local enable = minetest.settings:get_bool("enable_xdecor_" .. name) if enable or enable == nil then diff --git a/src/rosary.lua b/src/rosary.lua new file mode 100644 index 0000000..bd5303d --- /dev/null +++ b/src/rosary.lua @@ -0,0 +1,100 @@ +local small_dots = { + {x=11, y=17}, + {x=17, y=21}, + {x=24, y=22}, + {x=27, y=16}, + {x=26, y=9}, + {x=21, y=4}, + {x=15, y=2}, + {x=9, y=2}, + {x=4, y=7}, + {x=3, y=13}, +} + +local big_dots = { + {x=18, y=12}, {x=22, y=14}, {x=22, y=18}, {x=23, y=22}, {x=25, y=26}, {x=26, y=30}, {x=30, y=31}, {x=34, y=29}, {x=35, y=25}, {x=35, y=20}, {x=38, y=13}, + {x=45, y=14}, {x=47, y=18}, {x=47, y=22}, {x=46, y=26}, {x=47, y=30}, {x=48, y=34}, {x=47, y=38}, {x=43, y=40}, {x=39, y=41}, {x=35, y=40}, {x=31, y=45}, + {x=33, y=51}, {x=34, y=55}, {x=38, y=56}, {x=42, y=57}, {x=46, y=58}, {x=50, y=59}, {x=54, y=57}, {x=55, y=53}, {x=56, y=49}, {x=56, y=45}, {x=55, y=39}, + {x=55, y=32}, {x=56, y=28}, {x=57, y=24}, {x=57, y=20}, {x=57, y=16}, {x=57, y=12}, {x=56, y=8}, {x=55, y=4}, {x=51, y=3}, {x=47, y=2}, {x=40, y=2}, + {x=33, y=2}, {x=29, y=1}, {x=25, y=2}, {x=21, y=3}, {x=17, y=2}, {x=13, y=1}, {x=9, y=1}, {x=5, y=1}, {x=4, y=5}, {x=6, y=9}, {x=11, y=13}, + {x=11, y=19}, {x=11, y=23}, {x=11, y=27}, {x=11, y=33}, +} +-- items + +minetest.register_craftitem("rosary:small_0", { + description = "Small rosary", + inventory_image = "rosary_small.png", + wield_scale = {x=1, y=1, z=0.5}, + groups = {rosary=1, rosary_small=1}, + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + itemstack:set_name("rosary:small_10") + return itemstack + end, +}) + +minetest.register_craftitem("rosary:big_0", { + description = "Large rosary", + inventory_image = "rosary_big.png", + wield_image = "[combine:96x96:0,0=rosary_big.png:", + wield_scale = {x=1.5, y=1.5, z=0.5}, + groups = {rosary=1, rosary_big=1}, + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + itemstack:set_name("rosary:big_59") + return itemstack + end, +}) + +for i, p in ipairs(small_dots) do + minetest.register_craftitem("rosary:small_"..i, { + description = "Small rosary", + inventory_image = "[combine:32x32:0,0=rosary_small.png:"..p.x..","..p.y.."=rosary_dot.png", + wield_scale = {x=1, y=1, z=0.5}, + groups = {rosary=1, rosary_small=1, not_in_creative_inventory=1}, + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + itemstack:set_name("rosary:small_"..(i-1)) + return itemstack + end, + }) +end + +for i, p in ipairs(big_dots) do + minetest.register_craftitem("rosary:big_"..i, { + description = "Large rosary", + inventory_image = "[combine:64x64:0,0=rosary_big.png:"..p.x..","..p.y.."=rosary_dot.png", + wield_image = "[combine:96x96:0,0=rosary_big.png:"..p.x..","..p.y.."=rosary_dot.png", + wield_scale = {x=1.5, y=1.5, z=0.5}, + groups = {rosary=1, rosary_big=1, not_in_creative_inventory=1}, + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + itemstack:set_name("rosary:big_"..(i-1)) + return itemstack + end, + }) +end + +-- crafts + +minetest.register_craft({ + type = "shapeless", + output = "rosary:big_0", + recipe = { + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", + "group:rosary_small", + } +}) + +minetest.register_craft({ + output = "rosary:small_0", + recipe = { + {"default:steel_ingot","farming:string","default:steel_ingot"}, + {"farming:string","","farming:string"}, + {"default:steel_ingot","farming:string","default:steel_ingot"}, + } +}) + diff --git a/textures/rosary_big.png b/textures/rosary_big.png new file mode 100644 index 0000000000000000000000000000000000000000..f0af13b9a47c3b5271e80a06c51f674837746c63 GIT binary patch literal 1015 zcmVWFU8GbZ8()Nlj2>E@cM*00Ub|L_t(|+U;9SlB^&M zj+RR=W0jX_55S@5J(qFO2jCj+nH5t!2SXBm#Celd+ep&n=Sv7Qz<*9d?8|-M9RPr} z7Pf60QqNqWx${fXbTzQ9D||j5&{{j}nX;g8{5THa%$JU3DZpC${o|BUgE7WkJyR9p z$5ZqDGiHp~m{cLrm$cSSDMi+(F~)hz0st(_0_(cM`~3z0fO($3Eg$0>&OeV+$Ifz< zQlwBFYQ!h@qia%1A>TB+++wX*VP=eRp~X`RaLzetI*rNl&l28O?@nAmq3#oM zLG(C|AJz)Jjl3)IXC)MCwA`wx~hL1rlia8oZ; z#??D)51^(xiPpJZLzRK?WhsEOsBPN@Ny_2W5+2Yfa<2HY6u=Q!)1qAd7~ioru+_3C zhd;)5lDH@}2iM+EQTbzaKs5}I-~iXdy2k)XbA=i*J|)ldoMpJ`7{FN=*TbmFx(x%k zu^OxYOU1vnHs1rJB_${0IYbTRF|SG0033?`P|!P6qHY8t*IAFN^YB# z*f5Q~EM6%!gou7VaMfBnNkgVs*78-LrxI0Ms*-C_ElwEPW8^zA=l4ryhZY&;)(~iM ze3p_irO^J0Uawd5dv11UaSsWTacdT6aStgaBYJNa0Dcq~KIXmUQ)o;@Uhci*oGkMz zE5T+sQ!5Ro(o_irU`>%ODnYENQ5yrg34xMV>^Rk67amY68&I~(U3fsvPE*RWy4elZ zz=6l?24mJL(SoOVRyQ7i9h^{_C6f4ODZn$TRk~vT_mL`uvd@^HQ_4{Y=d5vnhmzzk la=%Iem_m9wxcQ^r=?fz2^=?EXvTOhV002ovPDHLkV1gG6x;y{? literal 0 HcmV?d00001 diff --git a/textures/rosary_dot.png b/textures/rosary_dot.png new file mode 100644 index 0000000000000000000000000000000000000000..c1ef82cfb5e32025c5446b4dee4f90bbf7462ca4 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^%plCc1|-8Yw(bW~Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPVyQq+~(8bfPu0SE#%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dD6Z$};uyklo%Nt0BZC5m>%sQbsxJ<>&pIwT~vtA>hfvs)j%QH%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6_|fq~J{)5S3);_%z>jcbo6@R$aAO><0=lxSEuXrQz~F5BA-R{vM|JeAP_L6>cp0iq^JQi@ZFVdQ&MBb@0Lm7?QUCw| literal 0 HcmV?d00001