Skip to content

Instantly share code, notes, and snippets.

@Podshot
Last active August 29, 2015 14:17
Show Gist options
  • Save Podshot/3ae2c20907dff4a05d3a to your computer and use it in GitHub Desktop.
Save Podshot/3ae2c20907dff4a05d3a to your computer and use it in GitHub Desktop.
Library managing with MCEdit Filters (Supported after, but not including, version 1.3.1.0)
# Define the 'libraries' variable just like you would for inputs
# ====Notes====
# * ALWAYS check if the library is available, even if you mark it as '"optional": False'
# * If this ability is abused, it can\will be removed at any of the developers discretion, so please don't abuse it
# * The "path" field starts from a 'lib' subfolder in the 'Filters' directory
# * Keep the libraries small, MCEdit downloads the entire file, not just parts that are used in the filter
# * In reference to the note above, MCEdit downloads the libraries on the main thread, so the entire panel may take awhile to show up
# * These libraries can be other file types too, but you have to parse them and remember Note #3
libraries = [
{
"name": "Required Library", # Name of the library, used only for error logging if the library cannot be downloaded
"path": "Common Libraries<sep>required_library.py", # <sep> will be replaced by the OS's path separator
"URL": "https://dl.dropboxusercontent.com/s/9a55rw0on02beig/required_library.py", # URL to the library file
"optional": False, # Will raise an exception if MCEdit cannot download it and will remove the filter from the filter list
},
{
"name": "Optional Library",
"path": "Common Libraries<sep>optional_library.py",
"URL": "<URL to the library>",
"optional": True, # Will try to download the library, will not raise an exception if it cannot be downloaded
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment