mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-09-24 09:58:46 +00:00
Merge branch 'mc-1.20.x' into mc-1.21.x
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: 📥 Set up Java
|
- name: 📥 Set up Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 21
|
java-version: 25
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: 📥 Setup Gradle
|
- name: 📥 Setup Gradle
|
||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
- name: 📥 Set up Java
|
- name: 📥 Set up Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 21
|
java-version: 25
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: 📥 Setup Gradle
|
- name: 📥 Setup Gradle
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- name: 📥 Set up Java
|
- name: 📥 Set up Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 21
|
java-version: 25
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: 📥 Setup Gradle
|
- name: 📥 Setup Gradle
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# See https://pre-commit.com/hooks.html for more hooks
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v5.0.0
|
rev: v6.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
@@ -20,14 +20,14 @@ repos:
|
|||||||
exclude: "tsconfig\\.json$"
|
exclude: "tsconfig\\.json$"
|
||||||
|
|
||||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
||||||
rev: 2.7.2
|
rev: 3.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: editorconfig-checker
|
- id: editorconfig-checker
|
||||||
args: ['-disable-indentation']
|
args: ['-disable-indentation']
|
||||||
exclude: "^(.*\\.(bat)|LICENSE)$"
|
exclude: "^(.*\\.(bat)|LICENSE)$"
|
||||||
|
|
||||||
- repo: https://github.com/fsfe/reuse-tool
|
- repo: https://github.com/fsfe/reuse-tool
|
||||||
rev: v5.0.2
|
rev: v6.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: reuse
|
- id: reuse
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ Translations are managed through [CrowdIn], an online interface for managing lan
|
|||||||
In order to develop CC: Tweaked, you'll need to download the source code and then run it.
|
In order to develop CC: Tweaked, you'll need to download the source code and then run it.
|
||||||
|
|
||||||
- Make sure you've got the following software installed:
|
- Make sure you've got the following software installed:
|
||||||
- Java Development Kit 21 (JDK). This can be downloaded from [Adoptium].
|
- Java Development Kit 25 (JDK). This can be downloaded from [Adoptium].
|
||||||
- [Git](https://git-scm.com/).
|
- [Git](https://git-scm.com/).
|
||||||
- [NodeJS 20 or later][node].
|
- [NodeJS 20 or later][node].
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ about how you can build on that until you've covered everything!
|
|||||||
|
|
||||||
[new-issue]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose "Create a new issue"
|
[new-issue]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose "Create a new issue"
|
||||||
[community]: README.md#community "Get in touch with the community."
|
[community]: README.md#community "Get in touch with the community."
|
||||||
[Adoptium]: https://adoptium.net/temurin/releases?version=21 "Download OpenJDK 21"
|
[Adoptium]: https://adoptium.net/temurin/releases?version=25 "Download OpenJDK 25"
|
||||||
[illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub"
|
[illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub"
|
||||||
[docs]: https://tweaked.cc/ "CC: Tweaked documentation"
|
[docs]: https://tweaked.cc/ "CC: Tweaked documentation"
|
||||||
[ldoc]: http://stevedonovan.github.io/ldoc/ "ldoc, a Lua documentation generator."
|
[ldoc]: http://stevedonovan.github.io/ldoc/ "ldoc, a Lua documentation generator."
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ tasks.javadoc {
|
|||||||
options {
|
options {
|
||||||
val stdOptions = this as StandardJavadocDocletOptions
|
val stdOptions = this as StandardJavadocDocletOptions
|
||||||
stdOptions.addBooleanOption("Xdoclint:all,-missing", true)
|
stdOptions.addBooleanOption("Xdoclint:all,-missing", true)
|
||||||
stdOptions.links("https://docs.oracle.com/en/java/javase/21/docs/api/")
|
stdOptions.links("https://docs.oracle.com/en/java/javase/${CCTweakedPlugin.JAVA_TARGET.asInt()}/docs/api/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ class CCTweakedPlugin : Plugin<Project> {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* The version we run with. We use Java 21 here, as our Gradle build requires that.
|
* The version we run with. We use Java 25 here, as our Gradle build requires that.
|
||||||
*/
|
*/
|
||||||
val JDK_VERSION = JavaLanguageVersion.of(21)
|
val JDK_VERSION = JavaLanguageVersion.of(25)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Java version we target. Should be the same as what Minecraft uses.
|
* The Java version we target. Should be the same as what Minecraft uses.
|
||||||
|
|||||||
+4
-1
@@ -7,8 +7,11 @@ The turtle's inventory should set up like a crafting grid. For instance, to
|
|||||||
craft sticks, slots 1 and 5 should contain planks. _All_ other slots should be
|
craft sticks, slots 1 and 5 should contain planks. _All_ other slots should be
|
||||||
empty, including those outside the crafting "grid".
|
empty, including those outside the crafting "grid".
|
||||||
|
|
||||||
|
`turtle.craft(0)` can be used to check whether the turtle contains a valid
|
||||||
|
recipe, without actually crafting it.
|
||||||
|
|
||||||
@tparam[opt=64] number limit The maximum number of crafting steps to run.
|
@tparam[opt=64] number limit The maximum number of crafting steps to run.
|
||||||
@throws When limit is less than 1 or greater than 64.
|
@throws When limit is less than 0 or greater than 64.
|
||||||
@treturn[1] true If crafting succeeds.
|
@treturn[1] true If crafting succeeds.
|
||||||
@treturn[2] false If crafting fails.
|
@treturn[2] false If crafting fails.
|
||||||
@treturn string A string describing why crafting failed.
|
@treturn string A string describing why crafting failed.
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ neogradle.subsystems.conventions.runs.enabled=false
|
|||||||
|
|
||||||
# Mod properties
|
# Mod properties
|
||||||
isUnstable=true
|
isUnstable=true
|
||||||
modVersion=1.117.0
|
modVersion=1.117.1
|
||||||
|
|
||||||
# Minecraft properties: We want to configure this here so we can read it in settings.gradle
|
# Minecraft properties: We want to configure this here so we can read it in settings.gradle
|
||||||
mcVersion=1.21.1
|
mcVersion=1.21.1
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#This file is generated by updateDaemonJvm
|
#This file is generated by updateDaemonJvm
|
||||||
toolchainVersion=21
|
toolchainVersion=25
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# MC version is specified in gradle.properties, as we need that in settings.gradle.
|
# MC version is specified in gradle.properties, as we need that in settings.gradle.
|
||||||
# Remember to update corresponding versions in fabric.mod.json/neoforge.mods.toml
|
# Remember to update corresponding versions in fabric.mod.json/neoforge.mods.toml
|
||||||
fabric-api = "0.102.1+1.21.1"
|
fabric-api = "0.102.1+1.21.1"
|
||||||
fabric-loader = "0.15.11"
|
fabric-loader = "0.18.4"
|
||||||
neoForge = "21.1.9"
|
neoForge = "21.1.9"
|
||||||
neoMergeTool = "2.0.0"
|
neoMergeTool = "2.0.0"
|
||||||
mixin = "0.8.5"
|
mixin = "0.8.5"
|
||||||
@@ -23,7 +23,7 @@ netty = "4.1.97.Final"
|
|||||||
slf4j = "2.0.9"
|
slf4j = "2.0.9"
|
||||||
|
|
||||||
# Core dependencies (independent of Minecraft)
|
# Core dependencies (independent of Minecraft)
|
||||||
asm = "9.9"
|
asm = "9.9.1"
|
||||||
autoService = "1.1.1"
|
autoService = "1.1.1"
|
||||||
checkerFramework = "3.51.1"
|
checkerFramework = "3.51.1"
|
||||||
cobalt = { strictly = "0.9.7" }
|
cobalt = { strictly = "0.9.7" }
|
||||||
@@ -31,7 +31,7 @@ commonsCli = "1.10.0"
|
|||||||
jetbrainsAnnotations = "26.0.2-1"
|
jetbrainsAnnotations = "26.0.2-1"
|
||||||
jspecify = "1.0.0"
|
jspecify = "1.0.0"
|
||||||
jzlib = "1.1.3"
|
jzlib = "1.1.3"
|
||||||
kotlin = "2.2.21"
|
kotlin = "2.3.0"
|
||||||
kotlin-coroutines = "1.10.2"
|
kotlin-coroutines = "1.10.2"
|
||||||
nightConfig = "3.8.3"
|
nightConfig = "3.8.3"
|
||||||
|
|
||||||
@@ -58,18 +58,18 @@ junitPlatform = "6.0.1"
|
|||||||
jmh = "1.37"
|
jmh = "1.37"
|
||||||
|
|
||||||
# Build tools
|
# Build tools
|
||||||
cctJavadoc = "1.8.5"
|
cctJavadoc = "1.9.0"
|
||||||
checkstyle = "12.1.1"
|
checkstyle = "12.1.1"
|
||||||
errorProne-core = "2.45.0"
|
errorProne-core = "2.45.0"
|
||||||
errorProne-plugin = "4.3.0"
|
errorProne-plugin = "4.3.0"
|
||||||
fabric-loom = "1.14.5"
|
fabric-loom = "1.15.2"
|
||||||
githubRelease = "2.5.2"
|
githubRelease = "2.5.2"
|
||||||
gradleVersions = "0.53.0"
|
gradleVersions = "0.53.0"
|
||||||
ideaExt = "1.3"
|
ideaExt = "1.3"
|
||||||
illuaminate = "0.1.0-83-g1131f68"
|
illuaminate = "0.1.0-83-g1131f68"
|
||||||
lwjgl = "3.3.6"
|
lwjgl = "3.3.6"
|
||||||
minotaur = "2.8.7"
|
minotaur = "2.8.7"
|
||||||
modDevGradle = "2.0.124"
|
modDevGradle = "2.0.140"
|
||||||
nullAway = "0.12.11"
|
nullAway = "0.12.11"
|
||||||
shadow = "9.2.2"
|
shadow = "9.2.2"
|
||||||
spotless = "8.0.0"
|
spotless = "8.0.0"
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -172,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -205,15 +203,14 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
Generated
+348
-303
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -45,7 +45,7 @@ public class TurtleModemModeller implements TurtleUpgradeModeller<TurtleModem> {
|
|||||||
private static final ModemModels NORMAL = create("normal");
|
private static final ModemModels NORMAL = create("normal");
|
||||||
private static final ModemModels ADVANCED = create("advanced");
|
private static final ModemModels ADVANCED = create("advanced");
|
||||||
|
|
||||||
public static ModemModels create(String type) {
|
private static ModemModels create(String type) {
|
||||||
return new ModemModels(
|
return new ModemModels(
|
||||||
ModelLocation.ofResource(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "block/turtle_modem_" + type + "_off_left")),
|
ModelLocation.ofResource(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "block/turtle_modem_" + type + "_off_left")),
|
||||||
ModelLocation.ofResource(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "block/turtle_modem_" + type + "_off_right")),
|
ModelLocation.ofResource(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "block/turtle_modem_" + type + "_off_right")),
|
||||||
@@ -54,7 +54,7 @@ public class TurtleModemModeller implements TurtleUpgradeModeller<TurtleModem> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stream<ResourceLocation> getDependencies() {
|
private Stream<ResourceLocation> getDependencies() {
|
||||||
return Stream.of(leftOffModel, rightOffModel, leftOnModel, rightOnModel).flatMap(ModelLocation::getDependencies);
|
return Stream.of(leftOffModel, rightOffModel, leftOnModel, rightOnModel).flatMap(ModelLocation::getDependencies);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-1
@@ -61,6 +61,11 @@ public abstract class SpeakerPeripheral implements IPeripheral {
|
|||||||
*/
|
*/
|
||||||
public static final int SAMPLE_RATE = 48000;
|
public static final int SAMPLE_RATE = 48000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The maximum length of a {@link ResourceLocation} played by {@link #playSound(ILuaContext, String, Optional, Optional)}.
|
||||||
|
*/
|
||||||
|
private static final int MAX_SOUND_LENGTH = 512;
|
||||||
|
|
||||||
private final UUID source = UUID.randomUUID();
|
private final UUID source = UUID.randomUUID();
|
||||||
private final AttachedComputerSet computers = new AttachedComputerSet();
|
private final AttachedComputerSet computers = new AttachedComputerSet();
|
||||||
|
|
||||||
@@ -254,8 +259,10 @@ public abstract class SpeakerPeripheral implements IPeripheral {
|
|||||||
var volume = (float) clampVolume(checkFinite(1, volumeA.orElse(1.0)));
|
var volume = (float) clampVolume(checkFinite(1, volumeA.orElse(1.0)));
|
||||||
var pitch = (float) checkFinite(2, pitchA.orElse(1.0));
|
var pitch = (float) checkFinite(2, pitchA.orElse(1.0));
|
||||||
|
|
||||||
|
if (name.length() > MAX_SOUND_LENGTH) throw new LuaException("bad argument #1 (sound name is too long)");
|
||||||
|
|
||||||
var identifier = ResourceLocation.tryParse(name);
|
var identifier = ResourceLocation.tryParse(name);
|
||||||
if (identifier == null) throw new LuaException("Malformed sound name '" + name + "' ");
|
if (identifier == null) throw new LuaException("bad argument #1 (malformed sound name)");
|
||||||
|
|
||||||
// Prevent playing music discs.
|
// Prevent playing music discs.
|
||||||
var soundEvent = BuiltInRegistries.SOUND_EVENT.get(identifier);
|
var soundEvent = BuiltInRegistries.SOUND_EVENT.get(identifier);
|
||||||
|
|||||||
+2
-2
@@ -235,11 +235,11 @@ public class TurtlePlaceCommand implements TurtleCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setSignText(Level world, SignBlockEntity sign, String message) {
|
private static void setSignText(Level world, SignBlockEntity sign, String message) {
|
||||||
var lines = Splitter.on('\n').splitToList(message);
|
var lines = Splitter.on('\n').splitToStream(message).limit(4).toList();
|
||||||
var firstLine = lines.size() <= 2 ? 1 : 0;
|
var firstLine = lines.size() <= 2 ? 1 : 0;
|
||||||
|
|
||||||
var signText = new SignText();
|
var signText = new SignText();
|
||||||
for (int i = 0, len = Math.min(lines.size(), 4); i < len; i++) {
|
for (int i = 0, len = lines.size(); i < len; i++) {
|
||||||
var line = lines.get(i);
|
var line = lines.get(i);
|
||||||
signText = signText.setMessage(i + firstLine, line.length() > 15
|
signText = signText.setMessage(i + firstLine, line.length() > 15
|
||||||
? Component.literal(line.substring(0, 15))
|
? Component.literal(line.substring(0, 15))
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.Optional;
|
|||||||
* Alternatively, one may specify the desired arguments as normal parameters and the argument parsing code will
|
* Alternatively, one may specify the desired arguments as normal parameters and the argument parsing code will
|
||||||
* be generated automatically.
|
* be generated automatically.
|
||||||
* <p>
|
* <p>
|
||||||
* Each parameter must be one of the given types supported by {@link IArguments} (for instance, {@link int} or
|
* Each parameter must be one of the given types supported by {@link IArguments} (for instance, {@code int} or
|
||||||
* {@link Map}). Optional values are supported by accepting a parameter of type {@link Optional}.
|
* {@link Map}). Optional values are supported by accepting a parameter of type {@link Optional}.
|
||||||
* </li>
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ public class WebsocketHandle {
|
|||||||
* -- }
|
* -- }
|
||||||
* ws.close()
|
* ws.close()
|
||||||
* }</pre>
|
* }</pre>
|
||||||
* @since 1.107.0
|
* @since 1.117.0
|
||||||
*/
|
*/
|
||||||
@LuaFunction
|
@LuaFunction
|
||||||
public final Map<String, String> getResponseHeaders() {
|
public final Map<String, String> getResponseHeaders() {
|
||||||
|
|||||||
@@ -545,11 +545,6 @@ final class ComputerExecutor implements ComputerScheduler.Worker {
|
|||||||
terminal.setCursorPos(0, terminal.getCursorY() + 1);
|
terminal.setCursorPos(0, terminal.getCursorY() + 1);
|
||||||
terminal.write(extra);
|
terminal.write(extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
// And display our generic "CC may be installed incorrectly" message.
|
|
||||||
terminal.setCursorPos(0, terminal.getCursorY() + 1);
|
|
||||||
if (terminal.isColour()) terminal.setTextColour(15 - Colour.WHITE.ordinal());
|
|
||||||
terminal.write("ComputerCraft may be installed incorrectly");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resumeMachine(@Nullable String event, @Nullable Object @Nullable [] args) throws InterruptedException {
|
private void resumeMachine(@Nullable String event, @Nullable Object @Nullable [] args) throws InterruptedException {
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# New features in CC: Tweaked 1.117.1
|
||||||
|
|
||||||
|
Several bug fixes:
|
||||||
|
* Several documentation fixes (MarianoAlipi, Pokebrouserkat).
|
||||||
|
* Fix `pushFluid`/`pullFluid` not working when fluids have NBT (UQuark).
|
||||||
|
* Limit length of sound in `speaker.playSound`.
|
||||||
|
* Remove confusing "ComputerCraft may be installed incorrectly" message.
|
||||||
|
|
||||||
# New features in CC: Tweaked 1.117.0
|
# New features in CC: Tweaked 1.117.0
|
||||||
|
|
||||||
* Support mouse input for pocket computers on a lectern.
|
* Support mouse input for pocket computers on a lectern.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
type determines the type of a file or directory. Prints "file", "directory" or "does not exist".
|
type determines the type of a file or directory. Prints "file", "directory" or "No such path".
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
New features in CC: Tweaked 1.117.0
|
New features in CC: Tweaked 1.117.1
|
||||||
|
|
||||||
* Support mouse input for pocket computers on a lectern.
|
|
||||||
* Pocket computers on a lectern now attach the peripheral below.
|
|
||||||
* Add map colour to block and item details (ShreksHellraiser).
|
|
||||||
* Add potion effects to item details.
|
|
||||||
* add `getResponseHeaders` method to websocket handles.
|
|
||||||
* Update translations.
|
|
||||||
|
|
||||||
Several bug fixes:
|
Several bug fixes:
|
||||||
* Many documentation fixes (McJack123, tomodachi94).
|
* Several documentation fixes (MarianoAlipi, Pokebrouserkat).
|
||||||
* Fix crash when CC:T blocks are placed with Building Gadgets.
|
* Fix `pushFluid`/`pullFluid` not working when fluids have NBT (UQuark).
|
||||||
* Fix redstone relays not updating redstone input/output on chunk load.
|
* Limit length of sound in `speaker.playSound`.
|
||||||
* Fix inconsistency with handling `. .` on Windows.
|
* Remove confusing "ComputerCraft may be installed incorrectly" message.
|
||||||
* Fix bundled cable input not updating with MoreRed.
|
|
||||||
* Fix `websocket_closed` not always being closed when the socket closes due to an error.
|
|
||||||
* Fix `nbt` hash failing to be computed for some items.
|
|
||||||
|
|
||||||
Type "help changelog" to see the full version history.
|
Type "help changelog" to see the full version history.
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ neoForge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
// Force a more recent version of ASM, so we're compatible with Java 25.
|
||||||
|
configureEach { resolutionStrategy.force(libs.asm) }
|
||||||
|
|
||||||
additionalRuntimeClasspath { extendsFrom(jarJar.get()) }
|
additionalRuntimeClasspath { extendsFrom(jarJar.get()) }
|
||||||
|
|
||||||
val testAdditionalRuntimeClasspath by registering {
|
val testAdditionalRuntimeClasspath by registering {
|
||||||
|
|||||||
+20
-8
@@ -13,6 +13,7 @@ import dan200.computercraft.shared.util.CapabilityUtil;
|
|||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.material.Fluid;
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||||
@@ -63,7 +64,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
|
|||||||
|
|
||||||
return fluid == null
|
return fluid == null
|
||||||
? moveFluid(from, actualLimit, to)
|
? moveFluid(from, actualLimit, to)
|
||||||
: moveFluid(from, new FluidStack(fluid, actualLimit), to);
|
: moveFluid(from, fluid, actualLimit, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,7 +89,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
|
|||||||
|
|
||||||
return fluid == null
|
return fluid == null
|
||||||
? moveFluid(from, actualLimit, to)
|
? moveFluid(from, actualLimit, to)
|
||||||
: moveFluid(from, new FluidStack(fluid, actualLimit), to);
|
: moveFluid(from, fluid, actualLimit, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -111,7 +112,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move fluid from one handler to another.
|
* Move any fluid from one handler to another.
|
||||||
*
|
*
|
||||||
* @param from The handler to move from.
|
* @param from The handler to move from.
|
||||||
* @param limit The maximum amount of fluid to move.
|
* @param limit The maximum amount of fluid to move.
|
||||||
@@ -123,15 +124,26 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move fluid from one handler to another.
|
* Move a specific fluid from one handler to another.
|
||||||
*
|
*
|
||||||
* @param from The handler to move from.
|
* @param from The handler to move from.
|
||||||
* @param fluid The fluid and limit to move.
|
* @param fluid The fluid to move.
|
||||||
|
* @param limit The maximum amount of fluid to move.
|
||||||
* @param to The handler to move to.
|
* @param to The handler to move to.
|
||||||
* @return The amount of fluid moved.
|
* @return The amount of fluid moved.
|
||||||
*/
|
*/
|
||||||
private static int moveFluid(IFluidHandler from, FluidStack fluid, IFluidHandler to) {
|
private static int moveFluid(IFluidHandler from, Fluid fluid, int limit, IFluidHandler to) {
|
||||||
return moveFluid(from, from.drain(fluid, IFluidHandler.FluidAction.SIMULATE), fluid.getAmount(), to);
|
// Rather than constructing the FluidStack directly, we try to find a matching fluid (but with possibly
|
||||||
|
// different NBT components) in the tank.
|
||||||
|
for (int i = 0, len = from.getTanks(); i < len; i++) {
|
||||||
|
var currentFluid = from.getFluidInTank(i);
|
||||||
|
if (currentFluid.getFluid() != fluid) continue;
|
||||||
|
|
||||||
|
var extracted = from.drain(currentFluid, IFluidHandler.FluidAction.SIMULATE);
|
||||||
|
if (!extracted.isEmpty()) return moveFluid(from, extracted, limit, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,7 +156,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
|
|||||||
* @return The amount of fluid moved.
|
* @return The amount of fluid moved.
|
||||||
*/
|
*/
|
||||||
private static int moveFluid(IFluidHandler from, FluidStack extracted, int limit, IFluidHandler to) {
|
private static int moveFluid(IFluidHandler from, FluidStack extracted, int limit, IFluidHandler to) {
|
||||||
if (extracted.getAmount() <= 0) return 0;
|
if (extracted.isEmpty()) return 0;
|
||||||
|
|
||||||
// Limit the amount to extract.
|
// Limit the amount to extract.
|
||||||
extracted = extracted.copy();
|
extracted = extracted.copy();
|
||||||
|
|||||||
Reference in New Issue
Block a user