1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-15 22:17:39 +00:00

Compare commits

..

24 Commits

Author SHA1 Message Date
Jonathan Coates
aa89e51639 Bump CC:T to 1.101.3
0/10, would not recommend.
2023-07-06 23:54:44 +01:00
Jonathan Coates
7436447a6e Several command permission fixes
- Attach permission checks to the first argument (so the literal
   command name) rather than the last argument. This fixes commands
   showing up when they shouldn't.

 - HelpingArgumentBuilder now inherits permissions of its leaf nodes.
   This only really impacts the "track" subcommand.

 - Don't autocomplete the computer selector for the "queue" subcommand.
   As everyone has permission for this command, it's possible to find
   all computer ids and labels in the world.

   I'm in mixed minds about this, but don't think this is an exploit -
   computer ids/labels are sent to in-range players so shouldn't be
   considered secret - but worth patching none-the-less.
2023-07-06 23:41:23 +01:00
Jonathan Coates
f629831b12 Tighten up the $private HTTP rule
- Block multicast and the fd00::/8 address ranges.
 - Block several cloud metadata providers which sit outside the
   standard address ranges.
2023-07-06 23:27:17 +01:00
Jonathan Coates
f7fdb6e729 Backport a couple of ROM commits
- Improve REPL's handling of expressions
   (655d5aeca8)

 - Some tiny optimisations to the window API
   (4accda6b8e)

 - Be lazy in reporting errors in the lexer
   (54ab98473f)

 - Update lua.lua require logic.
   (88f0c44152)
2023-07-06 23:15:57 +01:00
Jonathan Coates
db2616d1c0 Don't (metaphorically) explode on null explosions
Closes #1423.
2023-05-03 23:38:12 +01:00
Jonathan Coates
c0f982dc97 Use correct model for the turtle modem
Introduced in 0c3de1087e, so should only
affect 1.16.5 and 1.18.2.

Fixes #1426
2023-05-03 23:34:22 +01:00
Jonathan Coates
2a9f35de5e Backport several ROM/Lua commits
- Fix GPS returning nan on duplicate positions.
 - Distinguish between all parsers passing and failing.
 - Improve several comma related parse errors.
 - Ignore metatables in textutils.serialize.
 - Detect common audio containers in "speaker".

Co-authored-by: Wojbie <Wojbie@gmail.com>
2023-05-03 23:26:44 +01:00
Jonathan Coates
0fce3212a3 Distinguish between all parsers passing and failing
Given an input like f(x), which is both a valid statement and
expression, both parsers would accept the whole input. However, this was
treated the same as both parsers rejecting the input, resulting in a
crash when trying to print the error.

We now return immediately when any parser accepts the input.

Fixes #1354
2023-03-11 22:45:50 +00:00
Jonathan Coates
652f954886 Merge pull request #1352 from MCJack123/lets-encrypt
Add certificate workaround for Let's Encrypt on 1.16
2023-03-04 11:11:33 +00:00
JackMacWindows
6f65bad9af Fixed CI 2023-03-04 02:02:05 -05:00
JackMacWindows
e4dd4dbef0 Added version check to certificate addition 2023-03-02 18:30:54 -05:00
MCJack123
e1dffaa334 Add certificate workaround for Let's Encrypt 2023-02-28 20:52:14 -05:00
Jonathan Coates
d7305fb975 Bump CC:T to 1.101.2
Yes, it was the shiny parse errors, and not the steady accumulation of
bugs which made me finally do a version bump.
2023-02-14 10:00:24 +00:00
Jonathan Coates
9b3cadf57c Cherry pick several changes back from 1.19.3
The main purpose of this is to backport the improved parse/runtime
errors to older versions. I think they're sufficiently useful that we
should try to make it as widely available as possible.

We've been running them for a week now on SC3 and the released version
and not seen any issues, so I think it's probably stable enough.

This is a pretty lazy commit: I ended up copying the whole ROM over and
then picking up a few other related changes along the way.

 - Trim spaces from file paths (b8fce1eecc)

 - Correctly format 12AM/PM with
   %I (9f48395596)

 - Fix http.request and htpt.websocketAsync not handling a few failure
   edge-cases correctly (3b42f22a4f).

 - Move the internal modules into the main package path, hidden under
   cc.internal (34a31abd9c).

 - Gather code coverage in Java instead of
   Lua (28a55349a9).

 - Make error messages in edit more
   obvious (8cfbfe7ceb).

 - Make mcfly's test methods global. This means we don't need to pass
   stub everywhere (7335a892b5).

 - Improve runtime and parse errors. This comes from numerous commits,
   but chiefly a12b405acf, and
   5502412181.

 - Hide the internal redirect methods in
   multishell (33b6f38339).

