diff --git a/api/api.lua b/api/api.lua index 2024346..c4c6a73 100644 --- a/api/api.lua +++ b/api/api.lua @@ -103,13 +103,19 @@ local function activate_nametag(self) }) end -local animate_player = {} +local animate_player = nil +local player_attached = {} if minetest.get_modpath("default") and minetest.get_modpath("player_api") then animate_player = player_api.set_animation + player_attached = player_api.player_attached elseif minetest.get_modpath("mcl_player") then animate_player = mcl_player.set_animation + player_attached = mcl_player.player_attached +elseif minetest.get_modpath("hades_player") then + animate_player = hades_player.player_set_animation + player_attached = hades_player.player_attached end ----------------------- @@ -522,19 +528,15 @@ function animalia.mount(self, player, params) } }) player:set_eye_offset() - if minetest.get_modpath("player_api") then + if animate_player then animate_player(player, "stand", 30) - if player_api.player_attached then - player_api.player_attached[player:get_player_name()] = false - end + player_attached[player:get_player_name()] = false end self.rider = nil return end - if player_api then - player_api.player_attached[player:get_player_name()] = true - end - if minetest.get_modpath("player_api") then + player_attached[player:get_player_name()] = true + if animate_player then animate_player(player, "sit", 30) end self.rider = player @@ -1270,4 +1272,4 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) animalia_libri_info[player_name] = nil end end -end) \ No newline at end of file +end) diff --git a/init.lua b/init.lua index a4d4049..fb931f8 100644 --- a/init.lua +++ b/init.lua @@ -52,7 +52,7 @@ for i = 1, #animalia.animals do dofile(path.."/mobs/" .. name .. ".lua") end -if minetest.settings:get_bool("spawn_mobs", true) then +if minetest.settings:get_bool("spawn_mobs", true) and (minetest.get_modpath("hades_core")==nil) then dofile(path.."/api/spawning.lua") end diff --git a/mod.conf b/mod.conf index ab2632e..f20a00d 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,5 @@ name = animalia depends = creatura -optional_depends = default, mcl_player +optional_depends = default, mcl_player, hades_player description = Adds unique and consistantly designed Animals title = Animalia