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 --- chicken.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'chicken.lua') diff --git a/chicken.lua b/chicken.lua index ad2f722..11cc4b7 100644 --- a/chicken.lua +++ b/chicken.lua @@ -1,6 +1,7 @@ local S = mobs.intllib + -- Chicken by JK Murray mobs:register_mob("mobs_animal:chicken", { @@ -79,9 +80,16 @@ mobs:register_mob("mobs_animal:chicken", { end, }) + +local spawn_on = "default:dirt_with_grass" + +if minetest.get_modpath("ethereal") then + spawn_on = "ethereal:bamboo_dirt" +end + mobs:spawn({ name = "mobs_animal:chicken", - nodes = {"default:dirt_with_grass", "ethereal:bamboo_dirt"}, + nodes = {spawn_on}, min_light = 10, chance = 15000, active_object_count = 2, @@ -89,10 +97,12 @@ mobs:spawn({ day_toggle = true, }) + mobs:register_egg("mobs_animal:chicken", S("Chicken"), "mobs_chicken_inv.png", 0) --- compatibility -mobs:alias_mob("mobs:chicken", "mobs_animal:chicken") + +mobs:alias_mob("mobs:chicken", "mobs_animal:chicken") -- compatibility + -- egg entity @@ -158,6 +168,7 @@ mobs:register_arrow("mobs_animal:egg_entity", { end }) + -- egg throwing item local egg_GRAVITY = 9 @@ -207,6 +218,7 @@ local mobs_shoot_egg = function (item, player, pointed_thing) return item end + -- egg minetest.register_node(":mobs:egg", { description = S("Chicken Egg"), @@ -232,6 +244,7 @@ minetest.register_node(":mobs:egg", { on_use = mobs_shoot_egg }) + -- fried egg minetest.register_craftitem(":mobs:chicken_egg_fried", { description = S("Fried Egg"), -- cgit v1.2.3