Note this does /not/ include the shebang changes (sorry Emma!). I've
tried to avoid adding any user-controllable features, mostly because I
don't know how to handle the versioning otherwise :).
2023-02-14 09:45:03 +00:00
Jonathan Coates
68f6fa9343 Fall back to the default item when rendering non-turtles
Closes #1328. This isn't an actual fix - I have no clue what's going on
there - but it should be less crashy.
2023-02-09 12:45:20 +00:00
Jonathan Coates
58f2c0bd71 Update Cobalt to fix yielding inside __len
Closes #1307
2023-01-26 10:09:09 +00:00
Jonathan Coates
b46ad62424 Send the original rednet message to the current computer
We were incorrectly enquing the modem payload, not the underlying rednet
message.

Closes #1308.
2023-01-21 08:25:13 +00:00
Jonathan Coates
12f2f854a6 Include the licences of our dependencies in the credits
I feel like we should have been doing this from the beginning. Love to
uncompliant for 11 years :/.
2023-01-07 12:04:56 +00:00
Jonathan Coates
4078a2dcba Clamp speaker volume again
Looks like this was removed in b048b6666d.
2023-01-01 13:59:58 +00:00
Jonathan Coates
0ad12eeab6 Fix computer upgrade recipes
Fixes #1272
2022-12-26 09:32:02 +00:00
Jonathan Coates
68a5081740 Bump Cobalt version
See #1248 and #1249
2022-12-21 16:01:54 +00:00
Jonathan Coates
5e701f73d6 Use the correct import path in import.lua
Backported from 1.19.3
2022-12-14 21:52:32 +00:00
Jonathan Coates
1d3ecb551d Improvee changelog 2022-11-02 07:58:31 +00:00
Jonathan Coates
aefda6a381 Fix a couple of issues with the release process
Only way to test these is in prod, alas :D:
2022-11-01 21:53:05 +00:00
707 changed files with 26139 additions and 13353 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 8
distribution: 'temurin'
- name: Setup Gradle

View File

@@ -17,7 +17,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 17
java-version: 8
distribution: 'temurin'
- name: Setup Gradle

View File

