Browse Source

remove MT-0.4 support

pull/40/head
Alexander Weber 1 month ago
parent
commit
555d682f04
4 changed files with 26 additions and 63 deletions
  1. +17
    -39
      init.lua
  2. BIN
      models/skinsdb_3d_armor_character.b3d
  3. BIN
      models/skinsdb_3d_armor_character.blend
  4. +9
    -24
      skin_meta_api.lua

+ 17
- 39
init.lua View File

@@ -68,42 +68,20 @@ minetest.register_on_leaveplayer(function(player)
skins.ui_context[player:get_player_name()] = nil
end)

if minetest.global_exists("player_api") then
-- Minetest-5 and above compatible
player_api.register_model("skinsdb_3d_armor_character_5.b3d", {
animation_speed = 30,
textures = {
"blank.png",
"blank.png",
"blank.png",
"blank.png"
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
},
})
else
-- Minetest-0.4 compatible
default.player_register_model("skinsdb_3d_armor_character.b3d", {
animation_speed = 30,
textures = {
"blank.png",
"blank.png",
"blank.png",
"blank.png",
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
},
})
end
player_api.register_model("skinsdb_3d_armor_character_5.b3d", {
animation_speed = 30,
textures = {
"blank.png",
"blank.png",
"blank.png",
"blank.png"
},
animations = {
stand = {x=0, y=79},
lay = {x=162, y=166},
walk = {x=168, y=187},
mine = {x=189, y=198},
walk_mine = {x=200, y=219},
sit = {x=81, y=160},
},
})

BIN
models/skinsdb_3d_armor_character.b3d View File


BIN
models/skinsdb_3d_armor_character.blend View File


+ 9
- 24
skin_meta_api.lua View File

@@ -73,13 +73,9 @@ function skin_class:apply_skin_to_player(player)

local playername = player:get_player_name()
local ver = self:get_meta("format") or "1.0"
if minetest.global_exists("player_api") then
-- Minetest-5 compatible
player_api.set_model(player, "skinsdb_3d_armor_character_5.b3d")
else
-- Minetest-0.4 compatible
default.player_set_model(player, "skinsdb_3d_armor_character.b3d")
end

player_api.set_model(player, "skinsdb_3d_armor_character_5.b3d")

local v10_texture = "blank.png"
local v18_texture = "blank.png"
local armor_texture = "blank.png"
@@ -114,23 +110,12 @@ function skin_class:apply_skin_to_player(player)
end
end

if minetest.global_exists("player_api") then
-- Minetest-5 compatible
player_api.set_textures(player, {
v10_texture,
v18_texture,
armor_texture,
wielditem_texture,
})
else
-- Minetest-0.4 compatible
default.player_set_textures(player, {
v10_texture,
v18_texture,
armor_texture,
wielditem_texture,
})
end
player_api.set_textures(player, {
v10_texture,
v18_texture,
armor_texture,
wielditem_texture,
})

player:set_properties({
visual_size = {

Loading…
Cancel
Save