redirectPluginFiles is an action similar to redirect which allows you to redirect paths to another path. redirectPluginFiles only looks at files inside the plugin's folder.
Also fixed bug where the simulator would check the inheritance of strings and functions.
The following has been added to the ScenarioFiles.md file:
redirectPluginFiles
Adds a redirection for files inside the plugin folder. All Cuberite APIs that take a file or folder path check if the file needs to be redirected. This is useful if you want to use a different configuration file in your scenario. It can also be used to insert mocks in the code. The following table should make it clear how it works.
Key provided in dictionary
Value provided in dictionary
Path provided by plugin
Path actually used
config.cfg
config.cfg
Plugins/[myplugin]/config.cfg
[scenarioPath]/config.cfg
Classes/Storage.lua
mocks/Storage.lua
Plugins/[myplugin]/Classes/Storage.lua
[scenarioPath]/mocks/Storage.lua
Takes a dictionary table which maps the old paths to the new paths.
redirectPluginFiles
{
-- Redirect the 'config.cfg' file from the plugin folder to the scenario folder
["config.cfg"] = "config.cfg"
}
redirectPluginFiles
is an action similar toredirect
which allows you to redirect paths to another path.redirectPluginFiles
only looks at files inside the plugin's folder.Also fixed bug where the simulator would check the inheritance of strings and functions.
The following has been added to the ScenarioFiles.md file:
redirectPluginFiles
Adds a redirection for files inside the plugin folder. All Cuberite APIs that take a file or folder path check if the file needs to be redirected. This is useful if you want to use a different configuration file in your scenario. It can also be used to insert mocks in the code. The following table should make it clear how it works.
Takes a dictionary table which maps the old paths to the new paths.