![Jonathan Coates](/assets/img/avatar_default.png)
The most annoying thing about pocket computers is handling computer state (label, upgrades, etc...). Unlike other computers, which are tied to a specific block entity, pocket computers float untethered. We can't hold a reference to a specific item stack (as the computer might be moved between inventories, crafted, etc...), so instead we explicitly sync data between the computer and *current* stack, whenever the holding player/entity is ticked. In ed0b156e05ff64784f2f80346c82ab5142d954dc I rewrote this syncing code to always treat the computer as the source of truth. Upgrades would be copied to the computer, but never the other way round. However, this meant that upgrades obtained by crafting would never be detected, requiring the computer to be destroyed and recreated. A more long-term fix here is probably to rewrite IPocketAccess to only allow updating upgrade data on the main thread, and when we have a valid PocketHolder. This is a breaking API change though, and so will have to wait for 1.21.3. For now, we just add a hook that refreshes the upgrade after crafting. Fixes #1957
![CC: Tweaked](/mirrors/CC-Tweaked/media/commit/dcc74e15c7ab88e5ec7bb4c83ca00d49c074b615/doc/logo.png)
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the much-beloved ComputerCraft, it continues its legacy with improved performance and stability, along with a wealth of new features.
CC: Tweaked can be installed from CurseForge or Modrinth. It runs on both Minecraft Forge and Fabric.
Contributing
Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you want to get started developing the mod, check out the instructions here.
Community
If you need help getting started with CC: Tweaked, want to show off your latest project, or just want to chat about
ComputerCraft, do check out our GitHub discussions page! There's also a fairly populated,
albeit quiet IRC channel on EsperNet, if that's more your cup of tea. You can join #computercraft
through your
desktop client, or online using KiwiIRC.
We also host fairly comprehensive documentation at tweaked.cc.
Using
CC: Tweaked is hosted on my maven repo, and so is relatively simple to depend on. You may wish to add a soft (or hard)
dependency in your mods.toml
file, with the appropriate version bounds, to ensure that API functionality you depend
on is present.
repositories {
maven {
url "https://maven.squiddev.cc"
content {
includeGroup("cc.tweaked")
}
}
}
dependencies {
// Vanilla (i.e. for multi-loader systems)
compileOnly("cc.tweaked:cc-tweaked-$mcVersion-common-api:$cctVersion")
// Forge Gradle
compileOnly("cc.tweaked:cc-tweaked-$mcVersion-core-api:$cctVersion")
compileOnly(fg.deobf("cc.tweaked:cc-tweaked-$mcVersion-forge-api:$cctVersion"))
runtimeOnly(fg.deobf("cc.tweaked:cc-tweaked-$mcVersion-forge:$cctVersion"))
// Fabric Loom
modCompileOnly("cc.tweaked:cc-tweaked-$mcVersion-fabric-api:$cctVersion")
modRuntimeOnly("cc.tweaked:cc-tweaked-$mcVersion-fabric:$cctVersion")
}
When using ForgeGradle, you may also need to add the following:
minecraft {
runs {
configureEach {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
}
}
}
You should also be careful to only use classes within the dan200.computercraft.api
package. Non-API classes are
subject to change at any point. If you depend on functionality outside the API (or need to mixin to CC:T), please file
an issue to let me know!
We bundle the API sources with the jar, so documentation should be easily viewable within your editor. Alternatively, the generated documentation can be browsed online.