diff --git a/src/main/resources/assets/computercraft/lua/rom/modules/command/.ignoreme b/src/main/resources/assets/computercraft/lua/rom/modules/command/.ignoreme new file mode 100644 index 000000000..4c7191cf1 --- /dev/null +++ b/src/main/resources/assets/computercraft/lua/rom/modules/command/.ignoreme @@ -0,0 +1,4 @@ +--[[ +Alright then, don't ignore me. This file is to ensure the existence of the "modules/command" folder. +You can use this folder to add modules who can be loaded with require() to your Resourcepack. +]] diff --git a/src/main/resources/assets/computercraft/lua/rom/modules/main/.ignoreme b/src/main/resources/assets/computercraft/lua/rom/modules/main/.ignoreme new file mode 100644 index 000000000..046a7aaeb --- /dev/null +++ b/src/main/resources/assets/computercraft/lua/rom/modules/main/.ignoreme @@ -0,0 +1,4 @@ +--[[ +Alright then, don't ignore me. This file is to ensure the existence of the "modules/main" folder. +You can use this folder to add modules who can be loaded with require() to your Resourcepack. +]] diff --git a/src/main/resources/assets/computercraft/lua/rom/modules/turtle/.ignoreme b/src/main/resources/assets/computercraft/lua/rom/modules/turtle/.ignoreme new file mode 100644 index 000000000..3fcc8a952 --- /dev/null +++ b/src/main/resources/assets/computercraft/lua/rom/modules/turtle/.ignoreme @@ -0,0 +1,4 @@ +--[[ +Alright then, don't ignore me. This file is to ensure the existence of the "modules/turtle" folder. +You can use this folder to add modules who can be loaded with require() to your Resourcepack. +]] diff --git a/src/main/resources/assets/computercraft/lua/rom/programs/shell.lua b/src/main/resources/assets/computercraft/lua/rom/programs/shell.lua index 18ddd9248..70d04f463 100644 --- a/src/main/resources/assets/computercraft/lua/rom/programs/shell.lua +++ b/src/main/resources/assets/computercraft/lua/rom/programs/shell.lua @@ -30,7 +30,12 @@ local function createShellEnv( sDir ) string = string, table = table, } - package.path = "?;?.lua;?/init.lua" + package.path = "?;?.lua;?/init.lua;/rom/modules/main/?;/rom/modules/main/?.lua;/rom/modules/main/?/init.lua" + if turtle then + package.path = package.path..";/rom/modules/turtle/?;/rom/modules/turtle/?.lua;/rom/modules/turtle/?/init.lua" + elseif command then + package.path = package.path..";/rom/modules/command/?;/rom/modules/command/?.lua;/rom/modules/command/?/init.lua" + end package.config = "/\n;\n?\n!\n-" package.preload = {} package.loaders = {