summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-04-16 09:58:53 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-04-16 09:58:53 +0100
commita80b8dc3b0b285d54a71dc15bf80bbf75e421857 (patch)
tree29bbad0c7fd5d651a3557aee2048d4dc52c3a541 /api.lua
parent3e05bc7ec0588e6ddab0fd852864fe0cf198ab70 (diff)
added punch_capabilities error check
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index 1942163..b02177b 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
--- Mobs Api (15th April 2016)
+-- Mobs Api (16th April 2016)
mobs = {}
mobs.mod = "redo"
@@ -416,7 +416,7 @@ do_env_damage = function(self)
check_for_death(self)
end
--- jump if facing a solid node (not fences)
+-- jump if facing a solid node (not fences or gates)
do_jump = function(self)
if self.fly
@@ -549,6 +549,7 @@ function follow_holding(self, clicker)
return false
end
+-- find two animals of same type and breed if nearby and horny
local function breed(self)
-- child take 240 seconds before growing into adult
@@ -682,6 +683,7 @@ local function breed(self)
end
end
+-- find and replace what mob is looking for (grass, wheat etc.)
function replace(self, pos)
if self.replace_rate
@@ -1702,7 +1704,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
tflp = 0.2
end
- for group,_ in pairs(tool_capabilities.damage_groups) do
+ for group,_ in pairs( (tool_capabilities.damage_groups or {}) ) do
tmp = tflp / (tool_capabilities.full_punch_interval or 1.4)