From f1e7172fe129f0a7b570b7264e7cade9e3ccb2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D1=85=D0=B0=D1=80=D0=B4=20PICCORO=20Len?= =?UTF-8?q?z=20McKAY?= Date: Fri, 10 Dec 2021 17:35:02 -0400 Subject: [PATCH] adapted from player_api: Set eye height property for player model * backported https://codeberg.org/minenux/minetest-game-minetest/commit/d4e1bd053ed572573aeca2ec0e89f4c208a5b5f1 * Player API: Set eye height property for new player model --- game_api.txt | 1 + mods/default/player.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/game_api.txt b/game_api.txt index d33c7c9..b74e82f 100644 --- a/game_api.txt +++ b/game_api.txt @@ -645,6 +645,7 @@ default.player_get_animation(player) bar = {x = 20, y = 39}, -- ... }, + eye_height = 1.47, -- In nodes above feet position } Leafdecay diff --git a/mods/default/player.lua b/mods/default/player.lua index 0a2078d..4a7c5fd 100644 --- a/mods/default/player.lua +++ b/mods/default/player.lua @@ -27,6 +27,7 @@ default.player_register_model("character.b3d", { walk_mine = { x=200, y=219, }, sit = { x= 81, y=160, }, }, + eye_height = 1.625, }) -- Player stats and animations @@ -58,12 +59,14 @@ function default.player_set_model(player, model_name) textures = player_textures[name] or model.textures, visual = "mesh", visual_size = model.visual_size or {x=1, y=1}, + eye_height = model.eye_height or 1.47, }) default.player_set_animation(player, "stand") else player:set_properties({ textures = { "player.png", "player_back.png", }, visual = "upright_sprite", + eye_height = 1.625, }) end player_model[name] = model_name