mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-04-30 13:31:39 -04:00
Add Hades Revisited support. Fix attach to horse api and test it under Minetest game, Hades Revisited and MineClone 2.
This commit is contained in:
parent
8a34dce37c
commit
7d2ed80f98
3 changed files with 14 additions and 12 deletions
20
api/api.lua
20
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
|
||||
|
|
2
init.lua
2
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
|
||||
|
||||
|
|
2
mod.conf
2
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
|
||||
|
|
Loading…
Add table
Reference in a new issue