mods - default,skins,xdecor - provide player_api compatible calls
* made then optional the player_api dependencies or set wrapper for logics
This commit is contained in:
parent
6972d6ebda
commit
52f10f4aba
@ -23,3 +23,26 @@ LIGHT_MAX = default.LIGHT_MAX
|
|||||||
|
|
||||||
-- Formspecs
|
-- Formspecs
|
||||||
default.gui_suvival_form = default.gui_survival_form
|
default.gui_suvival_form = default.gui_survival_form
|
||||||
|
default.gui_bg = ""
|
||||||
|
default.gui_bg_img = ""
|
||||||
|
|
||||||
|
-- Players
|
||||||
|
if minetest.get_modpath("player_api") then
|
||||||
|
default.registered_player_models = player_api.registered_models
|
||||||
|
default.player_register_model = player_api.register_model
|
||||||
|
default.player_attached = player_api.player_attached
|
||||||
|
default.player_get_animation = player_api.get_animation
|
||||||
|
default.player_set_model = player_api.set_model
|
||||||
|
default.player_set_textures = player_api.set_textures
|
||||||
|
default.player_set_animation = player_api.set_animation
|
||||||
|
else
|
||||||
|
player_api = {}
|
||||||
|
player_api.registered_models = default.registered_player_models
|
||||||
|
player_api.register_model = default.player_register_model
|
||||||
|
player_api.player_attached = default.player_attached
|
||||||
|
player_api.get_animation = default.player_get_animation
|
||||||
|
player_api.set_model = default.player_set_model
|
||||||
|
player_api.set_textures = default.player_set_textures
|
||||||
|
player_api.set_animation = default.player_set_animation
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ local S
|
|||||||
|
|
||||||
if minetest.get_translator ~= nil then
|
if minetest.get_translator ~= nil then
|
||||||
S = minetest.get_translator("skins")
|
S = minetest.get_translator("skins")
|
||||||
is_50 = true
|
|
||||||
else
|
else
|
||||||
if minetest.get_modpath("intllib") then
|
if minetest.get_modpath("intllib") then
|
||||||
dofile(minetest.get_modpath("intllib").."/init.lua")
|
dofile(minetest.get_modpath("intllib").."/init.lua")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name = skins
|
name = skins
|
||||||
depends = default, player_api
|
depends = default
|
||||||
optional_depends = sfinv, inventory_plus, intllib, unified_inventory
|
optional_depends = sfinv, inventory_plus, intllib, unified_inventory, player_api
|
||||||
description = SKIN manager mod, Simple_Skin modified mod that allow players to set their individual skins.
|
description = SKIN manager mod, Simple_Skin modified mod that allow players to set their individual skins.
|
||||||
|
@ -29,7 +29,7 @@ function xdecor.sit(pos, node, clicker, pointed_thing)
|
|||||||
|
|
||||||
elseif not default.player_attached[player_name] and node.param2 <= 3 and
|
elseif not default.player_attached[player_name] and node.param2 <= 3 and
|
||||||
not ctrl.sneak and vector.equals(vel, vector.new()) then
|
not ctrl.sneak and vector.equals(vel, vector.new()) then
|
||||||
if p_api then eyey = 0 end
|
if p_api then eyey = 0 end -- our default mod only has wrapper functions not new logic
|
||||||
clicker:set_eye_offset({x = 0, y = eyey, z = 2}, vector.new())
|
clicker:set_eye_offset({x = 0, y = eyey, z = 2}, vector.new())
|
||||||
clicker:set_physics_override({speed = 0, jump = 0, gravity = 1})
|
clicker:set_physics_override({speed = 0, jump = 0, gravity = 1})
|
||||||
clicker:set_pos(pos)
|
clicker:set_pos(pos)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user