summaryrefslogtreecommitdiff
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
parent654c54075a9304333f4636abaa58d0eb8c35b78a (diff)
Added compatibility with mobs already spawned in world
-rw-r--r--bee.lua3
-rw-r--r--bunny.lua3
-rw-r--r--chicken.lua3
-rw-r--r--cow.lua3
-rw-r--r--kitten.lua3
-rw-r--r--rat.lua3
-rw-r--r--sheep.lua19
-rw-r--r--warthog.lua3
8 files changed, 18 insertions, 22 deletions
diff --git a/bee.lua b/bee.lua
index 039765e..ee4e99e 100644
--- a/bee.lua
+++ b/bee.lua
@@ -43,7 +43,8 @@ mobs:register_spawn("mobs_animal:bee", {"group:flower"}, 20, 10, 9000, 1, 31000,
mobs:register_egg("mobs_animal:bee", "Bee", "mobs_bee_inv.png", 0)
-minetest.register_alias("mobs:bee", "mobs_animal:bee")
+-- compatibility
+mobs:alias_mob("mobs:bee", "mobs_animal:bee")
-- honey
minetest.register_craftitem(":mobs:honey", {
diff --git a/bunny.lua b/bunny.lua
index 2b25ec6..d1519a5 100644
--- a/bunny.lua
+++ b/bunny.lua
@@ -83,4 +83,5 @@ mobs:register_spawn("mobs_animal:bunny",
mobs:register_egg("mobs_animal:bunny", "Bunny", "mobs_bunny_inv.png", 0)
-minetest.register_alias("mobs:bunny", "mobs_animal:bunny")
+-- compatibility
+mobs:alias_mob("mobs:bunny", "mobs_animal:bunny")
diff --git a/chicken.lua b/chicken.lua
index f5a58bd..716dbeb 100644
--- a/chicken.lua
+++ b/chicken.lua
@@ -80,7 +80,8 @@ mobs:register_spawn("mobs_animal:chicken",
mobs:register_egg("mobs_animal:chicken", "Chicken", "mobs_chicken_inv.png", 0)
-minetest.register_alias("mobs:chicken", "mobs_animal:chicken")
+-- compatibility
+mobs:alias_mob("mobs:chicken", "mobs_animal:chicken")
-- egg entity
diff --git a/cow.lua b/cow.lua
index ff3ed7c..6c43938 100644
--- a/cow.lua
+++ b/cow.lua
@@ -98,7 +98,8 @@ mobs:register_spawn("mobs_animal:cow",
mobs:register_egg("mobs_animal:cow", "Cow", "default_grass.png", 1)
-minetest.register_alias("mobs:cow", "mobs_animal:cow")
+-- compatibility
+mobs:alias_mob("mobs:cow", "mobs_animal:cow")
-- bucket of milk
minetest.register_craftitem(":mobs:bucket_milk", {
diff --git a/kitten.lua b/kitten.lua
index 6f17cd1..cf75451 100644
--- a/kitten.lua
+++ b/kitten.lua
@@ -55,4 +55,5 @@ mobs:register_spawn("mobs_animal:kitten",
mobs:register_egg("mobs_animal:kitten", "Kitten", "mobs_kitten_inv.png", 0)
-minetest.register_alias("mobs:kitten", "mobs_animal:kitten")
+-- compatibility
+mobs:alias_mob("mobs:kitten", "mobs_animal:kitten")
diff --git a/rat.lua b/rat.lua
index 987d219..fc9e604 100644
--- a/rat.lua
+++ b/rat.lua
@@ -41,7 +41,8 @@ mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
mobs:register_egg("mobs_animal:rat", "Rat", "mobs_rat_inventory.png", 0)
-minetest.register_alias("mobs:rat", "mobs_animal:rat")
+-- compatibility
+mobs:alias_mob("mobs:rat", "mobs_animal:rat")
-- cooked rat, yummy!
minetest.register_craftitem(":mobs:rat_cooked", {
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")
diff --git a/warthog.lua b/warthog.lua
index 8988341..043cb42 100644
--- a/warthog.lua
+++ b/warthog.lua
@@ -58,7 +58,8 @@ mobs:register_spawn("mobs_animal:pumba",
mobs:register_egg("mobs_animal:pumba", "Warthog", "wool_pink.png", 1)
-minetest.register_alias("mobs:pumba", "mobs_animal:pumba")
+-- compatibility
+mobs:alias_mob("mobs:pumba", "mobs_animal:pumba")
-- raw porkchop
minetest.register_craftitem(":mobs:pork_raw", {