filesystem
Functionality for managing the EnderChest and shulker box config files and folders
ender_chest_config(minecraft_root, check_exists=True)
Given a minecraft root directory, return the path to the EnderChest config file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
check_exists |
bool
|
By default, this method will raise an error if the enderchest config
file does not already exist. To disable that check, call this method
with |
True
|
Returns:
Type | Description |
---|---|
Path
|
The path to the EnderChest config file |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the EnderChest config file isn't where it's supposed to be (and checking hasn't been disabled) |
Notes
This method does not check if the config file is valid
Source code in enderchest/filesystem.py
ender_chest_folder(minecraft_root, check_exists=True)
Given a minecraft root directory, return the path to the EnderChest folder
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
check_exists |
bool
|
By default, this method will raise an error if no EnderChest exists
at that location (meaning no folder or no enderchest config file in
that folder). To disable that check, call this method with
|
True
|
Returns:
Type | Description |
---|---|
Path
|
The path to the EnderChest folder |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If no valid EnderChest installation exists within the given minecraft root (and checking hasn't been disabled) |
Source code in enderchest/filesystem.py
links_into_enderchest(minecraft_root, link, check_exists=True)
Determine whether a symlink's target is inside the EnderChest specified by the Minecraft root.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
link |
Path
|
The link to check |
required |
check_exists |
bool
|
By default, this method will raise an error if no EnderChest exists
at that location (meaning no folder or no enderchest config file in
that folder). To disable that check, call this method with
|
True
|
Returns:
Type | Description |
---|---|
bool
|
True if the path is inside of the EnderChest folder. False otherwise. |
Notes
This method only checks the direct target of the link as opposed to the fully resolved path.
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If no valid EnderChest installation exists within the given minecraft root (and checking hasn't been disabled) |
OSError
|
If the link provided isn't actually a symbolic link |
Source code in enderchest/filesystem.py
minecraft_folders(search_path)
Find all .minecraft folders within a given search path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
search_path |
Path
|
The directory to search |
required |
Returns:
Type | Description |
---|---|
list-like of paths
|
The paths to all the .minecraft folders this method could find |
Notes
This method does not check to make sure that those .minecraft folders contain valid minecraft instances, just that they exist
Source code in enderchest/filesystem.py
place_cache(minecraft_root)
Given a minecraft root directory, return the path to the EnderChest place cache file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
Returns:
Type | Description |
---|---|
Path
|
The path to the place cache file |
Notes
This method does not check if the cache file is valid or if it even exists
Source code in enderchest/filesystem.py
shulker_box_config(minecraft_root, shulker_box_name)
Generate the path to a shulker box config file, given its name and the minecraft root directory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
shulker_box_name |
str
|
The name of the shulker box to resolve |
required |
Returns:
Type | Description |
---|---|
Path
|
The path to the shulker box folder |
Notes
This method does not check if a shulker box config exists at that location
Source code in enderchest/filesystem.py
shulker_box_configs(minecraft_root)
Find all shulker box configs on the system
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
Returns:
Type | Description |
---|---|
list-like of paths
|
The paths to all the shulker box configs on the system |
Notes
This method does not check to make sure those config files are valid, just that they exist
Source code in enderchest/filesystem.py
shulker_box_root(minecraft_root, shulker_box_name)
Generate the path to the root of a shulker box, given its name and the minecraft root directory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder) |
required |
shulker_box_name |
str
|
The name of the shulker box to resolve |
required |
Returns:
Type | Description |
---|---|
Path
|
The path to the shulker box folder |
Notes
This method does not check if a shulker box exists at that location