your-land/bugtracker#6138 restrict petz spawn locations
This commit is contained in:
parent
04c4aebf26
commit
e06cebf4a4
182
petz.lua
182
petz.lua
@ -1,6 +1,62 @@
|
||||
-- disable petz spawning
|
||||
petz.settings.spawn_interval = math.huge
|
||||
|
||||
local function combine(...)
|
||||
local ts = { ... }
|
||||
local t = {}
|
||||
for i = 1, #ts do
|
||||
for j = 1, #ts[i] do
|
||||
t[#t + 1] = ts[i][j]
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
local grass = {
|
||||
"default:dirt_with_grass",
|
||||
"ethereal:grove_dirt",
|
||||
"ethereal:prairie_dirt",
|
||||
"woodsoils:grass_with_leaves_1",
|
||||
"woodsoils:grass_with_leaves_2",
|
||||
}
|
||||
|
||||
local dry_grass = {
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dry_dirt",
|
||||
"default:dry_dirt_with_dry_grass",
|
||||
}
|
||||
|
||||
local jungle = {
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"ethereal:jungle_dirt",
|
||||
}
|
||||
|
||||
local cold = {
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"ethereal:crystal_dirt",
|
||||
"ethereal:cold_dirt",
|
||||
"ethereal:gray_dirt",
|
||||
}
|
||||
|
||||
local snow = {
|
||||
"default:dirt_with_snow",
|
||||
"default:snowblock",
|
||||
}
|
||||
|
||||
local hot = {
|
||||
"ethereal:dry_dirt",
|
||||
"ethereal:fiery_dirt",
|
||||
"ethereal:mushroom_dirt",
|
||||
}
|
||||
|
||||
local dirt = {
|
||||
"default:dirt",
|
||||
"woodsoils:dirt_with_leaves_1",
|
||||
"woodsoils:dirt_with_leaves_2",
|
||||
}
|
||||
|
||||
local desert = { "group:sand", "default:desert_sandstone", "default:sandstone" }
|
||||
|
||||
spawnit.register({
|
||||
entity_name = "petz:bat",
|
||||
groups = { animal = 1 },
|
||||
@ -37,7 +93,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 3,
|
||||
cluster = 3,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 3,
|
||||
@ -66,7 +122,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 3,
|
||||
cluster = 3,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -81,7 +137,7 @@ spawnit.register({
|
||||
entity_name = "petz:camel",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6,
|
||||
on = { "group:sand", "default:desert_sandstone", "default:sandstone" },
|
||||
on = desert,
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -96,16 +152,14 @@ spawnit.register({
|
||||
entity_name = "petz:chimp",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = {
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"ethereal:jungle_dirt",
|
||||
on = combine(jungle, {
|
||||
"default:jungleleaves",
|
||||
"moretrees:jungletree_leaves_yellow",
|
||||
"moretrees:jungletree_leaves_red",
|
||||
"ethereal:palmleaves",
|
||||
"moretrees:date_palm_leaves",
|
||||
"moretrees:palm_leaves",
|
||||
},
|
||||
}),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 8,
|
||||
@ -125,7 +179,7 @@ spawnit.register({
|
||||
on = { "any" },
|
||||
near = { "group:coral" },
|
||||
min_y = -100,
|
||||
max_y = 5000,
|
||||
max_y = 1,
|
||||
min_node_light = 2,
|
||||
max_in_area = 3,
|
||||
max_any_in_area = 6,
|
||||
@ -139,7 +193,7 @@ spawnit.register({
|
||||
within = { "default:water_source" },
|
||||
on = { "any" },
|
||||
min_y = -100,
|
||||
max_y = 5000,
|
||||
max_y = 1,
|
||||
min_node_light = 2,
|
||||
max_in_area = 1,
|
||||
max_any_in_area = 6,
|
||||
@ -165,14 +219,7 @@ spawnit.register({
|
||||
entity_name = "petz:elephant",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = {
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dry_dirt",
|
||||
"default:dry_dirt_with_dry_grass",
|
||||
"ethereal:dry_dirt",
|
||||
"ethereal:jungle_dirt",
|
||||
},
|
||||
on = combine(dry_grass, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -184,14 +231,7 @@ spawnit.register({
|
||||
entity_name = "petz:elephant_female",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = {
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dry_dirt",
|
||||
"default:dry_dirt_with_dry_grass",
|
||||
"ethereal:dry_dirt",
|
||||
"ethereal:jungle_dirt",
|
||||
},
|
||||
on = combine(dry_grass, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -203,15 +243,10 @@ spawnit.register({
|
||||
entity_name = "petz:flamingo",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.8,
|
||||
on = {
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dry_dirt",
|
||||
"default:dry_dirt_with_dry_grass",
|
||||
},
|
||||
on = hot,
|
||||
near = { "group:water" },
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_y = 15,
|
||||
min_node_light = 12,
|
||||
max_in_area = 2,
|
||||
max_any_in_area = 6,
|
||||
@ -224,7 +259,7 @@ spawnit.register({
|
||||
entity_name = "petz:foxy",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.8 * 2,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass, cold, snow, dirt, { "ethereal:bamboo_dirt" }),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -236,16 +271,8 @@ spawnit.register({
|
||||
entity_name = "petz:frog",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6,
|
||||
on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"ethereal:bamboo_dirt",
|
||||
"ethereal:grove_dirt",
|
||||
"ethereal:jungle_dirt",
|
||||
"ethereal:prairie_dirt",
|
||||
"woodsoils:grass_with_leaves_1",
|
||||
"woodsoils:grass_with_leaves_2",
|
||||
},
|
||||
within = { "default:river_water_source" },
|
||||
on = { "any" },
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 8,
|
||||
@ -260,13 +287,7 @@ spawnit.register({
|
||||
entity_name = "petz:gecko",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.8,
|
||||
on = {
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dry_dirt",
|
||||
"default:dry_dirt_with_dry_grass",
|
||||
},
|
||||
on = jungle,
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -282,7 +303,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 3,
|
||||
cluster = 3,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -297,16 +318,7 @@ spawnit.register({
|
||||
entity_name = "petz:grizzly",
|
||||
groups = { animal = 1, hostile = 1 },
|
||||
chance = yl_spawnit.base_chance * 2,
|
||||
on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"ethereal:bamboo_dirt",
|
||||
"ethereal:grove_dirt",
|
||||
"ethereal:jungle_dirt",
|
||||
"ethereal:prairie_dirt",
|
||||
"woodsoils:grass_with_leaves_1",
|
||||
"woodsoils:grass_with_leaves_2",
|
||||
},
|
||||
on = combine(grass, cold, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -319,7 +331,7 @@ spawnit.register({
|
||||
entity_name = "petz:hamster",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance * 3,
|
||||
on = { "group:sand", "default:desert_sandstone", "default:sandstone" },
|
||||
on = desert,
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 2,
|
||||
@ -331,7 +343,7 @@ spawnit.register({
|
||||
entity_name = "petz:hen",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -346,7 +358,7 @@ spawnit.register({
|
||||
entity_name = "petz:kitty",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 2,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, cold, jungle, desert),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -361,7 +373,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 3,
|
||||
cluster = 3,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -376,7 +388,7 @@ spawnit.register({
|
||||
entity_name = "petz:leopard",
|
||||
groups = { animal = 1, hostile = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = { "default:dirt_with_dry_grass", "default:dry_dirt", "default:dry_dirt_with_dry_grass", "ethereal:dry_dirt" },
|
||||
on = dry_grass,
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -389,7 +401,7 @@ spawnit.register({
|
||||
entity_name = "petz:lion",
|
||||
groups = { animal = 1, hostile = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = { "default:dirt_with_dry_grass", "default:dry_dirt", "default:dry_dirt_with_dry_grass", "ethereal:dry_dirt" },
|
||||
on = dry_grass,
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -499,7 +511,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 3,
|
||||
cluster = 3,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 3,
|
||||
@ -525,7 +537,7 @@ spawnit.register({
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6 * 5,
|
||||
cluster = 5,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -540,7 +552,7 @@ spawnit.register({
|
||||
entity_name = "petz:puppy",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.6,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
min_node_light = 12,
|
||||
@ -555,7 +567,7 @@ spawnit.register({
|
||||
entity_name = "petz:queen_ant",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance / 0.4,
|
||||
on = { "group:soil" },
|
||||
on = combine(grass, dry_grass, jungle),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -613,7 +625,27 @@ spawnit.register({
|
||||
entity_name = "petz:silkworm",
|
||||
groups = { animal = 1 },
|
||||
chance = yl_spawnit.base_chance * 3,
|
||||
on = { "group:leaves" },
|
||||
on = {
|
||||
"default:acacia_bush_leaves",
|
||||
"default:acacia_leaves",
|
||||
"mahogany:leaves",
|
||||
"moretrees:apple_tree_leaves",
|
||||
"moretrees:beech_leaves",
|
||||
"moretrees:birch_leaves",
|
||||
"moretrees:cedar_leaves",
|
||||
"moretrees:date_palm_leaves",
|
||||
"moretrees:fir_leaves",
|
||||
"moretrees:fir_leaves_bright",
|
||||
"moretrees:jungletree_leaves_red",
|
||||
"moretrees:jungletree_leaves_yellow",
|
||||
"moretrees:oak_leaves",
|
||||
"moretrees:palm_leaves",
|
||||
"moretrees:poplar_leaves",
|
||||
"moretrees:rubber_tree_leaves",
|
||||
"moretrees:sequoia_leaves",
|
||||
"moretrees:spruce_leaves",
|
||||
"moretrees:willow_leaves",
|
||||
},
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -625,7 +657,7 @@ spawnit.register({
|
||||
entity_name = "petz:snow_leopard",
|
||||
groups = { animal = 1, hostile = 1 },
|
||||
chance = yl_spawnit.base_chance,
|
||||
on = { "default:snowblock", "default:ice", "default:dirt_with_snow", "default:snow" },
|
||||
on = { "default:dirt_with_snow", "default:snow" },
|
||||
min_y = 20,
|
||||
max_y = 5000,
|
||||
max_in_area = 1,
|
||||
@ -731,7 +763,7 @@ spawnit.register({
|
||||
groups = { animal = 1, hostile = 1 },
|
||||
chance = yl_spawnit.base_chance * 4,
|
||||
cluster = 4,
|
||||
on = { "group:soil" },
|
||||
on = combine(cold, grass),
|
||||
min_y = 0,
|
||||
max_y = 5000,
|
||||
max_in_area = 4,
|
||||
|
Loading…
Reference in New Issue
Block a user