diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index e26eb4f3..149a0f74 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1,4 +1,4 @@ --- Mobs Api (9th September 2015) +-- Mobs Api (17th September 2015) mobs = {} mobs.mod = "redo" @@ -236,7 +236,7 @@ function mobs:register_mob(name, def) if v.y > 0.1 then self.object:setacceleration({ x = 0, - y= self.fall_speed, + y = self.fall_speed, z = 0 }) end @@ -347,7 +347,7 @@ function mobs:register_mob(name, def) if self.jumptimer < 3 then local pos = self.object:getpos() pos.y = (pos.y + self.collisionbox[2]) - 0.2 - local nod = minetest.get_node(pos) + local nod = minetest.get_node_or_nil(pos) --print ("standing on:", nod.name, pos.y) if not nod or not minetest.registered_nodes[nod.name] @@ -355,7 +355,7 @@ function mobs:register_mob(name, def) return end if self.direction then - pos.y = pos.y + 0.5 + pos.y = pos.y + 0.5 local nod = minetest.get_node_or_nil({ x = pos.x + self.direction.x, y = pos.y, diff --git a/mods/mobs/bunny.lua b/mods/mobs/bunny.lua index 3a10aaa6..e76f4106 100755 --- a/mods/mobs/bunny.lua +++ b/mods/mobs/bunny.lua @@ -50,7 +50,7 @@ mobs:register_mob("mobs:bunny", { replace_with = "air", -- right click to pick up rabbit on_rightclick = function(self, clicker) - if not mobs:feed_tame(self, clicker, 4, true) then + if not mobs:feed_tame(self, clicker, 4, true, true) then -- Monty Python tribute local item = clicker:get_wielded_item() if item:get_name() == "mobs:lava_orb" then diff --git a/mods/mobs/chicken.lua b/mods/mobs/chicken.lua index a8cb9606..67ff3c6e 100755 --- a/mods/mobs/chicken.lua +++ b/mods/mobs/chicken.lua @@ -58,7 +58,7 @@ mobs:register_mob("mobs:chicken", { replace_what = {"air"}, replace_with = "mobs:egg", on_rightclick = function(self, clicker) - mobs:feed_tame(self, clicker, 8, true) + mobs:feed_tame(self, clicker, 8, true, true) mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) end, }) diff --git a/mods/mobs/cow.lua b/mods/mobs/cow.lua index 7b692bf0..1284ca42 100755 --- a/mods/mobs/cow.lua +++ b/mods/mobs/cow.lua @@ -59,7 +59,7 @@ mobs:register_mob("mobs:cow", { replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"}, replace_with = "air", on_rightclick = function(self, clicker) - if not mobs:feed_tame(self, clicker, 8, true) then + if not mobs:feed_tame(self, clicker, 8, true, true) then local tool = clicker:get_wielded_item() -- milk cow with empty bucket diff --git a/mods/mobs/kitten.lua b/mods/mobs/kitten.lua index b5d110d2..b1f9e290 100755 --- a/mods/mobs/kitten.lua +++ b/mods/mobs/kitten.lua @@ -47,9 +47,9 @@ mobs:register_mob("mobs:kitten", { view_range = 10, -- feed with raw fish to tame or right click to pick up on_rightclick = function(self, clicker) - mobs:feed_tame(self, clicker, 4, true) + mobs:feed_tame(self, clicker, 4, true, true) mobs:capture_mob(self, clicker, 50, 50, 90, false, nil) end }) mobs:spawn_specific("mobs:kitten", {"default:dirt_with_grass"}, {"air"}, 0, 20, 30, 10000, 1, -31000, 31000, true) -mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0) \ No newline at end of file +mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0) diff --git a/mods/mobs/npc.lua b/mods/mobs/npc.lua index 3c36a674..247b3796 100755 --- a/mods/mobs/npc.lua +++ b/mods/mobs/npc.lua @@ -91,7 +91,7 @@ mobs:register_mob("mobs:npc", { end return -- feed to heal npc - elseif not mobs:feed_tame(self, clicker, 8, true) then + elseif not mobs:feed_tame(self, clicker, 8, true, true) then -- right clicking with gold lump drops random item from mobs.npc_drops if item:get_name() == "default:gold_lump" then if not minetest.setting_getbool("creative_mode") then diff --git a/mods/mobs/npc_female.lua b/mods/mobs/npc_female.lua index 31b6985c..e1190a5e 100755 --- a/mods/mobs/npc_female.lua +++ b/mods/mobs/npc_female.lua @@ -95,7 +95,7 @@ mobs:register_mob("mobs:npc_female", { end return -- feed to heal npc - elseif not mobs:feed_tame(self, clicker, 8, true) then + elseif not mobs:feed_tame(self, clicker, 8, true, true) then -- right clicking with gold lump drops random item from mobs.npc_drops if item:get_name() == "default:gold_lump" then if not minetest.setting_getbool("creative_mode") then diff --git a/mods/mobs/sheep.lua b/mods/mobs/sheep.lua index d9bc3c38..ba21bd7d 100755 --- a/mods/mobs/sheep.lua +++ b/mods/mobs/sheep.lua @@ -68,7 +68,7 @@ for _, col in ipairs(all_colours) do end --are we feeding? - if mobs:feed_tame(self, clicker, 8, true) then + if mobs:feed_tame(self, clicker, 8, true, true) then --if full grow fuzz if self.gotten == false then self.object:set_properties({ diff --git a/mods/mobs/warthog.lua b/mods/mobs/warthog.lua index fe6c9d4b..a5f24765 100755 --- a/mods/mobs/warthog.lua +++ b/mods/mobs/warthog.lua @@ -55,7 +55,7 @@ mobs:register_mob("mobs:pumba", { }, -- can be tamed by feeding 8 wheat (will not attack when tamed) on_rightclick = function(self, clicker) - mobs:feed_tame(self, clicker, 8, true) + mobs:feed_tame(self, clicker, 8, true, true) mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) end, }) @@ -83,4 +83,4 @@ minetest.register_craft({ output = "mobs:pork_cooked", recipe = "mobs:pork_raw", cooktime = 5, -}) \ No newline at end of file +})