1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-12-22 17:00:26 +01:00

animals spawn on different grasses if ethereal detected

This commit is contained in:
TenPlus1 2017-02-21 15:23:03 +00:00
parent 08924ee1a3
commit f7b9339dfc
9 changed files with 90 additions and 24 deletions

View File

@ -66,7 +66,6 @@ minetest.register_craftitem(":mobs:honey", {
minetest.register_node(":mobs:beehive", {
description = S("Beehive"),
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"mobs_beehive.png"},
inventory_image = "mobs_beehive.png",
paramtype = "light",
@ -175,7 +174,7 @@ minetest.register_abm({
-- is hive full?
local meta = minetest.get_meta(pos)
if not meta then return end -- for older beehives
local inv = minetest.get_meta(pos):get_inventory()
local inv = meta:get_inventory()
local honey = inv:get_stack("beehive", 1):get_count()
-- is hive full?

View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Bunny by ExeterDad
mobs:register_mob("mobs_animal:bunny", {
@ -68,7 +69,7 @@ mobs:register_mob("mobs_animal:bunny", {
})
self.type = "monster"
self.object:set_hp(20)
self.health = 20
return
end
@ -81,16 +82,24 @@ mobs:register_mob("mobs_animal:bunny", {
damage = 5,
})
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:prairie_dirt"
end
mobs:spawn({
name = "mobs_animal:bunny",
nodes = {"default:dirt_with_grass", "ethereal:prairie_dirt"},
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg("mobs_animal:bunny", S("Bunny"), "mobs_bunny_inv.png", 0)
-- compatibility
mobs:alias_mob("mobs:bunny", "mobs_animal:bunny")
mobs:alias_mob("mobs:bunny", "mobs_animal:bunny") -- compatibility

View File

@ -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"),

16
cow.lua
View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Cow by Krupnovpavel (additional texture by JurajVajda)
mobs:register_mob("mobs_animal:cow", {
@ -97,9 +98,16 @@ mobs:register_mob("mobs_animal:cow", {
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:cow",
nodes = {"default:dirt_with_grass", "ethereal:green_dirt"},
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
@ -107,10 +115,12 @@ mobs:spawn({
day_toggle = true,
})
mobs:register_egg("mobs_animal:cow", S("Cow"), "default_grass.png", 1)
-- compatibility
mobs:alias_mob("mobs:cow", "mobs_animal:cow")
mobs:alias_mob("mobs:cow", "mobs_animal:cow") -- compatibility
-- bucket of milk
minetest.register_craftitem(":mobs:bucket_milk", {

View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Kitten by Jordach / BFD
mobs:register_mob("mobs_animal:kitten", {
@ -53,9 +54,16 @@ mobs:register_mob("mobs_animal:kitten", {
end
})
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:grove_dirt"
end
mobs:spawn({
name = "mobs_animal:kitten",
nodes = {"default:dirt_with_grass", "ethereal:grove_dirt"},
nodes = {spawn_on},
min_light = 12,
chance = 22000,
min_height = 0,
@ -63,7 +71,8 @@ mobs:spawn({
day_toggle = true,
})
mobs:register_egg("mobs_animal:kitten", S("Kitten"), "mobs_kitten_inv.png", 0)
-- compatibility
mobs:alias_mob("mobs:kitten", "mobs_animal:kitten")
mobs:alias_mob("mobs:kitten", "mobs_animal:kitten") -- compatibility

View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Penguin by D00Med
mobs:register_mob("mobs_animal:penguin", {
@ -58,6 +59,7 @@ mobs:register_mob("mobs_animal:penguin", {
end,
})
mobs:spawn({
name = "mobs_animal:penguin",
nodes = {"default:snowblock"},
@ -67,4 +69,5 @@ mobs:spawn({
day_toggle = true,
})
mobs:register_egg("mobs_animal:penguin", S("Penguin"), "default_snow.png", 1)

View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Rat by PilzAdam
mobs:register_mob("mobs_animal:rat", {
@ -57,6 +58,7 @@ mobs:register_mob("mobs_animal:rat", {
]]
})
local function rat_spawn(self, pos)
print (self:get_luaentity().name, pos.x, pos.y, pos.z)
end
@ -70,10 +72,12 @@ mobs:spawn({
-- on_spawn = rat_spawn,
})
mobs:register_egg("mobs_animal:rat", S("Rat"), "mobs_rat_inventory.png", 0)
-- compatibility
mobs:alias_mob("mobs:rat", "mobs_animal:rat")
mobs:alias_mob("mobs:rat", "mobs_animal:rat") -- compatibility
-- cooked rat, yummy!
minetest.register_craftitem(":mobs:rat_cooked", {

View File

@ -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

View File

@ -1,6 +1,7 @@
local S = mobs.intllib
-- Warthog by KrupnoPavel
mobs:register_mob("mobs_animal:pumba", {
@ -56,9 +57,16 @@ mobs:register_mob("mobs_animal:pumba", {
end,
})
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:mushroom_dirt"
end
mobs:spawn({
name = "mobs_animal:pumba",
nodes = {"default:dirt_with_dry_grass", "ethereal:mushroom_dirt"},
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
@ -66,10 +74,12 @@ mobs:spawn({
day_toggle = true,
})
mobs:register_egg("mobs_animal:pumba", S("Warthog"), "wool_pink.png", 1)
-- compatibility
mobs:alias_mob("mobs:pumba", "mobs_animal:pumba")
mobs:alias_mob("mobs:pumba", "mobs_animal:pumba") -- compatibility
-- raw porkchop
minetest.register_craftitem(":mobs:pork_raw", {