< Home | Recrafted | Blog | About >
Recrafted 1.3.0
Recrafted (source) is a saner re-implementation of CC: Tweaked's CraftOS under the MIT license. It uses no code from CraftOS without the explicit permission of the authors of that code (e.g. cc.audio.dfpwm has been lifted from CraftOS with the permission of its author, but cc.shell.completion has been re-implemented).
Improvements in Recrafted
1. ComputerCraft's source code (including, but not limited to, CraftOS) is licensed under the ComputerCraft Public License, or CCPL. The TL;DR of this license is that if project A uses code from project B, and project B is licensed under the CCPL, then project A must also be licensed under the CCPL. Copying code from CraftOS under a different license *might* be fine - but is, at best, of questionable legality. By contrast, Recrafted is licensed under the very permissive MIT License.
2. Globals. Globals, globals, globals. A standard Lua environment has some of them. CC: Tweaked with CraftOS adds a whopping 30 more globals (68, vs 39 for a standard Lua 5.1 installation), almost all of them unnecessary thanks to the package library that Lua provides. By comparison, CC: Tweaked with Recrafted adds only 3 more globals over the standard environment, and uses the package library wherever possible. This results in much less global clutter.
2.1. The abomination that is os.loadAPI has been completely omitted from Recrafted. Certain Lua 5.1 globals have been removed or wrapped to bring the environment closer to 5.2.
3. Under CraftOS, Multishell isn't usable except on an advanced computer, and is not usable using the keyboard alone. Recrafted's Multishell is baked right into the scheduler, and supports keyboard controls: rightAlt+Left and rightAlt+Right to switch tabs, and rightAlt+Up/rightAlt+Down to scroll the tab bar if too many tabs are open to fit on the screen at once.
4. I mentioned a scheduler in point 3. Recrafted supports native multithreading out-of-the-box, with no need for custom coroutine schedulers, through the rc.thread API.
That's neat. How do I use it?
There are two supported ways to use Recrafted. I recommend installing the entire repository as a datapack. You can also use the provided installer, which will install Recrafted running inside UnBIOS.
Because Recrafted can run either from ROM or from /rc, programs that need to access system files should do so through /rc - when running from ROM, it's provided as a virtual directory.
Where can I find docs?
CraftOS APIs should behave exactly as documented on the CC: Tweaked wiki, and be under the same names - you just have to load them with local api = require("api")_ first.
The exception to this is the OS API, where all non-standard functions (e.g. version, epoch, pullEvent) have been moved to the rc API for cleanliness.
Currently documented Recrafted APIs (or API extensions) include:
- textutils
- term
- rc.thread
- rc.copy
- cc.strings