From b17821de68f203ca2de3faf96a6dbf9647be2e3e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Aug 2021 21:42:51 +0200 Subject: [PATCH] update --- mods/mobs_redo/api.lua | 58 ++++++++++++++---- mods/skinsdb/meta/character_2113.txt | 3 + mods/skinsdb/textures/character_2113.png | Bin 0 -> 3178 bytes mods/techpack/tubelib_addons1/grinder.lua | 70 +++++++++++++++++++++- 4 files changed, 120 insertions(+), 11 deletions(-) create mode 100644 mods/skinsdb/meta/character_2113.txt create mode 100644 mods/skinsdb/textures/character_2113.png diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index 7ecc0e49..d6d35107 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20210801", + version = "20210816", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -160,6 +160,7 @@ local mob_class = { attack_players = true, attack_npcs = true, facing_fence = false, + _breed_countdown = nil, _cmi_is_mob = true } @@ -722,6 +723,13 @@ function mobs:effect(pos, amount, texture, min_size, max_size, end +-- Thanks Wuzzy for the following editable settings + +local HORNY_TIME = 30 +local HORNY_AGAIN_TIME = 60 * 5 -- 5 minutes +local CHILD_GROW_TIME = 60 * 20 -- 20 minutes + + -- update nametag colour function mob_class:update_tag() @@ -740,9 +748,25 @@ function mob_class:update_tag() col = "#FF0000" end - -- build infotext + local text = "" + + if self.horny == true then + + text = "\nLoving: " .. (self.hornytimer - (HORNY_TIME + HORNY_AGAIN_TIME)) + + elseif self.child == true then + + text = "\nGrowing: " .. (self.hornytimer - CHILD_GROW_TIME) + + elseif self._breed_countdown then + + text = "\nBreeding: " .. self._breed_countdown + + end + self.infotext = "Health: " .. self.health .. " / " .. self.hp_max .. "\n" .. "Owner: " .. self.owner + .. text -- set changes self.object:set_properties({ @@ -1358,10 +1382,6 @@ function mob_class:follow_holding(clicker) return false end --- Thanks Wuzzy for the following editable settings -local HORNY_TIME = 30 -local HORNY_AGAIN_TIME = 60 * 5 -- 5 minutes -local CHILD_GROW_TIME = 60 * 20 -- 20 minutes -- find two animals of same type and breed if nearby and horny function mob_class:breed() @@ -1414,6 +1434,8 @@ function mob_class:breed() self.hornytimer = 0 self.horny = false end + + self:update_tag() end -- find another same animal who is also horny and mate if nearby @@ -1469,6 +1491,8 @@ function mob_class:breed() self.hornytimer = HORNY_TIME + 1 ent.hornytimer = HORNY_TIME + 1 + self:update_tag() + -- have we reached active mob limit if active_limit > 0 and active_mobs >= active_limit then minetest.chat_send_player(self.owner, @@ -4667,25 +4691,25 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) self.object:set_hp(self.health) - self:update_tag() - -- make children grow quicker if self.child == true then -- self.hornytimer = self.hornytimer + 20 -- deduct 10% of the time to adulthood - self.hornytimer = self.hornytimer + ( - (CHILD_GROW_TIME - self.hornytimer) * 0.1) + self.hornytimer = math.floor(self.hornytimer + ( + (CHILD_GROW_TIME - self.hornytimer) * 0.1)) --print ("====", self.hornytimer) return true end -- feed and tame self.food = (self.food or 0) + 1 + self._breed_countdown = feed_count - self.food if self.food >= feed_count then self.food = 0 + self._breed_countdown = nil if breed and self.hornytimer == 0 then self.horny = true @@ -4711,6 +4735,8 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) self:mob_sound(self.sounds.random) end + self:update_tag() + return true end @@ -4740,6 +4766,18 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) return true end + -- if mob follows items and user right clicks while holding sneak it shows info + if self.follow then + + if clicker:get_player_control().sneak then + + minetest.chat_send_player(clicker:get_player_name(), + S("@1 follows:\n- @2", + self.name:split(":")[2], + table.concat(self.follow, "\n- "))) + end + end + return false end diff --git a/mods/skinsdb/meta/character_2113.txt b/mods/skinsdb/meta/character_2113.txt new file mode 100644 index 00000000..fdcb5f33 --- /dev/null +++ b/mods/skinsdb/meta/character_2113.txt @@ -0,0 +1,3 @@ +nick_ +nick_ +CC BY-SA 3.0 diff --git a/mods/skinsdb/textures/character_2113.png b/mods/skinsdb/textures/character_2113.png new file mode 100644 index 0000000000000000000000000000000000000000..835334e0361d14a1e58bf7be1b7436a75ab4b804 GIT binary patch literal 3178 zcmZ{mX*AS<8pi*YiqQxW5@TPZS(G)3A(W+IgtCoch=d_KVQ6Fs*=a;X_O-F^A*2k6 zFrpCImoUh6Ki&`byytzNbDrOMK0j}?iP0@E=pqOJ0I zX53A~n*dPxg6+`$)PJFa9?B2^0we+8=?SNwSWkZgfDaS^mh1pPH4OlGJ+d0^s-J+< znA^9I!0~_Qb#uYX6X%S#zM;;UITj8sS@~(v2@(LXx$7funmN-}((jj8e?v#L!mj+O zy0YLljp^}xrR=h#Xef{{B9oJ2CeMPD;mT#?k@W+1!p?9oil86*>&!CPm=NLt9+9%5 z!oqmEU8*Rj-oxD7yj0~US+|XY^t15efh*1K_`&v0RedYHM+PO5T>RyMrS%Jk3w+0W z$CZTQE-6i~i42zM&CwDD5?fF1>c*fQxFi-HvPb**Yw(MLuXCf2CqG6#k~i_=eA|S^ zwm^2~mLwQo3+ah;NK$J;ki2d~xUBU?9$_CPF__$A<0i`7O_C@~bY%ZZzzZ!PXah4E zThVH)ob$y(Xy*gHbW3*)<=Fw4SANjqP(hr979W~S&&;56$($Ce; z#Wm)N#>5%PldyqiO$KzGf!uDIMw2{>{Dr780nBqZ&C7JN1}S)E?Hb@+t|^6O*IzvPuy zD!A;RaI9#vRpK?Qxy5BBkQ1t|vwMNSC)1P5plKa)_&upFT;Lo;#2Y;7uSHZpIFu-n){rwbCJQzCf(^swigb8r$BR9-`0C?z zwVp7BN;u+yrMOTKHoV_J=y3ZA>H^aYjUHyZKg|T?H@>#2wqc{F^FRfWdc|6Odv=tX zCrtRnwudp$0y^sp1`DWomq$l8`ubT%RZu9WgSQs8iKDyl`N07p2d#AG7pziRin2WtEx}7MlQ{K&bS~<_o#z?@Bz9N(KBk(7;lGVg< zOTdBup>wx(0VMO^2JZNuH_-(Yj}qQ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6^pLs9=opc_S%;L#9-^7CveA%%%_sjvy z8Z>4F8}7JUo3Pa{=-zkTCwnYAkgNi633MDs(xD@NIu|a8M~;tq_2-ai5@gzPT1v_z zPKC$2!rG&AG>?h)tZH6?xG5-O!E5c69=?iEs4QE^R%!@I1BtpgC?)e&h>zR#~&JuXiRNq!Q1UAHhpadNrL zT@J4;c|nIy<(B=~$g6h{r@3Mc<_T0~Cx2bZ3;tlP7qE@Pxzc-iYoRaRu0+e&m+F*% z2!H(H{)YKsYuq1IlHcb_nIaEIT4m^UhX)o#=-0iMV^o`{ce5ugn&%H*9L-!8M=P|L z;r$y6E*q@wf3$rQ+aVRY`&mZ!Jd$8qU}W7I*6Sk(6M$uGo1m`hw%y-nPja9Z(|ugK zh+ZsE?U(+^?Y>u6c9(Zs%Yl*%sJU{oKfVJJX4M4)&Y)o2~fr% zfArRPzs&2CrgSOxe*dT^1FsHRTM3L~WNR!2mxKXb%r7+6vIlin3uS-0*tg$slcNib z#t^ttG(#~5zbWGr;^hdjGC4r=DB_H*ktxP(pls;5XIiL$nB)Aw$A*}955-t6npjNbZq@tjG1G`OX4*ULio1Lu-B}tTBH;*|7Li%z=V!i(E`5fO zBHnCp%OxU3m>-d^s;>E+YRrol)`T%`7NCaSJ)>JMAz|Ue%9%z2h3uq;KF^i5v3#?}R3N0%sd>~NN*x6) zSt>BT*&sHU2YlLixc}o^Qv@XRheA{B;m(5bzwF&Z+a;TS_!1q9nv-W-!du6}8*A_F zsOsS5cp?BC3Wv!e3Wa{|IEVb7z@x`l7bpM!A85&@?41Mv NeH|lYnU-Dne*mt)>w*9P literal 0 HcmV?d00001 diff --git a/mods/techpack/tubelib_addons1/grinder.lua b/mods/techpack/tubelib_addons1/grinder.lua index 8e1ce3d0..e3bc265e 100644 --- a/mods/techpack/tubelib_addons1/grinder.lua +++ b/mods/techpack/tubelib_addons1/grinder.lua @@ -315,7 +315,75 @@ function tubelib.add_grinder_recipe(recipe) recipe.type = "grinding" unified_inventory.register_craft(recipe) end -end +end + +local function remove_unified_inventory_recipe(recipe) + if recipe.input and recipe.output then + local output_name = ItemStack(recipe.output):get_name() + local crafts = unified_inventory.crafts_for.recipe[output_name] + if crafts then + for i, craft in ipairs(crafts) do + if craft.type == recipe.type + and ItemStack(craft.output):get_name() == output_name + and #craft.items == 1 + and craft.items[1] == recipe.input + then + table.remove(crafts, i) + break + end + end + end + elseif recipe.input then + for output_name, crafts in pairs(unified_inventory.crafts_for.recipe) do + for i, craft in ipairs(crafts) do + if craft.type == recipe.type + and #craft.items == 1 + and craft.items[1] == recipe.input + then + table.remove(crafts, i) + break + end + end + end + elseif recipe.output then + local output_name = ItemStack(recipe.output):get_name() + local crafts = unified_inventory.crafts_for.recipe[output_name] + if crafts then + for i, craft in ipairs(crafts) do + if craft.type == recipe.type + and ItemStack(craft.output):get_name() == output_name then + table.remove(crafts, i) + break + end + end + end + end +end + +function tubelib.remove_grinder_recipe(recipe) + if recipe.input and recipe.output then + if Recipes[recipe.input]:get_name() ~= ItemStack(recipe.output):get_name() then + return + end + Recipes[recipe.input] = nil + elseif recipe.input then + Recipes[recipe.input] = nil + elseif recipe.output then + local output_name = ItemStack(recipe.output):get_name() + for input_name, output in pairs(Recipes) do + if output:get_name() == output_name then + Recipes[input_name] = nil + end + end + end + if minetest.global_exists("unified_inventory") then + remove_unified_inventory_recipe({ + input = recipe.input, + output = recipe.output, + type = "grinding" + }) + end +end for k,v in pairs({ ["default:cobble"] = "default:gravel",