Bug fixes, New Cow model
@ -573,6 +573,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
		if fields.drp_font_scale then
 | 
			
		||||
			animalia.libri_font_size[plyr_name] = fields.drp_font_scale
 | 
			
		||||
			local page = libri_players[plyr_name]
 | 
			
		||||
			if not page then return end
 | 
			
		||||
			minetest.show_formspec(plyr_name, "animalia:libri_" .. page, get_page(page, meta, plyr_name))
 | 
			
		||||
		end
 | 
			
		||||
		if fields.quit or fields.key_enter then
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										135
									
								
								api/spawning.lua
									
									
									
									
									
								
							
							
						
						@ -25,56 +25,51 @@ minetest.register_on_mods_loaded(function()
 | 
			
		||||
	insert_all(frog_biomes, animalia.registered_biome_groups["tropical"].biomes)
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:bat", {
 | 
			
		||||
	chance = 2,
 | 
			
		||||
	min_radius = 4,
 | 
			
		||||
	max_radius = 16,
 | 
			
		||||
	min_light = 0,
 | 
			
		||||
	min_height = -512,
 | 
			
		||||
	max_height = 0,
 | 
			
		||||
creatura.register_abm_spawn("animalia:chicken", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 5,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["cave"].biomes,
 | 
			
		||||
	spawn_in_nodes = true,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	nodes = {"air", "ignore"}
 | 
			
		||||
	biomes = chicken_biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:chicken", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 5,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = chicken_biomes
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:cow", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
creatura.register_abm_spawn("animalia:cow", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 4,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
	neighbors = {"air", "group:grass", "group:flora"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:fox", {
 | 
			
		||||
	chance = 4,
 | 
			
		||||
creatura.register_abm_spawn("animalia:fox", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 1,
 | 
			
		||||
	max_group = 2,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:horse", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
	min_group = 4,
 | 
			
		||||
	max_group = 5,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes
 | 
			
		||||
creatura.register_abm_spawn("animalia:horse", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 4,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
	neighbors = {"air", "group:grass", "group:flora"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_abm_spawn("animalia:rat", {
 | 
			
		||||
	chance = 2000,
 | 
			
		||||
	interval = 30,
 | 
			
		||||
	interval = 60,
 | 
			
		||||
	min_height = -1,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 1,
 | 
			
		||||
@ -94,35 +89,45 @@ creatura.register_abm_spawn("animalia:owl", {
 | 
			
		||||
	nodes = {"group:leaves"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:pig", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
creatura.register_abm_spawn("animalia:pig", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 2,
 | 
			
		||||
	max_group = 4,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = pig_biomes
 | 
			
		||||
	max_group = 3,
 | 
			
		||||
	biomes = pig_biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:reindeer", {
 | 
			
		||||
	chance = 4,
 | 
			
		||||
creatura.register_abm_spawn("animalia:reindeer", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 6,
 | 
			
		||||
	max_group = 12,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes
 | 
			
		||||
	max_group = 8,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:sheep", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
creatura.register_abm_spawn("animalia:sheep", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 6,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes
 | 
			
		||||
	biomes = animalia.registered_biome_groups["grassland"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
	neighbors = {"air", "group:grass", "group:flora"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:turkey", {
 | 
			
		||||
	chance = 2,
 | 
			
		||||
creatura.register_abm_spawn("animalia:turkey", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 3,
 | 
			
		||||
	max_group = 4,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:wolf", {
 | 
			
		||||
@ -133,16 +138,14 @@ creatura.register_mob_spawn("animalia:wolf", {
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_mob_spawn("animalia:tropical_fish", {
 | 
			
		||||
	chance = 3,
 | 
			
		||||
	min_height = -128,
 | 
			
		||||
	max_height = 256,
 | 
			
		||||
	min_group = 8,
 | 
			
		||||
	max_group = 12,
 | 
			
		||||
	spawn_cluster = true,
 | 
			
		||||
	spawn_in_nodes = true,
 | 
			
		||||
	spawn_on_gen = true,
 | 
			
		||||
	nodes = {"default:water_source"}
 | 
			
		||||
creatura.register_abm_spawn("animalia:wolf", {
 | 
			
		||||
	chance = 10000,
 | 
			
		||||
	min_height = 0,
 | 
			
		||||
	max_height = 1024,
 | 
			
		||||
	min_group = 2,
 | 
			
		||||
	max_group = 3,
 | 
			
		||||
	biomes = animalia.registered_biome_groups["boreal"].biomes,
 | 
			
		||||
	nodes = {"group:soil"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- Ambient Spawning
 | 
			
		||||
@ -209,4 +212,14 @@ creatura.register_abm_spawn("animalia:frog", {
 | 
			
		||||
	max_group = 4,
 | 
			
		||||
	neighbors = {"group:water"},
 | 
			
		||||
	nodes = {"group:soil"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
creatura.register_abm_spawn("animalia:tropical_fish", {
 | 
			
		||||
	chance = 2000,
 | 
			
		||||
	min_height = -128,
 | 
			
		||||
	max_height = 1,
 | 
			
		||||
	min_group = 6,
 | 
			
		||||
	max_group = 12,
 | 
			
		||||
	nodes = {"group:water"},
 | 
			
		||||
	neighbors = {"group:coral"}
 | 
			
		||||
})
 | 
			
		||||
@ -92,12 +92,12 @@ local function register_egg(name, def)
 | 
			
		||||
			}, def.mob .. "_egg_entity")
 | 
			
		||||
			local ent = object and object:get_luaentity()
 | 
			
		||||
			local dir = player:get_look_dir()
 | 
			
		||||
			obj:set_velocity({
 | 
			
		||||
			object:set_velocity({
 | 
			
		||||
				x = dir.x * vel,
 | 
			
		||||
				y = dir.y * vel,
 | 
			
		||||
				z = dir.z * vel
 | 
			
		||||
			})
 | 
			
		||||
			obj:set_acceleration({
 | 
			
		||||
			object:set_acceleration({
 | 
			
		||||
				x = dir.x * -3,
 | 
			
		||||
				y = -gravity,
 | 
			
		||||
				z = dir.z * -3
 | 
			
		||||
 | 
			
		||||
@ -238,7 +238,9 @@ creatura.register_mob("animalia:cat", {
 | 
			
		||||
		local item_name = clicker:get_wielded_item():get_name()
 | 
			
		||||
		if item_name == "animalia:net" then return end
 | 
			
		||||
		local trust = self.trust[clicker:get_player_name()] or 0
 | 
			
		||||
		local pos = self:get_center_pos()
 | 
			
		||||
		local pos = self.object:get_pos()
 | 
			
		||||
		if not pos then return end
 | 
			
		||||
		pos.y = pos.y + self.height * 0.5
 | 
			
		||||
		local minppos = vector.add(pos, 1)
 | 
			
		||||
		local maxppos = vector.subtract(pos, 1)
 | 
			
		||||
		if animalia.feed(self, clicker, true, true) then
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										83
									
								
								mobs/cow.lua
									
									
									
									
									
								
							
							
						
						@ -7,7 +7,7 @@ local random = math.random
 | 
			
		||||
local follows = {}
 | 
			
		||||
 | 
			
		||||
minetest.register_on_mods_loaded(function()
 | 
			
		||||
	for name in pairs(minetest.registered_items) do
 | 
			
		||||
	for name in pairs(minetest.registered_craftitems) do
 | 
			
		||||
		if (name:match(":wheat")
 | 
			
		||||
		or minetest.get_item_group(name, "food_wheat") > 0)
 | 
			
		||||
		and not tonumber(name:sub(-1))
 | 
			
		||||
@ -18,83 +18,73 @@ minetest.register_on_mods_loaded(function()
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
creatura.register_mob("animalia:cow", {
 | 
			
		||||
	-- Stats
 | 
			
		||||
	max_health = 20,
 | 
			
		||||
	armor_groups = {fleshy = 150},
 | 
			
		||||
	damage = 0,
 | 
			
		||||
	speed = 3,
 | 
			
		||||
	tracking_range = 16,
 | 
			
		||||
	despawn_after = 1500,
 | 
			
		||||
	-- Entity Physics
 | 
			
		||||
	stepheight = 1.1,
 | 
			
		||||
	turn_rate = 6,
 | 
			
		||||
	-- Visuals
 | 
			
		||||
	mesh = "animalia_cow.b3d",
 | 
			
		||||
	hitbox = {
 | 
			
		||||
		width = 0.65,
 | 
			
		||||
		height = 1.5
 | 
			
		||||
	},
 | 
			
		||||
	-- Engine Props
 | 
			
		||||
	visual_size = {x = 10, y = 10},
 | 
			
		||||
	mesh = "animalia_cow.b3d",
 | 
			
		||||
	female_textures = {
 | 
			
		||||
		"animalia_cow_1.png^animalia_cow_udder.png",
 | 
			
		||||
		"animalia_cow_2.png^animalia_cow_udder.png",
 | 
			
		||||
		"animalia_cow_3.png^animalia_cow_udder.png",
 | 
			
		||||
		"animalia_cow_4.png^animalia_cow_udder.png"
 | 
			
		||||
		"animalia_cow_4.png^animalia_cow_udder.png",
 | 
			
		||||
		"animalia_cow_5.png^animalia_cow_udder.png"
 | 
			
		||||
	},
 | 
			
		||||
	male_textures = {
 | 
			
		||||
		"animalia_cow_1.png",
 | 
			
		||||
		"animalia_cow_2.png",
 | 
			
		||||
		"animalia_cow_3.png",
 | 
			
		||||
		"animalia_cow_4.png"
 | 
			
		||||
		"animalia_cow_4.png",
 | 
			
		||||
		"animalia_cow_5.png"
 | 
			
		||||
	},
 | 
			
		||||
	child_textures = {
 | 
			
		||||
		"animalia_cow_1.png",
 | 
			
		||||
		"animalia_cow_2.png",
 | 
			
		||||
		"animalia_cow_3.png",
 | 
			
		||||
		"animalia_cow_4.png"
 | 
			
		||||
		"animalia_cow_4.png",
 | 
			
		||||
		"animalia_cow_5.png"
 | 
			
		||||
	},
 | 
			
		||||
	stepheight = 1.1,
 | 
			
		||||
	-- Creatura Props
 | 
			
		||||
	max_health = 20,
 | 
			
		||||
	armor_groups = {fleshy = 100},
 | 
			
		||||
	damage = 0,
 | 
			
		||||
	speed = 4,
 | 
			
		||||
	tracking_range = 16,
 | 
			
		||||
	despawn_after = 1000,
 | 
			
		||||
	max_fall = 3,
 | 
			
		||||
	stepheight = 1.1,
 | 
			
		||||
	sound = {},
 | 
			
		||||
	hitbox = {
 | 
			
		||||
		width = 0.5,
 | 
			
		||||
		height = 1
 | 
			
		||||
	},
 | 
			
		||||
	animations = {
 | 
			
		||||
		stand = {range = {x = 1, y = 59}, speed = 10, frame_blend = 0.3, loop = true},
 | 
			
		||||
		walk = {range = {x = 61, y = 79}, speed = 20, frame_blend = 0.3, loop = true},
 | 
			
		||||
		run = {range = {x = 61, y = 79}, speed = 30, frame_blend = 0.3, loop = true},
 | 
			
		||||
	},
 | 
			
		||||
	-- Misc
 | 
			
		||||
	flee_puncher = true,
 | 
			
		||||
	catch_with_net = true,
 | 
			
		||||
	catch_with_lasso = true,
 | 
			
		||||
	sounds = {
 | 
			
		||||
		random = {
 | 
			
		||||
			name = "animalia_cow_random",
 | 
			
		||||
			gain = 0.4,
 | 
			
		||||
			distance = 8
 | 
			
		||||
		},
 | 
			
		||||
		hurt = {
 | 
			
		||||
			name = "animalia_cow_hurt",
 | 
			
		||||
			gain = 0.4,
 | 
			
		||||
			distance = 8
 | 
			
		||||
		},
 | 
			
		||||
		death = {
 | 
			
		||||
			name = "animalia_cow_death",
 | 
			
		||||
			gain = 0.4,
 | 
			
		||||
			distance = 8
 | 
			
		||||
		}
 | 
			
		||||
		walk = {range = {x = 71, y = 89}, speed = 20, frame_blend = 0.3, loop = true},
 | 
			
		||||
		run = {range = {x = 71, y = 89}, speed = 30, frame_blend = 0.3, loop = true},
 | 
			
		||||
	},
 | 
			
		||||
	follow = follows,
 | 
			
		||||
	drops = {
 | 
			
		||||
		{name = "animalia:beef_raw", min = 1, max = 3, chance = 1},
 | 
			
		||||
		{name = "animalia:leather", min = 1, max = 3, chance = 2}
 | 
			
		||||
	},
 | 
			
		||||
	follow = follows,
 | 
			
		||||
	fancy_collide = false,
 | 
			
		||||
	bouyancy_multiplier = 1,
 | 
			
		||||
	hydrodynamics_multiplier = 1,
 | 
			
		||||
	-- Animalia Props
 | 
			
		||||
	flee_puncher = true,
 | 
			
		||||
	catch_with_net = true,
 | 
			
		||||
	catch_with_lasso = true,
 | 
			
		||||
	consumable_nodes = {
 | 
			
		||||
		["default:dirt_with_grass"] = "default:dirt",
 | 
			
		||||
		["default:dry_dirt_with_dry_grass"] = "default:dry_dirt"
 | 
			
		||||
	},
 | 
			
		||||
	head_data = {
 | 
			
		||||
		offset = {x = 0, y = 0.7, z = 0.0},
 | 
			
		||||
		offset = {x = 0, y = 0.8, z = 0.0},
 | 
			
		||||
		pitch_correction = -65,
 | 
			
		||||
		pivot_h = 0.75,
 | 
			
		||||
		pivot_v = 1
 | 
			
		||||
	},
 | 
			
		||||
	-- Function
 | 
			
		||||
 | 
			
		||||
	utility_stack = {
 | 
			
		||||
		{
 | 
			
		||||
			utility = "animalia:wander",
 | 
			
		||||
@ -137,6 +127,7 @@ creatura.register_mob("animalia:cow", {
 | 
			
		||||
		},
 | 
			
		||||
		animalia.global_utils.basic_flee
 | 
			
		||||
	},
 | 
			
		||||
	-- Functions
 | 
			
		||||
	activate_func = function(self)
 | 
			
		||||
		animalia.initialize_api(self)
 | 
			
		||||
		animalia.initialize_lasso(self)
 | 
			
		||||
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 13 KiB  | 
| 
		 Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 13 KiB  | 
| 
		 Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB  | 
| 
		 Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 10 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								textures/cow/animalia_cow_5.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 12 KiB  | 
| 
		 Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB  |