Fixed old mobs:sheep compatibility, right-click to pick up sheep with X and replace

This commit is contained in:
TenPlus1 2015-08-09 18:25:40 +01:00
parent 37de66ad0a
commit 4615b35a82
3 changed files with 23 additions and 2 deletions

View File

@ -28,6 +28,7 @@ This mod contains the following additions:
Changelog:
1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility.
1.14- All .self variables saved in staticdata, Fixed self.health bug
1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
1.12- Added animal ownership so that players cannot steal your tamed animals

View File

@ -135,5 +135,25 @@ end
mobs:register_spawn("mobs:sheep_white", {"default:dirt_with_grass", "ethereal:green_dirt"}, 20, 10, 15000, 1, 31000)
-- compatibility
minetest.register_alias("mobs:sheep", "mobs:sheep_white")
-- compatibility (item and entity)
minetest.register_alias("mobs:sheep", "mobs:sheep_white")
minetest.register_entity("mobs:sheep", {
hp_max = 1,
physical = true,
collide_with_objects = true,
visual = "mesh",
mesh = "mobs_sheep.b3d",
visual_size = {x = 1, y = 1},
textures = {"mobs_sheep.png"},
velocity = {x = 0, y = 0, z = 0},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
is_visible = true,
speed = 0,
on_rightclick = function(self, clicker)
clicker:get_inventory():add_item("main", "mobs:sheep_white")
self.object:remove()
end,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 870 B