diff --git a/mokapi/api/api_replace.lua b/mokapi/api/api_replace.lua index 23c5b83..073e119 100644 --- a/mokapi/api/api_replace.lua +++ b/mokapi/api/api_replace.lua @@ -3,8 +3,9 @@ -- function mokapi.replace(self, sound_name, max_hear_distance) - if not self.replace_rate or not self.replace_what or self.child == true or self.object:get_velocity().y ~= 0 or math.random(1, self.replace_rate) > 1 then - return false + if not self.replace_rate or not self.replace_what or self.child == true or self.object:get_velocity().y ~= 0 + or math.random(1, self.replace_rate) > 1 then + return false end local pos = self.object:get_pos() local what, with, y_offset @@ -22,7 +23,8 @@ function mokapi.replace(self, sound_name, max_hear_distance) if #minetest.find_nodes_in_area(pos, pos, what) > 0 then minetest.set_node(pos, {name = with}) if sound_name then - mokapi.make_sound("object", self.object, sound_name, max_hear_distance or mokapi.consts.DEFAULT_MAX_HEAR_DISTANCE) + mokapi.make_sound("object", self.object, sound_name, max_hear_distance + or mokapi.consts.DEFAULT_MAX_HEAR_DISTANCE) end return true else diff --git a/petz/api/api.lua b/petz/api/api.lua index a50a8b2..38db8c7 100644 --- a/petz/api/api.lua +++ b/petz/api/api.lua @@ -43,4 +43,3 @@ assert(loadfile(modpath .. "/api/api_back_home.lua"))() assert(loadfile(modpath .. "/api/api_on_deactivate.lua"))() assert(loadfile(modpath .. "/api/api_wagon.lua"))() assert(loadfile(modpath .. "/api/api_saddles.lua"))() - diff --git a/petz/mobkit/br_herbivore.lua b/petz/mobkit/br_herbivore.lua index fb761fa..69828be 100644 --- a/petz/mobkit/br_herbivore.lua +++ b/petz/mobkit/br_herbivore.lua @@ -149,12 +149,13 @@ function petz.herbivore_brain(self) end end end + --search for a petz:pet_bowl or a bale if prty < 4 and self.tamed then local view_range = self.view_range local nearby_nodes = minetest.find_nodes_in_area( - {x = pos.x - view_range, y = pos.y - 1, z = pos.z - view_range}, - {x = pos.x + view_range, y = pos.y + 1, z = pos.z + view_range}, + {x = pos.x - (view_range/2), y = pos.y - 1, z = pos.z - (view_range/2)}, + {x = pos.x + (view_range/2), y = pos.y + 1, z = pos.z + (view_range/2)}, {"group:feeder"}) if #nearby_nodes >= 1 then local tpos = nearby_nodes[1] --the first match diff --git a/petz/petz/tarantula_mobkit.lua b/petz/petz/tarantula_mobkit.lua index 3233408..ea33468 100644 --- a/petz/petz/tarantula_mobkit.lua +++ b/petz/petz/tarantula_mobkit.lua @@ -24,7 +24,7 @@ minetest.register_entity("petz:"..pet_name, { attack_player = true, give_orders = false, can_be_brushed = false, - capture_item = nil, + capture_item = "net", follow = petz.settings.tarantula_follow, drops = { {name = "farming:string", chance = 3, min = 1, max = 1,},