summaryrefslogtreecommitdiff
path: root/sheep.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-04-15 15:23:37 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-04-15 15:23:37 +0100
commit06a3483ca24ca8a14af01fcf21356972f3d83418 (patch)
tree9a5409c7508f90cbbe97f4bbb7d47092564f657a /sheep.lua
parent654c54075a9304333f4636abaa58d0eb8c35b78a (diff)
Added compatibility with mobs already spawned in world
Diffstat (limited to 'sheep.lua')
-rw-r--r--sheep.lua19
1 files changed, 4 insertions, 15 deletions
diff --git a/sheep.lua b/sheep.lua
index b0e740f..cd2fe8d 100644
--- a/sheep.lua
+++ b/sheep.lua
@@ -170,25 +170,14 @@ for _, col in pairs(all_colours) do
mobs:register_egg("mobs_animal:sheep_"..col[1], col[2] .. " Sheep", "wool_"..col[1]..".png", 1)
- minetest.register_alias("mobs:sheep_"..col[1], "mobs_animal:sheep_"..col[1])
+ -- compatibility
+ mobs:alias_mob("mobs:sheep_" .. col[1], "mobs_animal:sheep_" .. col[1])
end
mobs:register_spawn("mobs_animal:sheep_white",
{"default:dirt_with_grass", "ethereal:green_dirt"}, 20, 10, 15000, 1, 31000, true)
--- compatibility (item and entity)
-minetest.register_alias("mobs:sheep", "mobs:sheep_white")
---[[
--- replace old sheep entity with new white sheep
-minetest.register_entity("mobs:sheep", {
-
- on_activate = function(self, staticdata, dtime_s)
-
- self.object:remove()
-
- minetest.add_entity(self.object:getpos(), "mobs_animal:sheep_white")
- end
-})
-]]
+-- compatibility
+mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white")