From fc16e60740167b4a22e29cf73883f5c73e05b0de Mon Sep 17 00:00:00 2001 From: David Leal Date: Tue, 28 Jun 2022 17:09:59 -0500 Subject: [PATCH] Fix `player_api` eyeheight if desired This commit also includes a few other minor fixes. This option can be enabled/disabled at any time. --- .luacheckrc | 2 +- depends.txt | 4 ++++ description.txt | 2 +- init.lua | 4 ++++ mod.conf | 12 ++++++++++-- settingtypes.txt | 2 ++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 22aa2a6..5991e51 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -3,7 +3,7 @@ allow_defined_top = true max_line_length = 999 globals = { - "vehicle_mash", + "vehicle_mash", "player_api", } read_globals = { diff --git a/depends.txt b/depends.txt index b6cd120..4378de6 100755 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,6 @@ default lib_mount +player_api +wool? +xpanes? +dye? diff --git a/description.txt b/description.txt index a38d3db..57b0973 100644 --- a/description.txt +++ b/description.txt @@ -1 +1 @@ -Adds many types of vehicles. \ No newline at end of file +Adds many types of vehicles. diff --git a/init.lua b/init.lua index bc10d96..2c69030 100755 --- a/init.lua +++ b/init.lua @@ -1,3 +1,7 @@ +-- Fix `player_api` eye height model if desired +if minetest.settings:get_bool("vehicle_mash.player_api_fix") == true or minetest.settings:get_bool("vehicle_mash.player_api_fix") == nil then + player_api.registered_models["character.b3d"].animations.sit.eye_height = 1.47 +end -- get modpath local mpath = minetest.get_modpath("vehicle_mash") diff --git a/mod.conf b/mod.conf index 9644957..8dc694c 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,11 @@ name = vehicle_mash -depends = default, lib_mount -description = Adds many types of vehicles. +depends = default, lib_mount, player_api +optional_depends = wool, xpanes, dye +description = """ +Adds many types of vehicles: + +- Normal cars. +- Boats. +- Hovercrafts. +- And mesecars. +""" diff --git a/settingtypes.txt b/settingtypes.txt index f567443..0bb7356 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,6 +7,8 @@ vehicle_mash.enable_crafts (Allows crafting vehicles) bool true # for registering vehicles, somebody may use this option in their server. vehicle_mash.api_mode (Disables all vehicles and only enables API functions) bool false +vehicle_mash.player_api_fix (Fix eyeheight when using cars) bool true + # CAR01's cars vehicle_mash.enable_black_car (Enables black car) bool true