mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-03-15 04:11:25 +00:00
Fix some stuff
This commit is contained in:
parent
8408a73851
commit
20a59ddd30
4 changed files with 45 additions and 37 deletions
|
@ -13,7 +13,7 @@ local function table_contains(tbl, val)
|
|||
return false
|
||||
end
|
||||
|
||||
local common_spawn_chance = tonumber(minetest.settings:get("animalia_common_chance")) or 45000
|
||||
local common_spawn_chance = tonumber(minetest.settings:get("animalia_common_chance")) or 60000
|
||||
|
||||
local ambient_spawn_chance = tonumber(minetest.settings:get("animalia_ambient_chance")) or 9000
|
||||
|
||||
|
@ -56,13 +56,12 @@ creatura.register_abm_spawn("animalia:grizzly_bear", {
|
|||
|
||||
creatura.register_abm_spawn("animalia:chicken", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 3,
|
||||
max_group = 5,
|
||||
spawn_cap = 3,
|
||||
biomes = chicken_biomes,
|
||||
nodes = {"group:soil"},
|
||||
})
|
||||
|
@ -79,13 +78,12 @@ creatura.register_abm_spawn("animalia:cat", {
|
|||
|
||||
creatura.register_abm_spawn("animalia:cow", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 3,
|
||||
max_group = 4,
|
||||
spawn_cap = 3,
|
||||
biomes = animalia.registered_biome_groups["grassland"].biomes,
|
||||
nodes = {"group:soil"},
|
||||
neighbors = {"air", "group:grass", "group:flora"}
|
||||
|
@ -103,13 +101,12 @@ creatura.register_abm_spawn("animalia:fox", {
|
|||
|
||||
creatura.register_abm_spawn("animalia:horse", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 3,
|
||||
max_group = 4,
|
||||
spawn_cap = 3,
|
||||
biomes = animalia.registered_biome_groups["grassland"].biomes,
|
||||
nodes = {"group:soil"},
|
||||
neighbors = {"air", "group:grass", "group:flora"}
|
||||
|
@ -150,39 +147,36 @@ creatura.register_abm_spawn("animalia:opossum", {
|
|||
|
||||
creatura.register_abm_spawn("animalia:pig", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 2,
|
||||
max_group = 3,
|
||||
spawn_cap = 3,
|
||||
biomes = pig_biomes,
|
||||
nodes = {"group:soil"},
|
||||
})
|
||||
|
||||
creatura.register_abm_spawn("animalia:reindeer", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 6,
|
||||
max_group = 8,
|
||||
spawn_cap = 3,
|
||||
biomes = animalia.registered_biome_groups["boreal"].biomes,
|
||||
nodes = {"group:soil"},
|
||||
})
|
||||
|
||||
creatura.register_abm_spawn("animalia:sheep", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 3,
|
||||
max_group = 6,
|
||||
spawn_cap = 3,
|
||||
biomes = animalia.registered_biome_groups["grassland"].biomes,
|
||||
nodes = {"group:soil"},
|
||||
neighbors = {"air", "group:grass", "group:flora"}
|
||||
|
@ -190,13 +184,12 @@ creatura.register_abm_spawn("animalia:sheep", {
|
|||
|
||||
creatura.register_abm_spawn("animalia:turkey", {
|
||||
chance = common_spawn_chance,
|
||||
chance_on_load = 64,
|
||||
spawn_active = true,
|
||||
spawn_on_load = true,
|
||||
min_height = 0,
|
||||
max_height = 1024,
|
||||
min_group = 3,
|
||||
max_group = 4,
|
||||
spawn_cap = 3,
|
||||
biomes = animalia.registered_biome_groups["boreal"].biomes,
|
||||
nodes = {"group:soil"},
|
||||
})
|
||||
|
@ -345,7 +338,7 @@ minetest.register_abm({
|
|||
action = function(pos, _, active_object_count)
|
||||
minetest.remove_node(pos)
|
||||
|
||||
if active_object_count > 8 then return end
|
||||
if active_object_count > 4 then return end
|
||||
|
||||
local spawnable_mobs = {}
|
||||
|
||||
|
|
|
@ -512,7 +512,32 @@ minetest.register_craftitem("animalia:net", {
|
|||
-----------
|
||||
|
||||
if minetest.get_modpath("3d_armor") then
|
||||
table.insert(armor.attributes, "heavy_pelt")
|
||||
|
||||
if armor
|
||||
and armor.attributes then
|
||||
table.insert(armor.attributes, "heavy_pelt")
|
||||
|
||||
minetest.register_on_punchplayer(function(player, hitter, _, _, _, damage)
|
||||
local name = player:get_player_name()
|
||||
if name
|
||||
and (armor.def[name].heavy_pelt or 0) > 0 then
|
||||
local hit_ip = hitter:is_player()
|
||||
if hit_ip and minetest.is_protected(player:get_pos(), "") then
|
||||
return
|
||||
else
|
||||
local player_pos = player:get_pos()
|
||||
if not player_pos then return end
|
||||
|
||||
local biome_data = minetest.get_biome_data(player_pos)
|
||||
|
||||
if biome_data.heat < 50 then
|
||||
player:set_hp(player:get_hp() - (damage / 1.5))
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
armor:register_armor("animalia:coat_bear_pelt", {
|
||||
description = "Bear Pelt Coat",
|
||||
|
@ -521,26 +546,16 @@ if minetest.get_modpath("3d_armor") then
|
|||
armor_groups = {fleshy = 5}
|
||||
})
|
||||
|
||||
minetest.register_on_punchplayer(function(player, hitter, _, _, _, damage)
|
||||
local name = player:get_player_name()
|
||||
if name
|
||||
and (armor.def[name].heavy_pelt or 0) > 0 then
|
||||
local hit_ip = hitter:is_player()
|
||||
if hit_ip and minetest.is_protected(player:get_pos(), "") then
|
||||
return
|
||||
else
|
||||
local player_pos = player:get_pos()
|
||||
if not player_pos then return end
|
||||
|
||||
local biome_data = minetest.get_biome_data(player_pos)
|
||||
|
||||
if biome_data.heat < 50 then
|
||||
player:set_hp(player:get_hp() - (damage / 1.5))
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
minetest.register_craft({
|
||||
output = "animalia:coat_bear_pelt",
|
||||
recipe = {
|
||||
{"animalia:pelt_bear", "", "animalia:pelt_bear"},
|
||||
{"animalia:pelt_bear", "animalia:pelt_bear", "animalia:pelt_bear"},
|
||||
{"animalia:pelt_bear", "animalia:pelt_bear", "animalia:pelt_bear"}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-----------
|
||||
|
|
|
@ -371,7 +371,7 @@ creatura.register_mob("animalia:horse", {
|
|||
|
||||
local owner = self.owner
|
||||
local name = clicker and clicker:get_player_name()
|
||||
if not owner or name ~= owner then return end
|
||||
if owner and name ~= owner then return end
|
||||
|
||||
if animalia.set_nametag(self, clicker) then
|
||||
return
|
||||
|
|
2
mod.conf
2
mod.conf
|
@ -1,6 +1,6 @@
|
|||
name = animalia
|
||||
depends = creatura
|
||||
optional_depends = default, mcl_player, farming
|
||||
optional_depends = default, mcl_player, farming, 3d_armor
|
||||
description = Adds unique and consistantly designed Animals
|
||||
title = Animalia
|
||||
author = ElCeejo
|
||||
|
|
Loading…
Add table
Reference in a new issue