@@ -43,10 +43,6 @@ minecraft {
// configureEach would be better, but we need to eagerly configure configs or otherwise the run task doesn't
// get set up properly.
all {
lazyToken("minecraft_classpath") {
configurations["shade"].copyRecursive().resolve().joinToString(File.pathSeparator) { it.absolutePath }
}
property("forge.logging.markers", "REGISTRIES")
property("forge.logging.console.level", "debug")
@@ -79,24 +75,6 @@ minecraft {
}
fun RunConfig.configureForGameTest() {
val old = lazyTokens.get("minecraft_classpath")
lazyToken("minecraft_classpath") {
// We do some terrible hacks here to basically find all things not already on the runtime classpath
// and add them. /Except/ for our source sets, as those need to load inside the Minecraft classpath.
val testMod = configurations["testModRuntimeClasspath"].resolve()
val implementation = configurations.runtimeClasspath.get().resolve()
val new = (testMod - implementation)
.asSequence()
.filter { it.isFile && !it.name.endsWith("-test-fixtures.jar") }
.map { it.absolutePath }
.joinToString(File.pathSeparator)
if (old == null) new else old.get() + File.pathSeparator + new
}
property("cctest.sources", file("src/testMod/resources/data/cctest").absolutePath)
arg("--mixin.config=computercraft-gametest.mixins.json")
mods.register("cctest") {
source(sourceSets["testMod"])
source(sourceSets["testFixtures"])
@@ -109,10 +87,12 @@ minecraft {
configureForGameTest()
}
val gameTestServer by registering {
val testServer by registering {
workingDirectory(file("run/testServer"))
parent(server.get())
configureForGameTest()
property("cctest.run", "true")
property("forge.logging.console.level", "info")
}
}
@@ -120,6 +100,7 @@ minecraft {
mappings("parchment", "${libs.versions.parchmentMc.get()}-${libs.versions.parchment.get()}-$mcVersion")
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
accessTransformer(file("src/testMod/resources/META-INF/accesstransformer.cfg"))
}
mixin {
@@ -139,14 +120,16 @@ configurations {
dependencies {
minecraft("net.minecraftforge:forge:$mcVersion-${libs.versions.forge.get()}")
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
annotationProcessor("org.spongepowered:mixin:0.8.4:processor")
compileOnly(libs.jetbrainsAnnotations)
annotationProcessorEverywhere(libs.autoService)
"extraModsCompileOnly"(fg.deobf("mezz.jei:jei-1.18.2:9.4.1.116:api"))
"extraModsRuntimeOnly"(fg.deobf("mezz.jei:jei-1.18.2:9.4.1.116"))
"extraModsCompileOnly"(fg.deobf("maven.modrinth:oculus:1.18.2-1.2.5"))
"extraModsCompileOnly"(fg.deobf("mezz.jei:jei-1.16.5:7.7.0.104:api"))
"extraModsRuntimeOnly"(fg.deobf("mezz.jei:jei-1.16.5:7.7.0.104"))
"extraModsCompileOnly"(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-1.16.5:7.1.0.313"))
"extraModsCompileOnly"(fg.deobf("commoble.morered:morered-1.16.5:2.1.1.0"))
"shade"(libs.cobalt)
@@ -168,7 +151,7 @@ illuaminate {
tasks.javadoc {
include("dan200/computercraft/api/**/*.java")
(options as StandardJavadocDocletOptions).links("https://docs.oracle.com/en/java/javase/17/docs/api/")
(options as StandardJavadocDocletOptions).links("https://docs.oracle.com/javase/8/docs/api/")
}
val apiJar by tasks.registering(Jar::class) {
@@ -194,7 +177,7 @@ val luaJavadoc by tasks.registering(Javadoc::class) {
javadocTool.set(
javaToolchains.javadocToolFor {
languageVersion.set(cc.tweaked.gradle.CCTweakedPlugin.JAVA_VERSION)
languageVersion.set(JavaLanguageVersion.of(11))
},
)
}
@@ -204,7 +187,7 @@ tasks.processResources {
inputs.property("forgeVersion", libs.versions.forge.get())
inputs.property("gitHash", cct.gitHash)
filesMatching("data/computercraft/lua/rom/help/credits.txt") {
filesMatching("data/computercraft/lua/rom/help/credits.md") {
expand(mapOf("gitContributors" to cct.gitContributors.get().joinToString("\n")))
}
@@ -337,14 +320,25 @@ val lintLua by tasks.registering(IlluaminateExec::class) {
doLast { if (System.getenv("GITHUB_ACTIONS") != null) println("::remove-matcher owner=illuaminate::") }
}
val setupRunGametest by tasks.registering(Copy::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Sets up the environment for the test server."
from("src/testMod/server-files") {
include("eula.txt")
include("server.properties")
}
into("run/testServer")
}
val runGametest by tasks.registering(JavaExec::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs tests on a temporary Minecraft instance."
dependsOn("cleanRunGametest")
dependsOn(setupRunGametest, "cleanRunGametest")
// Copy from runGameTestServer. We do it in this slightly odd way as runGameTestServer
// Copy from runTestServer. We do it in this slightly odd way as runTestServer
// isn't created until the task is configured (which is no good for us).
val exec = tasks.getByName<JavaExec>("runGameTestServer")
val exec = tasks.getByName<JavaExec>("runTestServer")
dependsOn(exec.dependsOn)
exec.copyToFull(this)
}
@@ -370,7 +364,7 @@ val publishCurseForge by tasks.registering(TaskPublishCurseForge::class) {
apiToken = findProperty("curseForgeApiKey") ?: ""
enabled = apiToken != ""
val mainFile = upload("282001", tasks.shadowJar)
val mainFile = upload("282001", tasks.shadowJar.get().archiveFile)
dependsOn(tasks.shadowJar) // Ughr.
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"
@@ -451,6 +445,8 @@ publishing {
repositories {
maven("https://squiddev.cc/maven") {
name = "SquidDev"
credentials(PasswordCredentials::class)
}
}
}

View File

@@ -26,12 +26,12 @@ abstract class CCTweakedExtension(
) {
/** Get the hash of the latest git commit. */
val gitHash: Provider<String> = gitProvider(project, "<no git hash>") {
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD")
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD").trim()
}
/** Get the current git branch. */
val gitBranch: Provider<String> = gitProvider(project, "<no git branch>") {
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD")
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD").trim()
}
/** Get a list of all contributors to the project. */

View File

@@ -13,6 +13,6 @@ class CCTweakedPlugin : Plugin<Project> {
}
companion object {
val JAVA_VERSION = JavaLanguageVersion.of(17)
val JAVA_VERSION = JavaLanguageVersion.of(8)
}
}

View File

@@ -58,29 +58,20 @@
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="UnnecessaryParentheses">
<!-- Default minus LAND. -->
<property name="tokens" value="EXPR,IDENT,NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG,STRING_LITERAL,LITERAL_NULL,LITERAL_FALSE,LITERAL_TRUE,ASSIGN,BAND_ASSIGN,BOR_ASSIGN,BSR_ASSIGN,BXOR_ASSIGN,DIV_ASSIGN,MINUS_ASSIGN,MOD_ASSIGN,PLUS_ASSIGN,SL_ASSIGN,SR_ASSIGN,STAR_ASSIGN,LAMBDA,TEXT_BLOCK_LITERAL_BEGIN,LITERAL_INSTANCEOF,GT,LT,GE,LE,EQUAL,NOT_EQUAL,UNARY_MINUS,UNARY_PLUS,INC,DEC,LNOT,BNOT,POST_INC,POST_DEC" />
</module>
<module name="UnnecessaryParentheses" />
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
<module name="UnnecessarySemicolonInTryWithResources" />
<module name="UnnecessarySemicolonInEnumeration" />
<!-- Imports -->
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"
/>
</module>
<module name="CustomImportOrder" />
<module name="IllegalImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Javadoc -->
<!-- TODO: Missing* checks for the dan200.computercraft.api package? -->
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="AtclauseOrder" />
<module name="InvalidJavadocPosition" />
<module name="JavadocBlockTagLocation" />
<module name="JavadocMethod"/>
@@ -109,9 +100,7 @@
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName">
<property name="format" value="^(computercraft\$)?[a-z][a-zA-Z0-9]*$" />
</module>
<module name="MethodName" />
<module name="MethodTypeParameterName" />
<module name="PackageName">
<property name="format" value="^dan200\.computercraft(\.[a-z][a-z0-9]*)*" />
@@ -119,6 +108,11 @@
<module name="ParameterName" />
<module name="StaticVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*|CAPABILITY(_[A-Z_]+)?$" />
<property name="applyToPrivate" value="false" />
</module>
<module name="StaticVariableName">
<property name="format" value="^(s_)?[a-z][a-zA-Z0-9]*|CAPABILITY(_[A-Z_]+)?$" />
<property name="applyToPrivate" value="true" />
</module>
<module name="TypeName" />
@@ -162,7 +156,6 @@
<property name="allowEmptyLambdas" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyTypes" value="true" />
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_RETURN,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND" />
</module>

View File

@@ -3,6 +3,6 @@ FROM gitpod/workspace-base
USER gitpod
RUN sudo apt-get -q update \
&& sudo apt-get install -yq openjdk-16-jdk python3-pip npm \
&& sudo apt-get install -yq openjdk-8-jdk openjdk-16-jdk python3-pip npm \
&& sudo pip3 install pre-commit \
&& sudo update-java-alternatives --set java-1.16.0-openjdk-amd64
&& sudo update-java-alternatives --set java-1.8.0-openjdk-amd64

View File

@@ -1,64 +0,0 @@
--- @module fs
--- Returns true if a path is mounted to the parent filesystem.
--
-- The root filesystem "/" is considered a mount, along with disk folders and
-- the rom folder. Other programs (such as network shares) can exstend this to
-- make other mount types by correctly assigning their return value for getDrive.
--
-- @tparam string path The path to check.
-- @treturn boolean If the path is mounted, rather than a normal file/folder.
-- @throws If the path does not exist.
-- @see getDrive
-- @since 1.87.0
function isDriveRoot(path) end
--[[- Provides completion for a file or directory name, suitable for use with
@{_G.read}.
When a directory is a possible candidate for completion, two entries are
included - one with a trailing slash (indicating that entries within this
directory exist) and one without it (meaning this entry is an immediate
completion candidate). `include_dirs` can be set to @{false} to only include
those with a trailing slash.
@tparam[1] string path The path to complete.
@tparam[1] string location The location where paths are resolved from.
@tparam[1,opt=true] boolean include_files When @{false}, only directories will
be included in the returned list.
@tparam[1,opt=true] boolean include_dirs When @{false}, "raw" directories will
not be included in the returned list.
@tparam[2] string path The path to complete.
@tparam[2] string location The location where paths are resolved from.
@tparam[2] {
include_dirs? = boolean, include_files? = boolean,
include_hidden? = boolean
} options
This table form is an expanded version of the previous syntax. The
`include_files` and `include_dirs` arguments from above are passed in as fields.
This table also accepts the following options:
- `include_hidden`: Whether to include hidden files (those starting with `.`)
by default. They will still be shown when typing a `.`.
@treturn { string... } A list of possible completion candidates.
@since 1.74
@changed 1.101.0
@usage Complete files in the root directory.
read(nil, nil, function(str)
return fs.complete(str, "", true, false)
end)
@usage Complete files in the root directory, hiding hidden files by default.
read(nil, nil, function(str)
return fs.complete(str, "", {
include_files = true,
include_dirs = false,
included_hidden = false,
})
end)
]]
function complete(path, location, include_files, include_dirs) end

View File

@@ -1,177 +0,0 @@
--- Make HTTP requests, sending and receiving data to a remote web server.
--
-- @module http
-- @since 1.1
-- @see local_ips To allow accessing servers running on your local network.
--- Asynchronously make a HTTP request to the given url.
--
-- This returns immediately, a @{http_success} or @{http_failure} will be queued
-- once the request has completed.
--
-- @tparam string url The url to request
-- @tparam[opt] string body An optional string containing the body of the
-- request. If specified, a `POST` request will be made instead.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, body? = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request.
--
-- This table form is an expanded version of the previous syntax. All arguments
-- from above are passed in as fields instead (for instance,
-- `http.request("https://example.com")` becomes `http.request { url =
-- "https://example.com" }`).
--
-- This table also accepts several additional options:
--
-- - `method`: Which HTTP method to use, for instance `"PATCH"` or `"DELETE"`.
-- - `redirect`: Whether to follow HTTP redirects. Defaults to true.
--
-- @see http.get For a synchronous way to make GET requests.
-- @see http.post For a synchronous way to make POST requests.
--
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
function request(...) end
--- Make a HTTP GET request to the given url.
--
-- @tparam string url The url to request
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request. See @{http.request} for details on how
-- these options behave.
--
-- @treturn Response The resulting http response, which can be read from.
-- @treturn[2] nil When the http request failed, such as in the event of a 404
-- error or connection timeout.
-- @treturn string A message detailing why the request failed.
-- @treturn Response|nil The failing http response, if available.
--
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Response handles are now returned on error if available.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
--
-- @usage Make a request to [example.tweaked.cc](https://example.tweaked.cc),
-- and print the returned page.
-- ```lua
-- local request = http.get("https://example.tweaked.cc")
-- print(request.readAll())
-- -- => HTTP is working!
-- request.close()
-- ```
function get(...) end
--- Make a HTTP POST request to the given url.
--
-- @tparam string url The url to request
-- @tparam string body The body of the POST request.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, body? = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request. See @{http.request} for details on how
-- these options behave.
--
-- @treturn Response The resulting http response, which can be read from.
-- @treturn[2] nil When the http request failed, such as in the event of a 404
-- error or connection timeout.
-- @treturn string A message detailing why the request failed.
-- @treturn Response|nil The failing http response, if available.
--
-- @since 1.31
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Response handles are now returned on error if available.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
function post(...) end
--- Asynchronously determine whether a URL can be requested.
--
-- If this returns `true`, one should also listen for @{http_check} which will
-- container further information about whether the URL is allowed or not.
--
-- @tparam string url The URL to check.
-- @treturn true When this url is not invalid. This does not imply that it is
-- allowed - see the comment above.
-- @treturn[2] false When this url is invalid.
-- @treturn string A reason why this URL is not valid (for instance, if it is
-- malformed, or blocked).
--
-- @see http.checkURL For a synchronous version.
function checkURLAsync(url) end
--- Determine whether a URL can be requested.
--
-- If this returns `true`, one should also listen for @{http_check} which will
-- container further information about whether the URL is allowed or not.
--
-- @tparam string url The URL to check.
-- @treturn true When this url is valid and can be requested via @{http.request}.
-- @treturn[2] false When this url is invalid.
-- @treturn string A reason why this URL is not valid (for instance, if it is
-- malformed, or blocked).
--
-- @see http.checkURLAsync For an asynchronous version.
--
-- @usage
-- ```lua
-- print(http.checkURL("https://example.tweaked.cc/"))
-- -- => true
-- print(http.checkURL("http://localhost/"))
-- -- => false Domain not permitted
-- print(http.checkURL("not a url"))
-- -- => false URL malformed
-- ```
function checkURL(url) end
--- Open a websocket.
--
-- @tparam string url The websocket url to connect to. This should have the
-- `ws://` or `wss://` protocol.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of the initial websocket connection.
--
-- @treturn Websocket The websocket connection.
-- @treturn[2] false If the websocket connection failed.
-- @treturn string An error message describing why the connection failed.
-- @since 1.80pr1.1
-- @changed 1.80pr1.3 No longer asynchronous.
-- @changed 1.95.3 Added User-Agent to default headers.
function websocket(url, headers) end
--- Asynchronously open a websocket.
--
-- This returns immediately, a @{websocket_success} or @{websocket_failure}
-- will be queued once the request has completed.
--
-- @tparam string url The websocket url to connect to. This should have the
-- `ws://` or `wss://` protocol.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of the initial websocket connection.
-- @since 1.80pr1.3
-- @changed 1.95.3 Added User-Agent to default headers.
function websocketAsync(url, headers) end

View File

@@ -5,7 +5,7 @@ kotlin.stdlib.default.dependency=false
kotlin.jvm.target.validation.mode=error
# Mod properties
modVersion=1.101.0
modVersion=1.101.3
# Minecraft properties: We want to configure this here so we can read it in settings.gradle
mcVersion=1.18.2
mcVersion=1.16.5

View File

@@ -2,12 +2,12 @@
# Minecraft
# MC version is specified in gradle.properties, as we need that in settings.gradle.
forge = "40.1.0"
parchment = "2022.03.13"
parchmentMc = "1.18.2"
forge = "36.2.34"
parchment = "2021.08.08"
parchmentMc = "1.16.5"
autoService = "1.0.1"
cobalt = { strictly = "[0.5.8,0.6.0)", prefer = "0.5.8" }
cobalt = "0.6.0"
jetbrainsAnnotations = "23.0.0"
kotlin = "1.7.10"
kotlin-coroutines = "1.6.0"
@@ -19,11 +19,11 @@ junit = "5.9.1"
# Build tools
cctJavadoc = "1.5.2"
checkstyle = "10.3.4"
checkstyle = "8.25" # There's a reason we're pinned on an ancient version, but I can't remember what it is.
curseForgeGradle = "1.0.11"
forgeGradle = "5.1.+"
githubRelease = "2.2.12"
illuaminate = "0.1.0-7-g2a5a89c"
illuaminate = "0.1.0-20-g8c483a4"
librarian = "1.+"
minotaur = "2.+"
mixinGradle = "0.7.+"

View File

@@ -111,6 +111,6 @@
(lint
(globals
:max sleep write
cct_test describe expect howlci fail it pending stub)))
cct_test describe expect howlci fail it pending stub before_each)))
(at /src/web/mount/expr_template.lua (lint (globals :max __expr__)))

View File

@@ -3,8 +3,8 @@
{
"when": {
"OR": [
{"up": "true", "north": "false", "west": "false", "south": "false", "east": "false", "cable": "true"},
{"north": "false", "west": "false", "south": "false", "east": "false", "down": "true", "cable": "true"}
{"east": "false", "north": "false", "south": "false", "cable": "true", "up": "true", "west": "false"},
{"down": "true", "east": "false", "north": "false", "south": "false", "cable": "true", "west": "false"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "x": 90}
@@ -13,16 +13,16 @@
"when": {
"OR": [
{
"up": "false",
"north": "false",
"west": "false",
"south": "false",
"east": "false",
"down": "false",
"cable": "true"
"east": "false",
"north": "false",
"south": "false",
"cable": "true",
"up": "false",
"west": "false"
},
{"up": "false", "west": "false", "north": "true", "east": "false", "down": "false", "cable": "true"},
{"up": "false", "west": "false", "south": "true", "east": "false", "down": "false", "cable": "true"}
{"down": "false", "east": "false", "north": "true", "cable": "true", "up": "false", "west": "false"},
{"down": "false", "east": "false", "south": "true", "cable": "true", "up": "false", "west": "false"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "y": 0}
@@ -30,8 +30,8 @@
{
"when": {
"OR": [
{"up": "false", "north": "false", "south": "false", "east": "true", "down": "false", "cable": "true"},
{"up": "false", "north": "false", "west": "true", "south": "false", "down": "false", "cable": "true"}
{"down": "false", "east": "true", "north": "false", "south": "false", "cable": "true", "up": "false"},
{"down": "false", "north": "false", "south": "false", "cable": "true", "up": "false", "west": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "y": 90}
@@ -39,18 +39,18 @@
{
"when": {
"OR": [
{"north": "true", "down": "true", "cable": "true"},
{"south": "true", "down": "true", "cable": "true"},
{"west": "true", "down": "true", "cable": "true"},
{"east": "true", "down": "true", "cable": "true"},
{"up": "true", "north": "true", "cable": "true"},
{"up": "true", "south": "true", "cable": "true"},
{"up": "true", "west": "true", "cable": "true"},
{"up": "true", "east": "true", "cable": "true"},
{"north": "true", "west": "true", "cable": "true"},
{"north": "true", "east": "true", "cable": "true"},
{"west": "true", "south": "true", "cable": "true"},
{"south": "true", "east": "true", "cable": "true"}
{"down": "true", "north": "true", "cable": "true"},
{"down": "true", "south": "true", "cable": "true"},
{"down": "true", "cable": "true", "west": "true"},
{"down": "true", "east": "true", "cable": "true"},
{"north": "true", "cable": "true", "up": "true"},
{"south": "true", "cable": "true", "up": "true"},
{"cable": "true", "up": "true", "west": "true"},
{"east": "true", "cable": "true", "up": "true"},
{"north": "true", "cable": "true", "west": "true"},
{"east": "true", "north": "true", "cable": "true"},
{"south": "true", "cable": "true", "west": "true"},
{"east": "true", "south": "true", "cable": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_any"}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"minecraft:redstone"
]
"item": "minecraft:redstone"
},
{
"items": [
"minecraft:gold_ingot"
]
"item": "minecraft:gold_ingot"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:computer_normal"
]
"item": "computercraft:computer_normal"
},
{
"tag": "forge:ingots/gold"

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:command_block"
]
"item": "minecraft:command_block"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:disk_drive"
]
"item": "computercraft:disk_drive"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_advanced"
]
"item": "computercraft:pocket_computer_advanced"
},
{
"items": [
"computercraft:speaker"
]
"item": "computercraft:speaker"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_advanced"
]
"item": "computercraft:pocket_computer_advanced"
},
{
"items": [
"computercraft:wireless_modem_advanced"
]
"item": "computercraft:wireless_modem_advanced"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_advanced"
]
"item": "computercraft:pocket_computer_advanced"
},
{
"items": [
"computercraft:wireless_modem_normal"
]
"item": "computercraft:wireless_modem_normal"
}
]
}

View File

@@ -21,9 +21,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:golden_apple"
]
"item": "minecraft:golden_apple"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_normal"
]
"item": "computercraft:pocket_computer_normal"
},
{
"tag": "forge:ingots/gold"

View File

@@ -21,9 +21,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:golden_apple"
]
"item": "minecraft:golden_apple"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_normal"
]
"item": "computercraft:pocket_computer_normal"
},
{
"items": [
"computercraft:speaker"
]
"item": "computercraft:speaker"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_normal"
]
"item": "computercraft:pocket_computer_normal"
},
{
"items": [
"computercraft:wireless_modem_advanced"
]
"item": "computercraft:wireless_modem_advanced"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:pocket_computer_normal"
]
"item": "computercraft:pocket_computer_normal"
},
{
"items": [
"computercraft:wireless_modem_normal"
]
"item": "computercraft:wireless_modem_normal"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:printer"
]
"item": "computercraft:printer"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:printer"
]
"item": "computercraft:printer"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:computer_normal"
]
"item": "computercraft:computer_normal"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"computercraft:speaker"
]
"item": "computercraft:speaker"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"computercraft:wireless_modem_advanced"
]
"item": "computercraft:wireless_modem_advanced"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"computercraft:wireless_modem_normal"
]
"item": "computercraft:wireless_modem_normal"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:crafting_table"
]
"item": "minecraft:crafting_table"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:diamond_axe"
]
"item": "minecraft:diamond_axe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:diamond_hoe"
]
"item": "minecraft:diamond_hoe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:diamond_pickaxe"
]
"item": "minecraft:diamond_pickaxe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:diamond_shovel"
]
"item": "minecraft:diamond_shovel"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_advanced"
]
"item": "computercraft:turtle_advanced"
},
{
"items": [
"minecraft:diamond_sword"
]
"item": "minecraft:diamond_sword"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"tag": "forge:ingots/gold"

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:computer_normal"
]
"item": "computercraft:computer_normal"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"computercraft:speaker"
]
"item": "computercraft:speaker"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"computercraft:wireless_modem_advanced"
]
"item": "computercraft:wireless_modem_advanced"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"computercraft:wireless_modem_normal"
]
"item": "computercraft:wireless_modem_normal"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:crafting_table"
]
"item": "minecraft:crafting_table"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:diamond_axe"
]
"item": "minecraft:diamond_axe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:diamond_hoe"
]
"item": "minecraft:diamond_hoe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:diamond_pickaxe"
]
"item": "minecraft:diamond_pickaxe"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:diamond_shovel"
]
"item": "minecraft:diamond_shovel"
}
]
}

