mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-26 01:00:20 +01:00
Merge remote-tracking branch 'origin/master' into contentdb
This commit is contained in:
commit
d4b398eae2
@ -10,4 +10,5 @@ globals = {
|
|||||||
read_globals = {
|
read_globals = {
|
||||||
string = {fields = {"split", "trim"}},
|
string = {fields = {"split", "trim"}},
|
||||||
table = {fields = {"copy", "getn"}},
|
table = {fields = {"copy", "getn"}},
|
||||||
|
"hand_monoid",
|
||||||
}
|
}
|
||||||
|
4
init.lua
4
init.lua
@ -80,6 +80,10 @@ player_api.register_model("skinsdb_3d_armor_character_5.b3d", {
|
|||||||
mine = {x=189, y=198},
|
mine = {x=189, y=198},
|
||||||
walk_mine = {x=200, y=219},
|
walk_mine = {x=200, y=219},
|
||||||
sit = {x=81, y=160},
|
sit = {x=81, y=160},
|
||||||
|
-- compatibility w/ the emote mod
|
||||||
|
wave = {x = 192, y = 196, override_local = true},
|
||||||
|
point = {x = 196, y = 196, override_local = true},
|
||||||
|
freeze = {x = 205, y = 205, override_local = true},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,5 +1,5 @@
|
|||||||
name = skinsdb
|
name = skinsdb
|
||||||
description = Player skin mod, supporting unified_inventory, sfinv and smart_inventory
|
description = Player skin mod, supporting unified_inventory, sfinv and smart_inventory
|
||||||
depends = player_api
|
depends = player_api
|
||||||
optional_depends = unified_inventory,3d_armor,clothing,sfinv
|
optional_depends = unified_inventory,3d_armor,clothing,sfinv,hand_monoid
|
||||||
min_minetest_version = 5.4.0
|
min_minetest_version = 5.4.0
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
skins.meta = {}
|
skins.meta = {}
|
||||||
|
|
||||||
|
local has_hand_monoid = minetest.get_modpath("hand_monoid")
|
||||||
|
|
||||||
local skin_class = {}
|
local skin_class = {}
|
||||||
skin_class.__index = skin_class
|
skin_class.__index = skin_class
|
||||||
skins.skin_class = skin_class
|
skins.skin_class = skin_class
|
||||||
@ -208,12 +210,20 @@ function skin_class:apply_skin_to_player(player)
|
|||||||
})
|
})
|
||||||
|
|
||||||
local hand = self:get_hand()
|
local hand = self:get_hand()
|
||||||
|
if has_hand_monoid then
|
||||||
|
if hand then
|
||||||
|
hand_monoid.monoid:add_change(player, {name = hand}, "skinsdb:hand")
|
||||||
|
else
|
||||||
|
hand_monoid.monoid:del_change(player, "skinsdb:hand")
|
||||||
|
end
|
||||||
|
else
|
||||||
if hand then
|
if hand then
|
||||||
player:get_inventory():set_size("hand", 1)
|
player:get_inventory():set_size("hand", 1)
|
||||||
player:get_inventory():set_stack("hand", 1, hand)
|
player:get_inventory():set_stack("hand", 1, hand)
|
||||||
else
|
else
|
||||||
player:get_inventory():set_stack("hand", 1, "")
|
player:get_inventory():set_stack("hand", 1, "")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function skin_class:set_skin(player)
|
function skin_class:set_skin(player)
|
||||||
|
Loading…
Reference in New Issue
Block a user