summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorAlexander Weber <web.alexander@web.de>2017-06-15 14:16:11 +0200
committerAlexander Weber <web.alexander@web.de>2017-06-15 14:16:11 +0200
commite2f90886e134667bd26923777d1a70ebb78686a6 (patch)
tree2b13709c3755c1a028eed8874a688261ff60d7d5 /init.lua
parent8713b09348db3075182696c856c2a390bd567e84 (diff)
use players metadata. Enhance the API
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua26
1 files changed, 0 insertions, 26 deletions
diff --git a/init.lua b/init.lua
index 61b1028..d1f4111 100644
--- a/init.lua
+++ b/init.lua
@@ -6,11 +6,7 @@
skins = {}
skins.modpath = minetest.get_modpath("skins")
-skins.file = minetest.get_worldpath().."/skins.mt"
skins.default = "character_1"
-skins.pages = {}
-skins.skins = {}
-skins.file_save = false
skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
skins.get_type = function(texture)
@@ -33,30 +29,8 @@ end
dofile(skins.modpath.."/skinlist.lua")
dofile(skins.modpath.."/players.lua")
-
-skins.update_player_skin = function(player)
- local name = player:get_player_name()
-
- if not skins.is_skin(skins.skins[name]) then
- skins.skins[name] = skins.default
- end
- player:set_properties({
- textures = {skins.skins[name]..".png"},
- })
-end
-
-- Unified inventory page/integration
if minetest.get_modpath("unified_inventory") then
dofile(skins.modpath.."/unified_inventory_page.lua")
end
--- Change skin on join - reset if invalid
-minetest.register_on_joinplayer(function(player)
- local player_name = player:get_player_name()
- if not skins.is_skin(skins.skins[player_name]) then
- skins.skins[player_name] = skins.default
- end
- skins.update_player_skin(player)
-end)
-
-