View File

@@ -11,14 +11,10 @@
"conditions": {
"items": [
{
"items": [
"computercraft:turtle_normal"
]
"item": "computercraft:turtle_normal"
},
{
"items": [
"minecraft:diamond_sword"
]
"item": "minecraft:diamond_sword"
}
]
}

View File

@@ -21,9 +21,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:cable"
]
"item": "computercraft:cable"
}
]
}

View File

@@ -21,9 +21,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:wireless_modem_normal"
]
"item": "computercraft:wireless_modem_normal"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:monitor_normal"
]
"item": "computercraft:monitor_normal"
}
]
}

View File

@@ -11,9 +11,7 @@
"conditions": {
"items": [
{
"items": [
"computercraft:computer_advanced"
]
"item": "computercraft:computer_advanced"
}
]
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:speaker",
"item": "computercraft:speaker"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:wireless_modem_advanced",
"item": "computercraft:wireless_modem_advanced"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:wireless_modem_normal",
"item": "computercraft:wireless_modem_normal"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:speaker",
"item": "computercraft:speaker"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:wireless_modem_advanced",
"item": "computercraft:wireless_modem_advanced"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:wireless_modem_normal",
"item": "computercraft:wireless_modem_normal"
}

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
@@ -24,8 +23,7 @@
]
},
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,8 +2,7 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"rolls": 1,
"entries": [
{
"type": "minecraft:item",

View File

@@ -10,7 +10,7 @@
"tag": "forge:ingots/gold"
},
"C": {
"item": "computercraft:computer_advanced"
"item": "computercraft:computer_normal"
}
},
"result": {

View File

@@ -10,7 +10,7 @@
"tag": "forge:ingots/gold"
},
"C": {
"item": "computercraft:computer_advanced"
"item": "computercraft:turtle_normal"
},
"B": {
"tag": "forge:storage_blocks/gold"

View File

@@ -2,7 +2,6 @@
"replace": false,
"values": [
"#minecraft:crops",
"#minecraft:mineable/hoe",
"minecraft:cactus",
"minecraft:melon",
"minecraft:pumpkin",

View File

@@ -1,7 +1,6 @@
{
"replace": false,
"values": [
"#minecraft:mineable/shovel",
"minecraft:melon",
"minecraft:pumpkin",
"minecraft:carved_pumpkin",

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:workbench",
"item": "minecraft:crafting_table"
}

View File

@@ -1,5 +0,0 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_axe",
"damageMultiplier": 6.0
}

View File

@@ -1,5 +0,0 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_hoe",
"breakable": "computercraft:turtle_hoe_harvestable"
}

View File

@@ -1,4 +0,0 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_pickaxe"
}

