-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
88 lines (76 loc) · 5.22 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Imports
import os
ROOT: str = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
# Folders
MERGE_FOLDER: str = f"{ROOT}/merge" # If a file exists in both merge and build folder, they will be merged. Otherwise, it's just copied.
BUILD_FOLDER: str = f"{ROOT}/build" # Folder where the final datapack and resource pack are built
ASSETS_FOLDER: str = f"{ROOT}/assets" # Folder containing the all assets (textures, sounds, ...) for the datapack
LIBS_FOLDER: str = f"{ROOT}/libs" # The libraries are copied to the build destination, and merged with the datapack using Weld
BUILD_COPY_DESTINATIONS: tuple[str, str] = ("D:/latest_snapshot/world/datapacks", "D:/minecraft/snapshot/resourcepacks") # Can be empty strings if you don't want to copy the generated files
# Dev constants
HAS_MANUAL: bool = True # Do the program generate a manual/guide? (WARNING: if an item is malformed in the database, the server log will be flooded on load by the manual hiding the malformed item)
DATABASE_DEBUG: str = f"{ROOT}/database_debug.json" # Dump of the database for debugging purposes
CMD_CACHE: str = f"{ROOT}/cmd_cache.json" # Cache of all items Custom Model Data
ENABLE_TRANSLATIONS: bool = True # Will convert all the text components to translate and generate a lang file (WARNING: The algorithm is pretty slow, so it's recommended to disable it when not needed)
MERGE_LIBS: bool = True # Make new zip of merged libraries with the datapack and resource pack using Smithed Weld
# Datapack related constants
AUTHOR: str = "Stoupy51" # Author(s) name(s) displayed in pack.mcmeta, also used to add convention.debug tag to the players of the same name(s) <-- showing additionnal displays like datapack loading
PROJECT_NAME: str = "SimplEnergy" # Name of the datapack, used for messages and items lore
VERSION: str = "2.0.0" # Datapack version in the following mandatory format: major.minor.patch, ex: 1.0.0 or 1.21.615
NAMESPACE: str = "simplenergy" # Should be the same you use in the merge folder. Used to namespace functions, tags, etc.
DESCRIPTION: str = f"{PROJECT_NAME} [{VERSION}] by {AUTHOR}" # Pack description displayed in pack.mcmeta
DEPENDENCIES: dict[str, dict[str, list[int] | str]] = {
# Automagically, the datapack will check for the presence of dependencies and their minimum required versions at runtime
# The url is used when the dependency is not found to suggest where to get it
# The version dict key contains the minimum required version of the dependency in [major, minor, patch] format
# The main key is the dependency namespace to check for
# The name can be whatever you want, it's just used in messages
"energy": {"version":[1, 8, 0], "name":"DatapackEnergy", "url":"https://github.com/ICY105/DatapackEnergy"},
}
# Technical constants
SOURCE_LORE: list[dict] = [{"text":PROJECT_NAME,"italic":True,"color":"blue"}] # Appended lore to any custom item, can be an empty string
# Manual configuration
DEBUG_MODE: bool = False # Shows up grids in manual
MANUAL_PATH: str = f"{ROOT}/manual" # Cached manual assets
MANUAL_OVERRIDES: str = f"{ASSETS_FOLDER}/manual_overrides" # Path to a folder containing manual overrides to replace the default manual assets
MANUAL_HIGH_RESOLUTION: bool = True # Enable the high resolution for the manual to increase the craft resolutions
CACHE_MANUAL_ASSETS: bool = True # Caches the MC assets and the items renders for the manual (manual/items/*.png)
CACHE_MANUAL_PAGES: bool = True # Caches the content of the manual and the images (manual/pages/*.png)
MANUAL_DEBUG: str = f"{ROOT}/debug_manual.json" # Dump of the manual for debugging purposes
MANUAL_NAME: str = f"{PROJECT_NAME} Manual" # Name of the manual, used for the title of the book and first page
MAX_ITEMS_PER_ROW: int = 5 # Max number of items per row in the manual, should not exceed 6
MAX_ROWS_PER_PAGE: int = 5 # Max number of rows per page in the manual, should not exceed 6
OPENGL_RESOLUTION: int = 256 # Resolution of the OpenGL renders used in the manual, best value is 256 <--- 256x256
MANUAL_FIRST_PAGE_TEXT: list[dict] = [{"text":"The following manual will guide you through recipes and energy statistics about devices.", "color":"#505050"}] # Text for the first page of the manual
# Configuration dictionnary
configuration = {
"merge_folder": MERGE_FOLDER,
"manual_path": MANUAL_PATH,
"build_folder": BUILD_FOLDER,
"assets_folder": ASSETS_FOLDER,
"libs_folder": LIBS_FOLDER,
"build_copy_destinations": BUILD_COPY_DESTINATIONS,
"has_manual": HAS_MANUAL,
"debug_mode": DEBUG_MODE,
"database_debug": DATABASE_DEBUG,
"cmd_cache": CMD_CACHE,
"cache_manual_assets": CACHE_MANUAL_ASSETS,
"cache_manual_pages": CACHE_MANUAL_PAGES,
"manual_debug": MANUAL_DEBUG,
"enable_translations": ENABLE_TRANSLATIONS,
"merge_libs": MERGE_LIBS,
"author": AUTHOR,
"project_name": PROJECT_NAME,
"version": VERSION,
"namespace": NAMESPACE,
"manual_name": MANUAL_NAME,
"description": DESCRIPTION,
"dependencies": DEPENDENCIES,
"source_lore": SOURCE_LORE,
"max_items_per_row": MAX_ITEMS_PER_ROW,
"max_rows_per_page": MAX_ROWS_PER_PAGE,
"opengl_resolution": OPENGL_RESOLUTION,
"manual_first_page_text": MANUAL_FIRST_PAGE_TEXT,
"manual_high_resolution": MANUAL_HIGH_RESOLUTION,
"manual_overrides": MANUAL_OVERRIDES,
}