From f7b9339dfc61f5f8b92acc031f797f788d901941 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 21 Feb 2017 15:23:03 +0000 Subject: animals spawn on different grasses if ethereal detected --- sheep.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sheep.lua') diff --git a/sheep.lua b/sheep.lua index 20ce8e0..8637ef7 100644 --- a/sheep.lua +++ b/sheep.lua @@ -1,6 +1,7 @@ local S = mobs.intllib + local all_colours = { {"black", S("Black"), "#000000b0"}, {"blue", S("Blue"), "#015dbb70"}, @@ -19,9 +20,10 @@ local all_colours = { {"yellow", S("Yellow"), "#e3ff0070"}, } + -- Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack -for _, col in pairs(all_colours) do +for _, col in ipairs(all_colours) do mobs:register_mob("mobs_animal:sheep_"..col[1], { type = "animal", @@ -180,9 +182,16 @@ for _, col in pairs(all_colours) do end + +local spawn_on = "default:dirt_with_grass" + +if minetest.get_modpath("ethereal") then + spawn_on = "ethereal:green_dirt" +end + mobs:spawn({ name = "mobs_animal:sheep_white", - nodes = {"default:dirt_with_grass", "ethereal:green_dirt"}, + nodes = {spawn_on}, min_light = 10, chance = 15000, min_height = 0, @@ -190,5 +199,5 @@ mobs:spawn({ day_toggle = true, }) --- compatibility -mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white") + +mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white") -- compatibility -- cgit v1.2.3