View File

@@ -1,5 +0,0 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_shovel",
"breakable": "computercraft:turtle_shovel_harvestable"
}

View File

@@ -1,6 +0,0 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_sword",
"damageMultiplier": 9.0,
"breakable": "computercraft:turtle_sword_harvestable"
}

View File

@@ -1,18 +0,0 @@
{
"replace": false,
"values": [
"computercraft:computer_normal",
"computercraft:computer_advanced",
"computercraft:turtle_normal",
"computercraft:turtle_advanced",
"computercraft:speaker",
"computercraft:disk_drive",
"computercraft:printer",
"computercraft:monitor_normal",
"computercraft:monitor_advanced",
"computercraft:wireless_modem_normal",
"computercraft:wireless_modem_advanced",
"computercraft:wired_modem_full",
"computercraft:cable"
]
}

View File

@@ -5,17 +5,20 @@
*/
package dan200.computercraft;
import dan200.computercraft.api.turtle.event.TurtleAction;
import dan200.computercraft.core.apis.http.options.Action;
import dan200.computercraft.core.apis.http.options.AddressRule;
import dan200.computercraft.shared.Config;
import dan200.computercraft.shared.Registry;
import dan200.computercraft.shared.peripheral.monitor.MonitorRenderer;
import dan200.computercraft.shared.pocket.peripherals.PocketModem;
import dan200.computercraft.shared.pocket.peripherals.PocketSpeaker;
import dan200.computercraft.shared.turtle.upgrades.*;
import net.minecraftforge.fml.common.Mod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.List;
import java.util.OptionalInt;
import java.util.*;
import java.util.concurrent.TimeUnit;
@Mod( ComputerCraft.MOD_ID )
@@ -37,10 +40,10 @@ public final class ComputerCraft
public static boolean httpEnabled = true;
public static boolean httpWebsocketEnabled = true;
public static List<AddressRule> httpRules = List.of(
public static List<AddressRule> httpRules = Collections.unmodifiableList( Arrays.asList(
AddressRule.parse( "$private", OptionalInt.empty(), Action.DENY.toPartial() ),
AddressRule.parse( "*", OptionalInt.empty(), Action.ALLOW.toPartial() )
);
) );
public static int httpMaxRequests = 16;
public static int httpMaxWebsockets = 4;
@@ -54,7 +57,7 @@ public final class ComputerCraft
public static int modemHighAltitudeRangeDuringStorm = 384;
public static int maxNotesPerTick = 8;
public static MonitorRenderer monitorRenderer = MonitorRenderer.BEST;
public static int monitorDistance = 65;
public static double monitorDistanceSq = 4096;
public static long monitorBandwidth = 1_000_000;
public static boolean turtlesNeedFuel = true;
@@ -62,6 +65,7 @@ public final class ComputerCraft
public static int advancedTurtleFuelLimit = 100000;
public static boolean turtlesObeyBlockProtection = true;
public static boolean turtlesCanPush = true;
public static EnumSet<TurtleAction> turtleDisabledActions = EnumSet.noneOf( TurtleAction.class );
public static int computerTermWidth = 51;
public static int computerTermHeight = 19;
@@ -77,7 +81,28 @@ public final class ComputerCraft
public static int uploadNagDelay = 5;
public static final Logger log = LoggerFactory.getLogger( MOD_ID );
public static final class TurtleUpgrades
{
public static TurtleModem wirelessModemNormal;
public static TurtleModem wirelessModemAdvanced;
public static TurtleSpeaker speaker;
public static TurtleCraftingTable craftingTable;
public static TurtleSword diamondSword;
public static TurtleShovel diamondShovel;
public static TurtleTool diamondPickaxe;
public static TurtleAxe diamondAxe;
public static TurtleHoe diamondHoe;
}
public static final class PocketUpgrades
{
public static PocketModem wirelessModemNormal;
public static PocketModem wirelessModemAdvanced;
public static PocketSpeaker speaker;
}
public static final Logger log = LogManager.getLogger( MOD_ID );
public ComputerCraft()
{

Some files were not shown because too many files have changed in this diff Show More