mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2025-02-18 21:20:19 +01:00
add mobs_animal.eat_grass_block setting
This commit is contained in:
parent
b8dade7498
commit
8d5fb34534
14
cow.lua
14
cow.lua
@ -1,6 +1,15 @@
|
|||||||
|
|
||||||
local S = minetest.get_translator("mobs_animal")
|
local S = minetest.get_translator("mobs_animal")
|
||||||
|
|
||||||
|
-- should cows eat grass blocks and mess up the environment?
|
||||||
|
|
||||||
|
local eat_gb = minetest.settings:get_bool("mobs_animal.eat_grass_block") ~= false
|
||||||
|
local replace_what = { {"group:grass", "air", 0} }
|
||||||
|
|
||||||
|
if eat_gb then
|
||||||
|
table.insert(replace_what, {"default:dirt_with_grass", "default:dirt", -1})
|
||||||
|
end
|
||||||
|
|
||||||
-- Cow by sirrobzeroone
|
-- Cow by sirrobzeroone
|
||||||
|
|
||||||
mobs:register_mob("mobs_animal:cow", {
|
mobs:register_mob("mobs_animal:cow", {
|
||||||
@ -51,10 +60,7 @@ mobs:register_mob("mobs_animal:cow", {
|
|||||||
},
|
},
|
||||||
view_range = 8,
|
view_range = 8,
|
||||||
replace_rate = 10,
|
replace_rate = 10,
|
||||||
replace_what = {
|
replace_what = replace_what,
|
||||||
{"group:grass", "air", 0},
|
|
||||||
{"default:dirt_with_grass", "default:dirt", -1}
|
|
||||||
},
|
|
||||||
--[[
|
--[[
|
||||||
pick_up = {"default:grass_1", "default:dry_grass_1"},
|
pick_up = {"default:grass_1", "default:dry_grass_1"},
|
||||||
on_pick_up = function(self, entity)
|
on_pick_up = function(self, entity)
|
||||||
|
@ -9,3 +9,5 @@ mobs_animal.rat (Enable Rat) bool true
|
|||||||
mobs_animal.sheep (Enable Sheep) bool true
|
mobs_animal.sheep (Enable Sheep) bool true
|
||||||
mobs_animal.warthog (Enable Warthog) bool true
|
mobs_animal.warthog (Enable Warthog) bool true
|
||||||
mobs_animal.hairball (Enable Kitten Hairball drops) bool true
|
mobs_animal.hairball (Enable Kitten Hairball drops) bool true
|
||||||
|
|
||||||
|
mobs_animal.eat_grass_block (Enable Cow/Sheep eating grass blocks) bool true
|
||||||
|
14
sheep.lua
14
sheep.lua
@ -4,6 +4,15 @@
|
|||||||
local S = minetest.get_translator("mobs_animal")
|
local S = minetest.get_translator("mobs_animal")
|
||||||
local random = math.random
|
local random = math.random
|
||||||
|
|
||||||
|
-- should sheep eat grass blocks and mess up the environment?
|
||||||
|
|
||||||
|
local eat_gb = minetest.settings:get_bool("mobs_animal.eat_grass_block") ~= false
|
||||||
|
local replace_what = { {"group:grass", "air", -1} }
|
||||||
|
|
||||||
|
if eat_gb then
|
||||||
|
table.insert(replace_what, {"default:dirt_with_grass", "default:dirt", -2})
|
||||||
|
end
|
||||||
|
|
||||||
-- sheep colour table
|
-- sheep colour table
|
||||||
|
|
||||||
local all_colours = {
|
local all_colours = {
|
||||||
@ -115,10 +124,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
},
|
},
|
||||||
view_range = 8,
|
view_range = 8,
|
||||||
replace_rate = 10,
|
replace_rate = 10,
|
||||||
replace_what = {
|
replace_what = replace_what,
|
||||||
{"group:grass", "air", -1},
|
|
||||||
{"default:dirt_with_grass", "default:dirt", -2}
|
|
||||||
},
|
|
||||||
fear_height = 3,
|
fear_height = 3,
|
||||||
|
|
||||||
on_replace = function(self, pos, oldnode, newnode)
|
on_replace = function(self, pos, oldnode, newnode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user