detection of mientest engine version barrier, provided

master
mckaygerhard 2023-06-22 10:19:05 -04:00
parent 4924834860
commit 2f09ed412b
1 changed files with 11 additions and 0 deletions

View File

@ -23,6 +23,11 @@ local modcommand = minetest.get_modpath("game_commands")
local modcreative = minetest.get_modpath("creative")
local checkapikey = minetest.settings:get("governing.checkapikey") or ""
local is_46 = minetest.has_feature("add_entity_with_staticdata") -- detect minetest engine 4.0.16 or mayor
local is_50 = minetest.has_feature("object_use_texture_alpha") -- detect mineitest engine more modern than 5.0.0
local is_53 = minetest.has_feature("object_step_has_moveresult") -- detect mineitest engine more modern than 5.3.1
local is_54 = minetest.has_feature("direct_velocity_on_players") -- detect mineitest engine more modern than 5.4.0
local httpapi = minetest.request_http_api and minetest.request_http_api() -- Only works at init time and must be called from the mod's main scope (not from a function).
local S
@ -52,7 +57,13 @@ local creative_mode_cache = minetest.settings:get_bool("creative_mode")
governing = {}
governing.is_46 = is_46
governing.is_50 = is_50
governing.is_53 = is_53
governing.is_54 = is_54
governing.S = S
governing.httpapi = httpapi -- must be called early at the beggining to work
governing.modname = modname -- name of the mod
governing.modpath = modpath -- path of the mod