1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-16 10:09:55 +00:00
Modernized/improved/actually updated version of ComputerCraft: https://tweaked.cc
Go to file
SquidDev 12e82afad2 Bump Cobalt version to enable single-threading
The latest version of Cobalt has several major changes, which I'm
looking forward to taking advantage of in the coming months:

 - The Lua interpreter has been split up from the actual LuaClosure
   instance. It now runs multiple functions within one loop, handling
   pushing/popping and resuming method calls correctly.

   This means we have a theoretically infinite call depth, as we're no
   longer bounded by Java's stack size. In reality, this is limited to
   32767 (Short.MAX_VALUE), as that's a mostly equivalent to the limits
   PUC Lua exposes.

 - The stack is no longer unwound in the event of errors. This both
   simplifies error handling (not that CC:T needs to care about that)
   but also means one can call debug.traceback on a now-dead coroutine
   (which is more useful for debugging than using xpcall).

 - Most significantly, coroutines are no longer each run on a dedicated
   thread. Instead, yielding or resuming throws an exception to unwind
   the Java stack and switches to a different coroutine.

   In order to preserve compatability with CC's assumption about LuaJ's
   threading model (namely that yielding blocks the thread), we also
   provide a yieldBlock method (which CC:T consumes). This suspends the
   current thread and switches execution to a new thread (see
   SquidDev/Cobalt@b5ddf164f1 for more
   details). While this does mean we need to use more than 1 thread,
   it's still /substantially/ less than would otherwise be needed.

We've been running these changes on SwitchCraft for a few days now and
haven't seen any issues. One nice thing to observe is that the number of
CC thread has gone down from ~1.9k to ~100 (of those, ~70 are dedicated
to running coroutines). Similarly, the server has gone from generating
~15k threads over its lifetime, to ~3k. While this is still a lot, it's
a substantial improvement.
2019-02-10 22:02:30 +00:00
.github Add a pull request template 2018-08-24 17:37:20 +01:00
gradle/wrapper Update Gradle and build system 2017-11-14 22:42:03 +00:00
src Bump Cobalt version to enable single-threading 2019-02-10 22:02:30 +00:00
.editorconfig A wee bit of a cleanup of the API 2018-12-17 21:33:49 +00:00
.gitignore WIP: Http rework (#98) 2019-01-11 11:33:05 +00:00
.luacheckrc Add a .luacheckrc file 2018-12-17 18:09:32 +00:00
.travis.yml Build against Oracle JDK 8 instead 2017-09-10 20:45:24 +01:00
build.gradle Bump Cobalt version to enable single-threading 2019-02-10 22:02:30 +00:00
codeStyleSettings.xml Add custom code style settings 2018-12-23 17:45:04 +00:00
gradlew Update Gradle and build system 2017-11-14 22:42:03 +00:00
gradlew.bat Update Gradle and build system 2017-11-14 22:42:03 +00:00
LICENSE Fixed possible Typo. (#337) 2017-06-28 21:39:54 +01:00
LICENSE-luaj ComputerCraft 1.79 initial upload 2017-05-01 14:32:39 +01:00
logo.png Add a subjectively fancy logo 2017-11-15 18:20:22 +00:00
README.md Update README.md (fixes #84) (#85) 2018-12-16 22:13:52 +00:00
settings.gradle A couple of fixes for maven and CCEmuX 2018-04-20 19:39:53 +01:00

CC: Tweaked

Build Status

CC: Tweaked is a fork of ComputerCraft which aims to provide earlier access to the more experimental and in-development features of the mod. For a more stable experience, I recommend checking out the original mod.

What?

CC: Tweaked (or CC:T for short) does not aim to create a competing fork of ComputerCraft, nor am I planning to take it in in a vastly different direction to the original mod. In fact, CC:T aims to be a nurturing ground for various features, with a pull request against the original mod being the end goal.

CC:T also includes many pull requests from the community which have not yet been merged, offering a large number of additional bug fixes and features over the original mod.

Features

CC: Tweaked contains all the features of the latest alpha, as well as numerous fixes, performance improvements and several additional features. I'd recommend checking out the releases page to see the full changes, but here's a couple of the more interesting changes:

  • Replace LuaJ with Cobalt.
  • Allow running multiple computers at the same time.
  • Websocket support in the HTTP library.
  • Wired modems and cables act more like multiparts.
  • Add map-like rendering for pocket computers and printed pages/books.
  • Adds the /computercraft command, offering various diagnostic tools for server owners. This allows operators to track which computers are hogging resources, turn on and shutdown multiple computers at once and interact with computers remotely.
  • Add full-block wired modems, allowing one to wrap non-solid peripherals (such as turtles, or chests if Plethora is installed).
  • Extended binary file handles. They support file seeking, and reading new lines, allowing full (and accurate) emulation of the standard Lua io library.

Relation to CCTweaks?

This mod has nothing to do with CCTweaks, though there is no denying the name is a throwback to it. That being said, several features have been included, such as full block modems, the Cobalt runtime and map-like rendering for pocket computers.

Contributing

Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you do wish to contribute code, do consider submitting it to the ComputerCraft repository first.

That being said, in order to start helping develop CC:T, you'll need to follow these steps:

  • Clone the repository: git clone https://github.com/SquidDev-CC/CC-Tweaked.git && cd CC-Tweaked
  • Setup Forge: ./gradlew setupDecompWorkspace
  • Test your changes: ./gradlew runClient (or run the GradleStart class from your IDE).

If you want to run CC:T in a normal Minecraft instance, run ./gradlew build and copy the .jar from build/libs.