From 542cb3d474fbb1dd85a1032ca974ed1b767c0d9b Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 21 Jul 2016 11:21:26 +0100 Subject: [PATCH] re-enabled catch-up to spawn more mobs --- api.lua | 16 +++++----------- readme.MD | 8 ++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/api.lua b/api.lua index 7c80664..45ab5d7 100644 --- a/api.lua +++ b/api.lua @@ -1,5 +1,5 @@ --- Mobs Api (18th June 2016) +-- Mobs Api (21st July 2016) mobs = {} mobs.mod = "redo" @@ -82,9 +82,7 @@ end set_velocity = function(self, v) - v = v or 0 - - local yaw = (self.object:getyaw() + self.rotate) or 0 + local yaw = self.object:getyaw() + self.rotate or 0 self.object:setvelocity({ x = sin(yaw) * -v, @@ -382,7 +380,7 @@ end -- is mob facing a cliff local function is_at_cliff(self) - if self.fear_height == 0 then -- if 0, no falling protection! + if self.fear_height == 0 then -- 0 for no falling protection! return false end @@ -544,8 +542,6 @@ do_jump = function(self) local v = self.object:getvelocity() v.y = self.jump_height + 1 - v.x = v.x * 2.2 - v.z = v.z * 2.2 self.object:setvelocity(v) @@ -1021,7 +1017,6 @@ local monster_attack = function(self) -- field of view check goes here -- choose closest player to attack - --if minetest.line_of_sight(sp, p, 2) == true if line_of_sight_water(self, sp, p, 2) == true and dist < min_dist then min_dist = dist @@ -1662,7 +1657,6 @@ local do_states = function(self, dtime) p2.y = p2.y + 1.5 s2.y = s2.y + 1.5 - --if minetest.line_of_sight(p2, s2) == true then if line_of_sight_water(self, p2, s2) == true then -- play attack sound @@ -2270,7 +2264,7 @@ minetest.register_entity(name, { fall_damage = def.fall_damage or 1, fall_speed = def.fall_speed or -10, -- must be lower than -2 (default: -10) drops = def.drops or {}, - armor = def.armor, + armor = def.armor or 100, on_rightclick = def.on_rightclick, arrow = def.arrow, shoot_interval = def.shoot_interval, @@ -2402,7 +2396,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, neighbors = neighbors, interval = interval, chance = chance, - catch_up = false, + catch_up = true, action = function(pos, node, aoc, active_object_count_wider) diff --git a/readme.MD b/readme.MD index b9baa92..22459e3 100644 --- a/readme.MD +++ b/readme.MD @@ -10,6 +10,14 @@ This mod contains the API only for adding your own mobs into the world, so pleas https://forum.minetest.net/viewtopic.php?f=11&t=9917 +Crafts: + + - Nametag (paper, black dye, string) can be used right-click on a tamed mob to give them a name. + - Nets can be used to right-click tamed mobs to pick them up and place inside inventory as a spawn egg. + - Magic Lasso is similar to nets but with a better chance of picking up larger mobs. + - Shears are used to right-click sheep and return 1-3 wool. + + Changelog: - 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code