inventory
Functionality for resolving EnderChest and shulker box states
get_instances_matching_shulker_box(minecraft_root, shulker_box_name)
Get the list of registered instances that link to the specified shulker box
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 you're asking about |
required |
Returns:
Type | Description |
---|---|
list of InstanceSpec
|
The instances that are / should be linked to the specified shulker box |
Source code in enderchest/inventory.py
get_shulker_boxes_matching_instance(minecraft_root, instance_name)
Get the list of shulker boxes that the specified instance links to
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 |
instance_name |
str
|
The name of the instance you're asking about |
required |
Returns:
Type | Description |
---|---|
list of ShulkerBox
|
The shulker boxes that are linked to by the specified instance |
Source code in enderchest/inventory.py
load_ender_chest(minecraft_root)
Load the configuration from the enderchest.cfg file in 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 |
Returns:
Type | Description |
---|---|
EnderChest
|
The EnderChest configuration |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If no EnderChest folder exists in the given minecraft root or if no enderchest.cfg file exists within that EnderChest folder |
ValueError
|
If the EnderChest configuration is invalid and could not be parsed |
Source code in enderchest/inventory.py
load_ender_chest_instances(minecraft_root, log_level=logging.INFO)
Get the list of instances registered with the EnderChest located in 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 |
log_level |
int
|
By default, this method will report out the minecraft instances it finds at the INFO level. You can optionally pass in a lower (or higher) level if this method is being called from another method where that information is redundant or overly verbose. |
INFO
|
Returns:
Type | Description |
---|---|
list of InstanceSpec
|
The instances registered with the EnderChest |
Notes
If no EnderChest is installed in the given location, then this will return an empty list rather than failing outright.
Source code in enderchest/inventory.py
load_ender_chest_remotes(minecraft_root, log_level=logging.INFO)
Load all remote EnderChest installations registered with this one
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 |
log_level |
int
|
By default, this method will report out the minecraft instances it finds at the INFO level. You can optionally pass in a lower (or higher) level if this method is being called from another method where that information is redundant or overly verbose. |
INFO
|
Returns:
Type | Description |
---|---|
list of (URI, str) tuples
|
The URIs of the remote EnderChests, paired with their aliases |
Notes
If no EnderChest is installed in the given location, then this will return an empty list rather than failing outright.
Source code in enderchest/inventory.py
load_shulker_boxes(minecraft_root, log_level=logging.INFO)
Load all shulker boxes in the EnderChest folder and return them in the order in which they should be linked.
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 |
log_level |
int
|
By default, this method will report out the minecraft instances it finds at the INFO level. You can optionally pass in a lower (or higher) level if this method is being called from another method where that information is redundant or overly verbose. |
INFO
|
Returns:
Type | Description |
---|---|
list of ShulkerBoxes
|
The shulker boxes found in the EnderChest folder, ordered in terms of the sequence in which they should be linked |
Notes
If no EnderChest is installed in the given location, then this will return an empty list rather than failing outright.
Source code in enderchest/inventory.py
render_instance(instance)
Render an instance spec to a descriptive string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance |
InstanceSpec
|
The instance spec to render |
required |
Returns:
Type | Description |
---|---|
str
|
{instance.name} ({instance.root}) |
Source code in enderchest/inventory.py
report_shulker_boxes(shulker_boxes, log_level, ender_chest_name)
Log the list of shulker boxes in the order they'll be linked