diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-09-15 15:27:56 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-09-15 15:27:56 +0100 |
commit | 34ed37cf82dfcaa0b9219cdd3328f247f770fc4f (patch) | |
tree | 594b713ccd19b1e49d577300076b0f2d67fe8f13 | |
parent | 56b201d326b3182626e62579c424aeeb1f6f902d (diff) |
bunny colour can depend on block spawned
-rw-r--r-- | bunny.lua | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -78,14 +78,21 @@ mobs:register_mob("mobs_animal:bunny", { local pos = self.object:getpos() ; pos.y = pos.y - 1 - -- snow bunny - if minetest.find_node_near(pos, 2, {"default:snow", "default:snowblock"}) then + -- white snowy bunny + if minetest.find_node_near(pos, 1, + {"default:snow", "default:snowblock", "default:dirt_with_snow"}) then self.base_texture = {"mobs_bunny_white.png"} self.object:set_properties({textures = self.base_texture}) - -- desert bunny - elseif minetest.find_node_near(pos, 2, {"default:desert_sand", "default:desert_stone"}) then + -- brown desert bunny + elseif minetest.find_node_near(pos, 1, + {"default:desert_sand", "default:desert_stone"}) then self.base_texture = {"mobs_bunny_brown.png"} self.object:set_properties({textures = self.base_texture}) + -- grey stone bunny + elseif minetest.find_node_near(pos, 1, + {"default:stone", "default:gravel"}) then + self.base_texture = {"mobs_bunny_grey.png"} + self.object:set_properties({textures = self.base_texture}) end return true -- run only once, false/nil runs every activation |