diff --git a/.gitignore b/.gitignore index 96b40ce93..675c66cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /projects/*/logs /projects/fabric/fabricloader.log /projects/*/build +/projects/*/src/test/generated_tests/ /buildSrc/build /out /buildSrc/out diff --git a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts index 50161c085..2e6308d20 100644 --- a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts +++ b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts @@ -102,6 +102,8 @@ sourceSets.all { option("NullAway:CastToNonNullMethod", "dan200.computercraft.core.util.Nullability.assertNonNull") option("NullAway:CheckOptionalEmptiness") option("NullAway:AcknowledgeRestrictiveAnnotations") + + excludedPaths = ".*/jmh_generated/.*" } } } diff --git a/buildSrc/src/main/kotlin/cc-tweaked.mod-publishing.gradle.kts b/buildSrc/src/main/kotlin/cc-tweaked.mod-publishing.gradle.kts index 605a4b1a7..35e1da36b 100644 --- a/buildSrc/src/main/kotlin/cc-tweaked.mod-publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/cc-tweaked.mod-publishing.gradle.kts @@ -32,7 +32,7 @@ val publishCurseForge by tasks.registering(TaskPublishCurseForge::class) { apiToken = findProperty("curseForgeApiKey") ?: "" enabled = apiToken != "" - val mainFile = upload("282001", modPublishing.output.get().archiveFile) + val mainFile = upload("282001", modPublishing.output) mainFile.changelog = "Release notes can be found on the [GitHub repository](https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v$mcVersion-$modVersion)." mainFile.changelogType = "markdown" diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 0adcb6220..bf8face88 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -13,8 +13,12 @@ SPDX-License-Identifier: MPL-2.0 + + + + - + diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml index 568411c49..434436e7a 100644 --- a/config/checkstyle/suppressions.xml +++ b/config/checkstyle/suppressions.xml @@ -21,5 +21,5 @@ SPDX-License-Identifier: MPL-2.0 - + diff --git a/doc/guides/gps_setup.md b/doc/guides/gps_setup.md index 6a241bfa0..38ef2443f 100644 --- a/doc/guides/gps_setup.md +++ b/doc/guides/gps_setup.md @@ -19,7 +19,7 @@ # Setting up GPS constellation is redundant, but it does not cause problems. ## Building a GPS constellation -An example GPS constellation. +An example GPS constellation. We are going to build our GPS constellation as shown in the image above. You will need 4 computers and either 4 wireless modems or 4 ender modems. Try not to mix ender and wireless modems together as you might get some odd behavior when your diff --git a/doc/images/computercraft-dump.png b/doc/images/computercraft-dump.png new file mode 100644 index 000000000..e7ee54c93 Binary files /dev/null and b/doc/images/computercraft-dump.png differ diff --git a/doc/images/computercraft-track.png b/doc/images/computercraft-track.png new file mode 100644 index 000000000..95bf3a672 Binary files /dev/null and b/doc/images/computercraft-track.png differ diff --git a/doc/reference/command.md b/doc/reference/command.md new file mode 100644 index 000000000..08025ac3d --- /dev/null +++ b/doc/reference/command.md @@ -0,0 +1,140 @@ +--- +module: [kind=reference] computercraft_command +--- + + + +# The `/computercraft` command +CC: Tweaked provides a `/computercraft` command for server owners to manage running computers on a server. + +## Permissions {#permissions} +As the `/computercraft` command is mostly intended for debugging and administrative purposes, its sub-commands typically +require you to have op (or similar). + + - All players have access to the [`queue`] sub-command. + - On a multi-player server, all other commands require op. + - On a single-player world, the player can run the [`dump`], [`turn-on`]/[`shutdown`], and [`track`] sub-commands, even + when cheats are not enabled. The [`tp`] and [`view`] commands require cheats. + +If a permission mod such as [LuckPerms] is installed[^permission], you can configure access to the individual +sub-commands. Each sub-command creates a `computercraft.command.NAME` permission node to control which players can +execute it. + +[LuckPerms]: https://github.com/LuckPerms/LuckPerms/ "A permissions plugin for Minecraft servers." +[fabric-permission-api]: https://github.com/lucko/fabric-permissions-api "A simple permissions API for Fabric" + +[^permission]: This supports any mod which uses Forge's permission API or [fabric-permission-api]. + +## Computer selectors {#computer-selectors} +Some commands (such as [`tp`] or [`turn-on`]) target a specific computer, or a list of computers. To specify which +computers to operate on, you must use "computer selectors". + +Computer selectors are similar to Minecraft's [entity target selectors], but targeting computers instead. They allow +you to select one or more computers, based on a set of predicates. + +The following predicates are supported: + - `id=`: Select computer(s) with a specific id. + - `instance=`: Select the computer with the given instance id. + - `family=`: Select computers based on their type. + - `label=