Skip to content

Commit

Permalink
Merge branch 'mc-1.14.x' into mc-1.15.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Apr 23, 2020
2 parents af40f5a + a049502 commit 33260a7
Show file tree
Hide file tree
Showing 15 changed files with 494 additions and 155 deletions.
2 changes: 1 addition & 1 deletion doc/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![CC: Tweaked](logo.png) [![Download CC: Tweaked on CurseForge](http://cf.way2muchnoise.eu/title/cc-tweaked.svg)](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")
# ![CC: Tweaked](logo.png) [![Download CC: Tweaked on CurseForge](https://cf.way2muchnoise.eu/title/cc-tweaked.svg)](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")

CC: Tweaked is a fork of [ComputerCraft], adding programmable computers, turtles and more to Minecraft.

Expand Down
2 changes: 1 addition & 1 deletion doc/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body {
"Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

code, pre, .parameter, .type, .definition-name, .reference {
code, pre, .parameter, .type, .definition-name, .reference-code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mod properties
mod_version=1.86.2
mod_version=1.87.0

# Minecraft properties (update mods.toml when changing)
mc_version=1.15.2
Expand Down
63 changes: 35 additions & 28 deletions illuaminate.sexp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

(sources
/doc/stub/
/src/main/resources/data/computercraft/lua/bios.lua
/src/main/resources/data/computercraft/lua/rom/
/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/
/src/test/resources/test-rom)


(doc
(title "CC: Tweaked")
(index doc/index.md)
Expand All @@ -14,13 +15,13 @@
(library-path
/doc/stub/

/src/main/resources/data/computercraft/lua/rom/apis
/src/main/resources/data/computercraft/lua/rom/apis/command
/src/main/resources/data/computercraft/lua/rom/apis/turtle
/src/main/resources/*/computercraft/lua/rom/apis
/src/main/resources/*/computercraft/lua/rom/apis/command
/src/main/resources/*/computercraft/lua/rom/apis/turtle

/src/main/resources/data/computercraft/lua/rom/modules/main
/src/main/resources/data/computercraft/lua/rom/modules/command
/src/main/resources/data/computercraft/lua/rom/modules/turtle))
/src/main/resources/*/computercraft/lua/rom/modules/main
/src/main/resources/*/computercraft/lua/rom/modules/command
/src/main/resources/*/computercraft/lua/rom/modules/turtle))

(at /
(linters
Expand All @@ -34,9 +35,7 @@
;; be good to find a compromise in the future, but this works for now.
-var:unused-arg

;; Suppress a couple of documentation comments warnings for now. We'll
;; hopefully be able to remove them in the future.
-doc:undocumented -doc:undocumented-arg -doc:unresolved-reference
;; Some APIS (keys, colour and os mainly) are incomplete right now.
-var:unresolved-member)
(lint
(bracket-spaces
Expand All @@ -49,8 +48,8 @@
;; We disable the unused global linter in bios.lua and the APIs. In the future
;; hopefully we'll get illuaminate to handle this.
(at
(/src/main/resources/data/computercraft/lua/bios.lua
/src/main/resources/data/computercraft/lua/rom/apis/)
(/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/apis/)
(linters -var:unused-global)
(lint (allow-toplevel-global true)))

Expand All @@ -59,19 +58,27 @@
(linters -var:unused-global)
(lint (allow-toplevel-global true)))

;; Ensure any fully documented modules stay fully documented.
;; Suppress warnings for currently undocumented modules.
(at
(/doc/stub/commands.lua
/doc/stub/fs.lua
/doc/stub/http.lua
/doc/stub/os.lua
/doc/stub/redstone.lua
/doc/stub/term.lua
/doc/stub/turtle.lua
/src/main/resources/*/computercraft/lua/rom/apis/command/commands.lua
/src/main/resources/*/computercraft/lua/rom/apis/io.lua
/src/main/resources/*/computercraft/lua/rom/apis/window.lua
/src/main/resources/*/computercraft/lua/rom/modules/main/cc/shell/completion.lua)

(linters -doc:undocumented -doc:undocumented-arg))

;; These currently rely on unknown references.
(at
(/src/main/resources/data/computercraft/lua/rom/apis/colors.lua
/src/main/resources/data/computercraft/lua/rom/apis/colours.lua
/src/main/resources/data/computercraft/lua/rom/apis/disk.lua
/src/main/resources/data/computercraft/lua/rom/apis/gps.lua
/src/main/resources/data/computercraft/lua/rom/apis/help.lua
/src/main/resources/data/computercraft/lua/rom/apis/keys.lua
/src/main/resources/data/computercraft/lua/rom/apis/paintutils.lua
/src/main/resources/data/computercraft/lua/rom/apis/parallel.lua
/src/main/resources/data/computercraft/lua/rom/apis/peripheral.lua
/src/main/resources/data/computercraft/lua/rom/apis/rednet.lua
/src/main/resources/data/computercraft/lua/rom/apis/settings.lua
/src/main/resources/data/computercraft/lua/rom/apis/texutils.lua
/src/main/resources/data/computercraft/lua/rom/apis/vector.lua)
(linters doc:undocumented doc:undocumented-arg))
(/src/main/resources/*/computercraft/lua/rom/apis/textutils.lua
/src/main/resources/*/computercraft/lua/rom/modules/main/cc/completion.lua
/src/main/resources/*/computercraft/lua/rom/modules/main/cc/shell/completion.lua
/src/main/resources/*/computercraft/lua/rom/programs/advanced/multishell.lua
/src/main/resources/*/computercraft/lua/rom/programs/shell.lua)
(linters -doc:unresolved-reference))
7 changes: 2 additions & 5 deletions src/main/resources/data/computercraft/lua/bios.lua
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,11 @@ function os.run(_tEnv, _sPath, ...)
expect(1, _tEnv, "table")
expect(2, _sPath, "string")

local tArgs = table.pack(...)
local tEnv = _tEnv
setmetatable(tEnv, { __index = _G })
local fnFile, err = loadfile(_sPath, nil, tEnv)
if fnFile then
local ok, err = pcall(function()
fnFile(table.unpack(tArgs, 1, tArgs.n))
end)
local ok, err = pcall(fnFile, ...)
if not ok then
if err and err ~= "" then
printError(err)
Expand Down Expand Up @@ -926,7 +923,7 @@ settings.define("list.show_hidden", {
})

settings.define("motd.enable", {
default = false,
default = pocket == nil,
description = "Display a random message when the computer starts up.",
type = "boolean",
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
-- This generally returns the same as @{disk.getLabel} for records.
--
-- @tparam string name The name of the disk drive.
-- @treturn string|false|nil The track title, `false` if there is not a music
-- @treturn string|false|nil The track title, @{false} if there is not a music
-- record in the drive or `nil` if no drive is present.
function getAudioTitle(name)
if isDrive(name) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for _, v in ipairs(valid_types) do valid_types[v] = true end
-- you to provide defaults and additional metadata.
--
-- @tparam string name The name of this option
-- @tparam[opt] { description? = string, default? = value, type? = string } options
-- @tparam[opt] { description? = string, default? = any, type? = string } options
-- Options for this setting. This table accepts the following fields:
--
-- - `description`: A description which may be printed when running the `set` program.
Expand Down Expand Up @@ -127,7 +127,7 @@ end
--- Get details about a specific setting.
--
-- @tparam string name The name of the setting to get.
-- @treturn { description? = string, default? = value, type? = string, value? = value }
-- @treturn { description? = string, default? = any, type? = string, value? = any }
-- Information about this setting. This includes all information from @{settings.define},
-- as well as this setting's value.
function getDetails(name)
Expand Down
30 changes: 30 additions & 0 deletions src/main/resources/data/computercraft/lua/rom/help/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# New features in CC: Tweaked 1.87.0

* Add documentation to many Lua functions. This is published online at https://tweaked.cc/.
* Replace to pretty-printer in the Lua REPL. It now supports displaying functions and recursive tables. This printer is may be used within your own code through the `cc.pretty` module.
* Add `fs.getCapacity`. A complement to `fs.getFreeSpace`, this returns the capacity of the supplied drive.
* Add `fs.getAttributes`. This provides file size and type, as well as creation and modification time.
* Update Cobalt version. This backports several features from Lua 5.2 and 5.3:
- The `__len` metamethod may now be used by tables.
- Add `\z`, hexadecimal (`\x00`) and unicode (`\u0000`) string escape codes.
- Add `utf8` lib.
- Mirror Lua's behaviour of tail calls more closely. Native functions are no longer tail called, and tail calls are displayed in the stack trace.
- `table.unpack` now uses `__len` and `__index` metamethods.
- Parser errors now include the token where the error occured.
* Add `textutils.unserializeJSON`. This can be used to decode standard JSON and stringified-NBT.
* The `settings` API now allows "defining" settings. This allows settings to specify a default value and description.
* Enable the motd on non-pocket computers.
* Allow using the menu with the mouse in edit and paint (JakobDev).
* Add Danish and Korean translations (ChristianLW, mindy15963)
* Fire `mouse_up` events in the monitor program.
* Allow specifying a timeout to `websocket.receive`.
* Increase the maximimum limit for websocket messages.
* Optimise capacity checking of computer/disk folders.

And several bug fixes:
* Fix turtle texture being incorrectly oriented (magiczocker10).
* Prevent copying folders into themselves.
* Normalise file paths within shell.setDir (JakobDev)
* Fix turtles treating waterlogged blocks as water.
* Register an entity renderer for the turtle's fake player.

# New features in CC: Tweaked 1.86.2

* Fix peripheral.getMethods returning an empty table
Expand Down
32 changes: 28 additions & 4 deletions src/main/resources/data/computercraft/lua/rom/help/whatsnew.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
New features in CC: Tweaked 1.86.2
New features in CC: Tweaked 1.87.0

* Fix peripheral.getMethods returning an empty table
* Update to Minecraft 1.15.2. This is currently alpha-quality and so is missing
missing features and may be unstable.
* Add documentation to many Lua functions. This is published online at https://tweaked.cc/.
* Replace to pretty-printer in the Lua REPL. It now supports displaying functions and recursive tables. This printer is may be used within your own code through the `cc.pretty` module.
* Add `fs.getCapacity`. A complement to `fs.getFreeSpace`, this returns the capacity of the supplied drive.
* Add `fs.getAttributes`. This provides file size and type, as well as creation and modification time.
* Update Cobalt version. This backports several features from Lua 5.2 and 5.3:
- The `__len` metamethod may now be used by tables.
- Add `\z`, hexadecimal (`\x00`) and unicode (`\u0000`) string escape codes.
- Add `utf8` lib.
- Mirror Lua's behaviour of tail calls more closely. Native functions are no longer tail called, and tail calls are displayed in the stack trace.
- `table.unpack` now uses `__len` and `__index` metamethods.
- Parser errors now include the token where the error occured.
* Add `textutils.unserializeJSON`. This can be used to decode standard JSON and stringified-NBT.
* The `settings` API now allows "defining" settings. This allows settings to specify a default value and description.
* Enable the motd on non-pocket computers.
* Allow using the menu with the mouse in edit and paint (JakobDev).
* Add Danish and Korean translations (ChristianLW, mindy15963)
* Fire `mouse_up` events in the monitor program.
* Allow specifying a timeout to `websocket.receive`.
* Increase the maximimum limit for websocket messages.
* Optimise capacity checking of computer/disk folders.

And several bug fixes:
* Fix turtle texture being incorrectly oriented (magiczocker10).
* Prevent copying folders into themselves.
* Normalise file paths within shell.setDir (JakobDev)
* Fix turtles treating waterlogged blocks as water.
* Register an entity renderer for the turtle's fake player.

Type "help changelog" to see the full version history.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local completion = require "cc.completion"

--- Complete the name of a file relative to the current working directory.
--
-- @tparam shell shell The shell we're completing in
-- @tparam table shell The shell we're completing in
-- @tparam { string... } choices The list of choices to complete from.
-- @treturn { string... } A list of suffixes of matching files.
local function file(shell, text)
Expand All @@ -25,7 +25,7 @@ end

--- Complete the name of a directory relative to the current working directory.
--
-- @tparam shell shell The shell we're completing in
-- @tparam table shell The shell we're completing in
-- @tparam { string... } choices The list of choices to complete from.
-- @treturn { string... } A list of suffixes of matching directories.
local function dir(shell, text)
Expand All @@ -35,7 +35,7 @@ end
--- Complete the name of a file or directory relative to the current working
-- directory.
--
-- @tparam shell shell The shell we're completing in
-- @tparam table shell The shell we're completing in
-- @tparam { string... } choices The list of choices to complete from.
-- @tparam { string... } previous The shell arguments before this one.
-- @tparam[opt] boolean add_space Whether to add a space after the completed item.
Expand All @@ -61,9 +61,10 @@ end

--- Complete the name of a program.
--
-- @tparam shell shell The shell we're completing in
-- @tparam table shell The shell we're completing in
-- @tparam { string... } choices The list of choices to complete from.
-- @treturn { string... } A list of suffixes of matching programs.
-- @see shell.completeProgram
local function program(shell, text)
return shell.completeProgram(text)
end
Expand Down
36 changes: 8 additions & 28 deletions src/main/resources/data/computercraft/lua/rom/motd.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
View the source code at https://github.com/SquidDev-CC/CC-Tweaked
Please report bugs at https://github.com/SquidDev-CC/CC-Tweaked. Thanks!
View the documentation at https://wiki.computercraft.cc
Visit the forum at https://forums.computercraft.cc
Show off your programs or ask for help at our forum: https://forums.computercraft.cc
You can disable these messages by running "set motd.enable false".
You can create directories with "mkdir".
Want to see hidden files? Run "set list.show_hidden true".
Run "list" or "ls" to see all files in a directory.
You can delete files and directories with "delete" or "rm".
Use "pastebin put" to upload a program to pastebin.
Use "pastebin get" to download a program from pastebin.
Use "pastebin run" to run a program from pastebin.
Use the "edit" program to create and edit your programs.
You can copy files with "copy" or "cp".
You can use "wget run <url>" to run a program from the internet.
You can use "wget" to download a file from the internet.
On an advanced computer you can use "fg" or "bg" to run multiple programs at the same time.
Use "type" to see if a path is a file or a directory.
Get a list of all programs with "programs".
Use an advanced computer to use colours and the mouse.
With a speaker you can play sounds.
Use "motd" to print the Message of the Day.
You can disable the startup from a computer with "set shell.allow_startup false".
You can disable the startup from a disk with "set shell.allow_disk_startup false".
Programs that are placed in the "startup" folder in the root of a computer are started on boot.
Use a modem to connect with other computers.
With the "gps" program you can get the position of a computer.
Use "monitor" to run a program on a attached monitor.
View all attached peripherals with "peripherals".
Use "time" to see the in-game time.
You can set the label of a computer with "label set".
A computer needs a label to keep its files if it is destroyed.
You can disable auto completion in the shell with "set shell.autocomplete false".
You can disable auto completion in edit with "set edit.autocomplete false".
Don't forget to label your computer with "label set".
Feeling creative? Use a printer to print a book!
Files beginning with a "." character are hidden from "list" by default.
Files beginning with a "." are hidden from "list" by default.
Running "set" lists the current values of all settings.
Some programs are only available on advanced computers, turtles, pocket computers, or command computers.
The "equip" and "unequip" programs let you add or remove supported upgrades from a turtle or pocket computer without crafting.
You can change the color of a disk by crafting it with dye.
Right-clicking a turtle with a dye changes its color.
Some programs are only available on advanced computers, turtles, pocket computers or command computers.
The "equip" programs let you add upgrades to a turtle without crafting.
You can change the color of a disk by crafting or right clicking it with dye.
You can print on a printed page again to get multiple colors.
Holding the Control and T keys terminates the running program.
Holding Control and S or R shuts down or reboots the computer you are using.
Holding the Ctrl and T keys terminates the running program.
Loading

0 comments on commit 33260a7

Please sign in to comment.