From 98c48dab8caf45754e09869094f57a3cb68648ba Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 7 Jul 2022 12:46:44 +0200 Subject: [PATCH 1/5] abolish child labor --- mods/ENTITIES/mobs_mc/villager.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index af517a990b..65175166d7 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -629,6 +629,7 @@ local function look_for_job(self) end local function get_a_job(self) + if self.child then return end local p = self.object:get_pos() local n = minetest.find_node_near(p,1,jobsites) if n and employ(self,n) then return true end From 8fe40fcd2631affb078bee62bb3514ddd1f162d0 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 7 Jul 2022 12:47:17 +0200 Subject: [PATCH 2/5] remove old debug line --- mods/ENTITIES/mobs_mc/villager.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 65175166d7..6bf1bf5455 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1289,7 +1289,6 @@ mcl_mobs:register_mob("mobs_mc:villager", { return true --do not pick up end, on_rightclick = function(self, clicker) - local trg=vector.new(0,9,0) if self._jobsite then mcl_mobs:gopath(self,self._jobsite,function() --minetest.log("arrived at jobsite") From bcb76f7bd2bd00c8fc8f851d8c71e71146a3125e Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 7 Jul 2022 12:47:27 +0200 Subject: [PATCH 3/5] correctly lock job when traded --- mods/ENTITIES/mobs_mc/villager.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 6bf1bf5455..e5d2368909 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -642,6 +642,7 @@ local function check_jobsite(self) local m = minetest.get_meta(self._jobsite) if m:get_string("villager") ~= self._id then self._profession = "unemployed" + self._trades = nil set_textures(self) end end @@ -664,7 +665,6 @@ end local function init_trades(self, inv) local profession = professions[self._profession] local trade_tiers = profession.trades - self._traded = true if trade_tiers == nil then -- Empty trades self._trades = false @@ -1113,6 +1113,7 @@ local trade_inventory = { local trader = player_trading_with[name] local tradenum = player_tradenum[name] local trades + trader._traded = true if trader and trader._trades then trades = minetest.deserialize(trader._trades) end From 08a1ecd879371cf82d326737cbb743097c312846 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 8 Jul 2022 02:03:18 +0200 Subject: [PATCH 4/5] Don't take extra bread when feeding --- mods/ENTITIES/mcl_mobs/api.lua | 4 ++-- mods/ENTITIES/mobs_mc/villager.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 77f4193dd6..3cab39b02e 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -4357,7 +4357,7 @@ end -- feeding, taming and breeding (thanks blert2112) -function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame) +function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake) if not self.follow then return false end @@ -4370,7 +4370,7 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame) local item = clicker:get_wielded_item() - item:take_item() + if not notake then item:take_item() end clicker:set_wielded_item(item) end diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index e5d2368909..05f978ac35 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1284,7 +1284,7 @@ mcl_mobs:register_mob("mobs_mc:villager", { end end if clicker then - mcl_mobs:feed_tame(self, clicker, 1, true, false) + mcl_mobs:feed_tame(self, clicker, 1, true, false, true) return end return true --do not pick up From de9056ae62408eb48dbc1bbb3ea24569be48932e Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 8 Jul 2022 05:08:06 +0200 Subject: [PATCH 5/5] Fix child mobs collision boxes --- mods/ENTITIES/mcl_mobs/api.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 3cab39b02e..84b24c339c 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -298,9 +298,13 @@ local function update_roll(self) if is_Fleckenstein then cbox[2], cbox[5] = -cbox[5], -cbox[2] + self.object:set_properties({collisionbox = cbox}) + -- This leads to child mobs having the wrong collisionbox + -- and seeing as it seems to be nothing but an easter egg + -- i've put it inside the if. Which just makes it be upside + -- down lol. end - self.object:set_properties({collisionbox = cbox}) end -- set and return valid yaw