diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-15 15:22:30 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-15 15:22:30 +0100 |
commit | f76acdf724e5044c1d039ce50132ccab3fee61cb (patch) | |
tree | b75d11faa5c8041b3650b8ab4be82cf44c5a9504 /api.lua | |
parent | 4921956b60ee0c90947b230b9e304045f33b54b7 (diff) |
Added compatibility function (thanks Amaz)
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -2812,3 +2812,25 @@ minetest.override_item("default:chest", { end, }) + +-- compatibility function for old entities to new modpack entities +function mobs:alias_mob(old_name, new_name) + + -- spawn egg + minetest.register_alias(old_name, new_name) + + -- entity + minetest.register_entity(":" .. old_name, { + + physical = false, + + on_step = function(self) + + local pos = self.object:getpos() + + minetest.add_entity(pos, new_name) + + self.object:remove() + end + }) +end |