summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-02-21 15:23:03 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-02-21 15:23:03 +0000
commitf7b9339dfc61f5f8b92acc031f797f788d901941 (patch)
tree240d3cdbf1fe1ebe9102f6cf29b5e94faff76b07
parent08924ee1a3c575e8645d0158738cf96758cbb4d7 (diff)
animals spawn on different grasses if ethereal detected
-rw-r--r--bee.lua3
-rw-r--r--bunny.lua17
-rw-r--r--chicken.lua19
-rw-r--r--cow.lua16
-rw-r--r--kitten.lua15
-rw-r--r--penguin.lua3
-rw-r--r--rat.lua8
-rw-r--r--sheep.lua17
-rw-r--r--warthog.lua16
9 files changed, 90 insertions, 24 deletions
diff --git a/bee.lua b/bee.lua
index ce9709d..bb68035 100644
--- a/bee.lua
+++ b/bee.lua
@@ -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?
diff --git a/bunny.lua b/bunny.lua
index e2de354..1c882cd 100644
--- a/bunny.lua
+++ b/bunny.lua
@@ -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
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"),
diff --git a/cow.lua b/cow.lua
index 301a5f1..bf41a3d 100644
--- a/cow.lua
+++ b/cow.lua
@@ -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", {
diff --git a/kitten.lua b/kitten.lua
index 08b86d2..59e057a 100644
--- a/kitten.lua
+++ b/kitten.lua
@@ -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
diff --git a/penguin.lua b/penguin.lua
index f840083..b7748ed 100644
--- a/penguin.lua
+++ b/penguin.lua
@@ -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)
diff --git a/rat.lua b/rat.lua
index 47dccdf..3320d53 100644
--- a/rat.lua
+++ b/rat.lua
@@ -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", {
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
diff --git a/warthog.lua b/warthog.lua
index 75c0713..436e468 100644
--- a/warthog.lua
+++ b/warthog.lua
@@ -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", {