mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 02:21:06 +01:00
30 lines
833 B
Python
30 lines
833 B
Python
import os
|
|
import platform
|
|
|
|
def get_minetest_directory():
|
|
system = platform.system()
|
|
|
|
# Windows
|
|
if system == 'Windows':
|
|
return os.environ.get('MINETEST_USER_PATH', os.path.expandvars('%APPDATA%\\Minetest'))
|
|
|
|
# Linux
|
|
elif system == 'Linux':
|
|
return os.environ.get('MINETEST_USER_PATH', os.path.expanduser('~/.minetest'))
|
|
|
|
# macOS
|
|
elif system == 'Darwin': # Darwin is the system name for macOS
|
|
return os.environ.get('MINETEST_USER_PATH', os.path.expanduser('~/Library/Application Support/minetest'))
|
|
|
|
# Unsupported system
|
|
else:
|
|
return None
|
|
|
|
# Constants
|
|
SUPPORTED_MINECRAFT_VERSION = "1.20"
|
|
|
|
# Helper vars
|
|
home = os.environ["HOME"]
|
|
mineclone2_path = os.path.join(get_minetest_directory(),"games","mineclone2")
|
|
working_dir = os.getcwd()
|
|
appname = "Texture_Converter.py"
|