-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.py
61 lines (44 loc) · 3.05 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
# Imports
import os
ROOT: str = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/") # This line gets the full root path to this folder, don't change it unless you know what you're doing.
IGNORE_UNSET: bool = True # If True, the program will ignore unset optionnal values in the configuration dictionnary
# 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, ... folders) for the datapack and resource pack
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[list, list] = ([f"{ROOT}/_switch_dump"], ["D:/minecraft/snapshot/resourcepacks", "D:/minecraft/latest/resourcepacks"]) # Can be empty lists if you don't want to copy the generated files to other folders.
# Dev constants
DATABASE_DEBUG: str = f"{ROOT}/database_debug.json" # Dump of the database for debugging purposes
ENABLE_TRANSLATIONS: bool = False # Will convert all the text components to translate and generate a lang file in the resource pack. Meaning you can easily translate the datapack in multiple languages!
MERGE_LIBS: bool = True # Make new zip of merged libraries with the datapack and resource pack using Smithed Weld
# Project information
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 = "Switch" # Name of the datapack, used for messages and items lore
VERSION: str = "2.0.0" # Project version in the following mandatory format: major.minor.patch, ex: 1.0.0 or 1.21.615
NAMESPACE: str = "switch" # Simplified version of the datapack name. Should be the same you use in the merge folder. Used to namespace functions, tags, etc.
DESCRIPTION = f"{PROJECT_NAME} [{VERSION}] by {AUTHOR}" # Pack description displayed in pack.mcmeta
DEPENDENCIES: dict[str, dict[str, list[int] | str]] = {
"sheepwars": {"version":[2, 1, 0], "name":"SheepWars", "url":"https://github.com/Stoupy51/SheepWars"},
}
# Technical constants
SOURCE_LORE: list[dict] = [{"text":"ICON"},{"text":f" {PROJECT_NAME}","italic":True,"color":"blue"}] # Appended lore to any custom item, can be an empty string
# Configuration dictionnary
configuration = {
"ignore_unset": IGNORE_UNSET,
"merge_folder": MERGE_FOLDER,
"build_folder": BUILD_FOLDER,
"assets_folder": ASSETS_FOLDER,
"libs_folder": LIBS_FOLDER,
"build_copy_destinations": BUILD_COPY_DESTINATIONS,
"database_debug": DATABASE_DEBUG,
"enable_translations": ENABLE_TRANSLATIONS,
"merge_libs": MERGE_LIBS,
"author": AUTHOR,
"project_name": PROJECT_NAME,
"version": VERSION,
"namespace": NAMESPACE,
"description": DESCRIPTION,
"dependencies": DEPENDENCIES,
"source_lore": SOURCE_LORE,
}