mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-05-06 01:14:12 +00:00
Some doc updates
- Fix some spacing in code blocks - Rewrite the index page - You can't see it, but update illuaminate.
This commit is contained in:
parent
fa78818069
commit
8aa7695fdd
48
README.md
48
README.md
@ -1,40 +1,11 @@
|
|||||||
# 
|
# 
|
||||||
[](https://github.com/SquidDev-CC/CC-Tweaked/actions "Current build status") [](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")
|
[](https://github.com/SquidDev-CC/CC-Tweaked/actions "Current build status") [][CurseForge]
|
||||||
|
|
||||||
CC: Tweaked is a fork of [ComputerCraft](https://github.com/dan200/ComputerCraft), adding programmable computers,
|
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the
|
||||||
turtles and more to Minecraft.
|
much-beloved [ComputerCraft], it continues its legacy with better performance, stability, and a wealth of new features.
|
||||||
|
|
||||||
## What?
|
CC: Tweaked can be installed from [CurseForge] or [Modrinth]. It requires the [Minecraft Forge][forge] mod loader, but
|
||||||
ComputerCraft has always held a fond place in my heart: it's the mod which really got me into Minecraft, and it's the
|
[versions are available for Fabric][ccrestitched].
|
||||||
mod which has kept me playing it for many years. However, development of the original mod has slowed, as the original
|
|
||||||
developers have had less time to work on the mod, and moved onto other projects and commitments.
|
|
||||||
|
|
||||||
CC: Tweaked (or CC:T for short) is an attempt to continue ComputerCraft's legacy. It's not intended to be a competitor
|
|
||||||
to CC, nor do I want to take it in a vastly different direction to the original mod. Instead, CC:T focuses on making the
|
|
||||||
ComputerCraft experience as _solid_ as possible, ironing out any wrinkles that may have developed over time.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
CC: Tweaked contains all the features of the latest version of ComputerCraft, as well as numerous fixes, performance
|
|
||||||
improvements and several nifty additions. I'd recommend checking out [the releases page](https://github.com/SquidDev-CC/CC-Tweaked/releases)
|
|
||||||
to see the full set of changes, but here's a couple of the more interesting additions:
|
|
||||||
|
|
||||||
- Improvements to the `http` library, including websockets, support for other HTTP methods (`PUT`, `DELETE`, etc...)
|
|
||||||
and configurable limits on HTTP usage.
|
|
||||||
- Full-block wired modems, allowing one to wrap non-solid peripherals (such as turtles, or chests if Plethora is
|
|
||||||
installed).
|
|
||||||
- Pocket computers can be held like maps, allowing you to view the screen without entering a GUI.
|
|
||||||
- Printed pages and books can be placed in item frames and held like maps.
|
|
||||||
- Several profiling and administration tools for server owners, via the `/computercraft` command. This allows operators
|
|
||||||
to track which computers are hogging resources, turn on and shutdown multiple computers at once and interact with
|
|
||||||
computers remotely.
|
|
||||||
- Closer emulation of standard Lua, adding the `debug` and `io` libraries. This also enables seeking within binary
|
|
||||||
files, meaning you don't need to read large files into memory.
|
|
||||||
- Allow running multiple computers on multiple threads, reducing latency on worlds with many computers.
|
|
||||||
|
|
||||||
## 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
|
## Contributing
|
||||||
Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you want to get started
|
Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you want to get started
|
||||||
@ -46,8 +17,7 @@ ComputerCraft we have a [forum](https://forums.computercraft.cc/) and [Discord g
|
|||||||
There's also a fairly populated, albeit quiet [IRC channel](http://webchat.esper.net/?channels=computercraft), if that's
|
There's also a fairly populated, albeit quiet [IRC channel](http://webchat.esper.net/?channels=computercraft), if that's
|
||||||
more your cup of tea.
|
more your cup of tea.
|
||||||
|
|
||||||
I'd generally recommend you don't contact me directly (email, DM, etc...) unless absolutely necessary (i.e. in order to
|
We also host fairly comprehensive documentation at [tweaked.cc](https://tweaked.cc/ "The CC: Tweaked website").
|
||||||
report exploits). You'll get a far quicker response if you ask the whole community!
|
|
||||||
|
|
||||||
## Using
|
## 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)
|
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)
|
||||||
@ -70,3 +40,9 @@ exposing more features.
|
|||||||
|
|
||||||
We bundle the API sources with the jar, so documentation should be easily viewable within your editor. Alternatively,
|
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](https://tweaked.cc/javadoc/).
|
the generated documentation [can be browsed online](https://tweaked.cc/javadoc/).
|
||||||
|
|
||||||
|
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
|
||||||
|
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
|
||||||
|
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
|
||||||
|
[forge]: https://files.minecraftforge.net/ "Download Minecraft Forge."
|
||||||
|
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"
|
||||||
|
BIN
doc/images/basic-terminal.png
Normal file
BIN
doc/images/basic-terminal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
BIN
doc/images/peripherals.png
Normal file
BIN
doc/images/peripherals.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
BIN
doc/images/turtle.png
Normal file
BIN
doc/images/turtle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 163 KiB |
56
doc/index.md
56
doc/index.md
@ -1,11 +1,55 @@
|
|||||||
#  [](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")
|
# 
|
||||||
|
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 better performance, stability, and a wealth of new features.
|
||||||
|
|
||||||
CC: Tweaked is a fork of [ComputerCraft], adding programmable computers, turtles and more to Minecraft.
|
CC: Tweaked can be installed from [CurseForge] or [Modrinth]. It requires the [Minecraft Forge][forge] mod loader, but
|
||||||
|
[versions are available for Fabric][ccrestitched].
|
||||||
|
|
||||||
This website contains documentation for all Lua libraries and APIs from the latest version of CC: Tweaked. This
|
## Features
|
||||||
documentation is still in development, so will most likely be incomplete. If you've found something you think is wrong,
|
Controlled using the [Lua programming language][lua], CC: Tweaked's computers provides all the tools you need to start
|
||||||
or would like to help out [please get in touch on GitHub][gh].
|
writing code and automating your Minecraft world.
|
||||||
|
|
||||||
|
{.big-image}
|
||||||
|
|
||||||
|
While computers are incredibly powerful, they're rather limited by their inability to move about. *Turtles* are the
|
||||||
|
solution here. They can move about the world, placing and breaking blocks, swinging a sword to protect you from zombies,
|
||||||
|
or whatever else you program them to!
|
||||||
|
|
||||||
|
{.big-image}
|
||||||
|
|
||||||
|
Not all problems can be solved with a pickaxe though, and so CC: Tweaked also provides a bunch of additional peripherals
|
||||||
|
for your computers. You can play a tune with speakers, display text or images on a monitor, connect all your
|
||||||
|
computers together with modems, and much more.
|
||||||
|
|
||||||
|
Computers can now also interact with inventories such as chests, allowing you to build complex inventory and item
|
||||||
|
management systems.
|
||||||
|
|
||||||
|
{.big-image}
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
While ComputerCraft is lovely for both experienced programmers and for people who have never coded before, it can be a
|
||||||
|
little daunting getting started. Thankfully, there's several fantastic tutorials out there:
|
||||||
|
|
||||||
|
- [Direwolf20's ComputerCraft tutorials](https://www.youtube.com/watch?v=wrUHUhfCY5A "ComputerCraft Tutorial Episode 1 - HELP! and Hello World")
|
||||||
|
- [Sethbling's ComputerCraft series](https://www.youtube.com/watch?v=DSsx4VSe-Uk "Programming Tutorial with Minecraft Turtles -- Ep. 1: Intro to Turtles and If-Then-Else_End")
|
||||||
|
- [Lyqyd's Computer Basics 1](http://www.computercraft.info/forums2/index.php?/topic/15033-computer-basics-i/ "Computer Basics I")
|
||||||
|
|
||||||
|
Once you're a little more familiar with the mod, the sidebar and links below provide more detailed documentation on the
|
||||||
|
various APIs and peripherals provided by the mod.
|
||||||
|
|
||||||
|
If you get stuck, do pop in to the [Minecraft Computer Mod Discord guild][discord] or ComputerCraft's
|
||||||
|
[IRC channel][irc].
|
||||||
|
|
||||||
|
## Get Involved
|
||||||
|
CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please do [create an issue][bug].
|
||||||
|
|
||||||
|
[github]: https://github.com/SquidDev-CC/CC-Tweaked/ "CC: Tweaked on GitHub"
|
||||||
[bug]: https://github.com/SquidDev-CC/CC-Tweaked/issues/new/choose
|
[bug]: https://github.com/SquidDev-CC/CC-Tweaked/issues/new/choose
|
||||||
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
|
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
|
||||||
[gh]: https://github.com/SquidDev-CC/CC-Tweaked "CC:Tweaked on GitHub"
|
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
|
||||||
|
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
|
||||||
|
[forge]: https://files.minecraftforge.net/ "Download Minecraft Forge."
|
||||||
|
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"
|
||||||
|
[lua]: https://www.lua.org/ "Lua's main website"
|
||||||
|
[discord]: https://discord.computercraft.cc "The Minecraft Computer Mods Discord"
|
||||||
|
[irc]: http://webchat.esper.net/?channels=computercraft "IRC webchat on EsperNet"
|
||||||
|
@ -30,15 +30,15 @@ import dan200.computercraft.core.computer.ComputerSide;
|
|||||||
*
|
*
|
||||||
* @cc.usage Toggle the redstone signal above the computer every 0.5 seconds.
|
* @cc.usage Toggle the redstone signal above the computer every 0.5 seconds.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* while true do
|
* while true do
|
||||||
* redstone.setOutput("top", not redstone.getOutput("top"))
|
* redstone.setOutput("top", not redstone.getOutput("top"))
|
||||||
* sleep(0.5)
|
* sleep(0.5)
|
||||||
* end
|
* end
|
||||||
* </pre>
|
* }</pre>
|
||||||
* @cc.usage Mimic a redstone comparator in [subtraction mode][comparator].
|
* @cc.usage Mimic a redstone comparator in [subtraction mode][comparator].
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* while true do
|
* while true do
|
||||||
* local rear = rs.getAnalogueInput("back")
|
* local rear = rs.getAnalogueInput("back")
|
||||||
* local sides = math.max(rs.getAnalogueInput("left"), rs.getAnalogueInput("right"))
|
* local sides = math.max(rs.getAnalogueInput("left"), rs.getAnalogueInput("right"))
|
||||||
@ -46,7 +46,7 @@ import dan200.computercraft.core.computer.ComputerSide;
|
|||||||
*
|
*
|
||||||
* os.pullEvent("redstone") -- Wait for a change to inputs.
|
* os.pullEvent("redstone") -- Wait for a change to inputs.
|
||||||
* end
|
* end
|
||||||
* </pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* [comparator]: https://minecraft.gamepedia.com/Redstone_Comparator#Subtract_signal_strength "Redstone Comparator on
|
* [comparator]: https://minecraft.gamepedia.com/Redstone_Comparator#Subtract_signal_strength "Redstone Comparator on
|
||||||
* the Minecraft wiki."
|
* the Minecraft wiki."
|
||||||
@ -205,9 +205,9 @@ public class RedstoneAPI implements ILuaAPI
|
|||||||
* @param mask The mask to test.
|
* @param mask The mask to test.
|
||||||
* @return If the colours are on.
|
* @return If the colours are on.
|
||||||
* @cc.usage Check if @{colors.white} and @{colors.black} are on above the computer.
|
* @cc.usage Check if @{colors.white} and @{colors.black} are on above the computer.
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* print(redstone.testBundledInput("top", colors.combine(colors.white, colors.black)))
|
* print(redstone.testBundledInput("top", colors.combine(colors.white, colors.black)))
|
||||||
* </pre>
|
* }</pre>
|
||||||
* @see #getBundledInput
|
* @see #getBundledInput
|
||||||
*/
|
*/
|
||||||
@LuaFunction
|
@LuaFunction
|
||||||
|
@ -91,9 +91,9 @@ public class CommandAPI implements ILuaAPI
|
|||||||
* @cc.treturn number|nil The number of "affected" objects, or `nil` if the command failed. The definition of this
|
* @cc.treturn number|nil The number of "affected" objects, or `nil` if the command failed. The definition of this
|
||||||
* varies from command to command.
|
* varies from command to command.
|
||||||
* @cc.usage Set the block above the command computer to stone.
|
* @cc.usage Set the block above the command computer to stone.
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* commands.exec("setblock ~ ~1 ~ minecraft:stone")
|
* commands.exec("setblock ~ ~1 ~ minecraft:stone")
|
||||||
* </pre>
|
* }</pre>
|
||||||
*/
|
*/
|
||||||
@LuaFunction( mainThread = true )
|
@LuaFunction( mainThread = true )
|
||||||
public final Object[] exec( String command )
|
public final Object[] exec( String command )
|
||||||
@ -117,9 +117,9 @@ public class CommandAPI implements ILuaAPI
|
|||||||
* @return The "task id". When this command has been executed, it will queue a `task_complete` event with a matching id.
|
* @return The "task id". When this command has been executed, it will queue a `task_complete` event with a matching id.
|
||||||
* @throws LuaException (hidden) If the task cannot be created.
|
* @throws LuaException (hidden) If the task cannot be created.
|
||||||
* @cc.usage Asynchronously sets the block above the computer to stone.
|
* @cc.usage Asynchronously sets the block above the computer to stone.
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* commands.execAsync("~ ~1 ~ minecraft:stone")
|
* commands.execAsync("~ ~1 ~ minecraft:stone")
|
||||||
* </pre>
|
* }</pre>
|
||||||
* @cc.see parallel One may also use the parallel API to run multiple commands at once.
|
* @cc.see parallel One may also use the parallel API to run multiple commands at once.
|
||||||
*/
|
*/
|
||||||
@LuaFunction
|
@LuaFunction
|
||||||
|
@ -28,11 +28,11 @@ import javax.annotation.Nullable;
|
|||||||
* @cc.module monitor
|
* @cc.module monitor
|
||||||
* @cc.usage Write "Hello, world!" to an adjacent monitor:
|
* @cc.usage Write "Hello, world!" to an adjacent monitor:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* local monitor = peripheral.find("monitor")
|
* local monitor = peripheral.find("monitor")
|
||||||
* monitor.setCursorPos(1, 1)
|
* monitor.setCursorPos(1, 1)
|
||||||
* monitor.write("Hello, world!")
|
* monitor.write("Hello, world!")
|
||||||
* </pre>
|
* }</pre>
|
||||||
*/
|
*/
|
||||||
public class MonitorPeripheral extends TermMethods implements IPeripheral
|
public class MonitorPeripheral extends TermMethods implements IPeripheral
|
||||||
{
|
{
|
||||||
|
@ -25,13 +25,13 @@ import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
|
|||||||
* This API is only available on pocket computers. As such, you may use its presence to determine what kind of computer
|
* This API is only available on pocket computers. As such, you may use its presence to determine what kind of computer
|
||||||
* you are using:
|
* you are using:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* if pocket then
|
* if pocket then
|
||||||
* print("On a pocket computer")
|
* print("On a pocket computer")
|
||||||
* else
|
* else
|
||||||
* print("On something else")
|
* print("On something else")
|
||||||
* end
|
* end
|
||||||
* </pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* @cc.module pocket
|
* @cc.module pocket
|
||||||
*/
|
*/
|
||||||
|
@ -16,10 +16,12 @@ The structure of this module is based on [A Prettier Printer][prettier].
|
|||||||
|
|
||||||
@module cc.pretty
|
@module cc.pretty
|
||||||
@usage Print a table to the terminal
|
@usage Print a table to the terminal
|
||||||
|
|
||||||
local pretty = require "cc.pretty"
|
local pretty = require "cc.pretty"
|
||||||
pretty.print(pretty.pretty({ 1, 2, 3 }))
|
pretty.print(pretty.pretty({ 1, 2, 3 }))
|
||||||
|
|
||||||
@usage Build a custom document and display it
|
@usage Build a custom document and display it
|
||||||
|
|
||||||
local pretty = require "cc.pretty"
|
local pretty = require "cc.pretty"
|
||||||
pretty.print(pretty.group(pretty.text("hello") .. pretty.space_line .. pretty.text("world")))
|
pretty.print(pretty.group(pretty.text("hello") .. pretty.space_line .. pretty.text("world")))
|
||||||
]]
|
]]
|
||||||
@ -74,6 +76,7 @@ end
|
|||||||
-- colour.
|
-- colour.
|
||||||
-- @treturn Doc The document with the provided text.
|
-- @treturn Doc The document with the provided text.
|
||||||
-- @usage Write some blue text.
|
-- @usage Write some blue text.
|
||||||
|
--
|
||||||
-- local pretty = require "cc.pretty"
|
-- local pretty = require "cc.pretty"
|
||||||
-- pretty.print(pretty.text("Hello!", colours.blue))
|
-- pretty.print(pretty.text("Hello!", colours.blue))
|
||||||
local function text(text, colour)
|
local function text(text, colour)
|
||||||
@ -455,6 +458,7 @@ end
|
|||||||
-- `function: xxxxxxxx` (`false` by default).
|
-- `function: xxxxxxxx` (`false` by default).
|
||||||
-- @treturn Doc The object formatted as a document.
|
-- @treturn Doc The object formatted as a document.
|
||||||
-- @usage Display a table on the screen
|
-- @usage Display a table on the screen
|
||||||
|
--
|
||||||
-- local pretty = require "cc.pretty"
|
-- local pretty = require "cc.pretty"
|
||||||
-- pretty.print(pretty.pretty({ 1, 2, 3 }))
|
-- pretty.print(pretty.pretty({ 1, 2, 3 }))
|
||||||
local function pretty(obj, options)
|
local function pretty(obj, options)
|
||||||
|
@ -290,6 +290,7 @@ end
|
|||||||
-- @treturn number The index of the created process.
|
-- @treturn number The index of the created process.
|
||||||
-- @see os.run
|
-- @see os.run
|
||||||
-- @usage Run the "hello" program, and set its title to "Hello!"
|
-- @usage Run the "hello" program, and set its title to "Hello!"
|
||||||
|
--
|
||||||
-- local id = multishell.launch({}, "/rom/programs/fun/hello.lua")
|
-- local id = multishell.launch({}, "/rom/programs/fun/hello.lua")
|
||||||
-- multishell.setTitle(id, "Hello!")
|
-- multishell.setTitle(id, "Hello!")
|
||||||
function multishell.launch(tProgramEnv, sProgramPath, ...)
|
function multishell.launch(tProgramEnv, sProgramPath, ...)
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
/* Some misc styles */
|
||||||
|
|
||||||
|
.big-image {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Pretty tables, mostly inherited from table.definition-list */
|
/* Pretty tables, mostly inherited from table.definition-list */
|
||||||
table.pretty-table {
|
table.pretty-table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user