1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-04-18 13:01:22 +00:00

Merge branch 'mc-1.20.x' into mc-1.21.x

This commit is contained in:
Jonathan Coates
2026-02-22 12:56:26 +00:00
26 changed files with 427 additions and 368 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- name: 📥 Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 25
distribution: 'temurin'
- name: 📥 Setup Gradle
@@ -87,7 +87,7 @@ jobs:
- name: 📥 Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 25
distribution: 'temurin'
- name: 📥 Setup Gradle

View File

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

View File

@@ -6,7 +6,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -20,14 +20,14 @@ repos:
exclude: "tsconfig\\.json$"
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
rev: 3.6.0
hooks:
- id: editorconfig-checker
args: ['-disable-indentation']
exclude: "^(.*\\.(bat)|LICENSE)$"
- repo: https://github.com/fsfe/reuse-tool
rev: v5.0.2
rev: v6.2.0
hooks:
- id: reuse

View File

@@ -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.
- 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/).
- [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"
[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"
[docs]: https://tweaked.cc/ "CC: Tweaked documentation"
[ldoc]: http://stevedonovan.github.io/ldoc/ "ldoc, a Lua documentation generator."

View File

@@ -160,7 +160,7 @@ tasks.javadoc {
options {
val stdOptions = this as StandardJavadocDocletOptions
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/")
}
}

View File

@@ -45,9 +45,9 @@ class CCTweakedPlugin : Plugin<Project> {
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.

View File

@@ -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
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.
@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[2] false If crafting fails.
@treturn string A string describing why crafting failed.

View File

@@ -12,7 +12,7 @@ neogradle.subsystems.conventions.runs.enabled=false
# Mod properties
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
mcVersion=1.21.1

View File

@@ -1,2 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
toolchainVersion=25

View File

@@ -8,7 +8,7 @@
# 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
fabric-api = "0.102.1+1.21.1"
fabric-loader = "0.15.11"
fabric-loader = "0.18.4"
neoForge = "21.1.9"
neoMergeTool = "2.0.0"
mixin = "0.8.5"
@@ -23,7 +23,7 @@ netty = "4.1.97.Final"
slf4j = "2.0.9"
# Core dependencies (independent of Minecraft)
asm = "9.9"
asm = "9.9.1"
autoService = "1.1.1"
checkerFramework = "3.51.1"
cobalt = { strictly = "0.9.7" }
@@ -31,7 +31,7 @@ commonsCli = "1.10.0"
jetbrainsAnnotations = "26.0.2-1"
jspecify = "1.0.0"
jzlib = "1.1.3"
kotlin = "2.2.21"
kotlin = "2.3.0"
kotlin-coroutines = "1.10.2"
nightConfig = "3.8.3"
@@ -58,18 +58,18 @@ junitPlatform = "6.0.1"
jmh = "1.37"
# Build tools
cctJavadoc = "1.8.5"
cctJavadoc = "1.9.0"
checkstyle = "12.1.1"
errorProne-core = "2.45.0"
errorProne-plugin = "4.3.0"
fabric-loom = "1.14.5"
fabric-loom = "1.15.2"
githubRelease = "2.5.2"
gradleVersions = "0.53.0"
ideaExt = "1.3"
illuaminate = "0.1.0-83-g1131f68"
lwjgl = "3.3.6"
minotaur = "2.8.7"
modDevGradle = "2.0.124"
modDevGradle = "2.0.140"
nullAway = "0.12.11"
shadow = "9.2.2"
spotless = "8.0.0"

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
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
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

9
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# 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
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -205,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# 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.
# * 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.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

3
gradlew.bat vendored
View File

@@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@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
@rem End local scope for the variables with windows NT shell

651
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ public class TurtleModemModeller implements TurtleUpgradeModeller<TurtleModem> {
private static final ModemModels NORMAL = create("normal");
private static final ModemModels ADVANCED = create("advanced");
public static ModemModels create(String type) {
private static ModemModels create(String type) {
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_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);
}
}

View File

@@ -61,6 +61,11 @@ public abstract class SpeakerPeripheral implements IPeripheral {
*/
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 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 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);
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.
var soundEvent = BuiltInRegistries.SOUND_EVENT.get(identifier);

View File

@@ -235,11 +235,11 @@ public class TurtlePlaceCommand implements TurtleCommand {
}
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 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);
signText = signText.setMessage(i + firstLine, line.length() > 15
? Component.literal(line.substring(0, 15))

View File

@@ -24,7 +24,7 @@ import java.util.Optional;
* Alternatively, one may specify the desired arguments as normal parameters and the argument parsing code will
* be generated automatically.
* <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}.
* </li>
* </ul>

View File

@@ -129,7 +129,7 @@ public class WebsocketHandle {
* -- }
* ws.close()
* }</pre>
* @since 1.107.0
* @since 1.117.0
*/
@LuaFunction
public final Map<String, String> getResponseHeaders() {

View File

@@ -545,11 +545,6 @@ final class ComputerExecutor implements ComputerScheduler.Worker {
terminal.setCursorPos(0, terminal.getCursorY() + 1);
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 {

View File

@@ -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
* Support mouse input for pocket computers on a lectern.

View File

@@ -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".

View File

@@ -1,19 +1,9 @@
New features in CC: Tweaked 1.117.0
* 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.
New features in CC: Tweaked 1.117.1
Several bug fixes:
* Many documentation fixes (McJack123, tomodachi94).
* Fix crash when CC:T blocks are placed with Building Gadgets.
* Fix redstone relays not updating redstone input/output on chunk load.
* Fix inconsistency with handling `. .` on Windows.
* 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.
* 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.
Type "help changelog" to see the full version history.

View File

@@ -124,6 +124,9 @@ neoForge {
}
configurations {
// Force a more recent version of ASM, so we're compatible with Java 25.
configureEach { resolutionStrategy.force(libs.asm) }
additionalRuntimeClasspath { extendsFrom(jarJar.get()) }
val testAdditionalRuntimeClasspath by registering {

View File

@@ -13,6 +13,7 @@ import dan200.computercraft.shared.util.CapabilityUtil;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.server.level.ServerLevel;
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.fluids.FluidStack;
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
@@ -63,7 +64,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
return fluid == null
? moveFluid(from, actualLimit, to)
: moveFluid(from, new FluidStack(fluid, actualLimit), to);
: moveFluid(from, fluid, actualLimit, to);
}
@Override
@@ -88,7 +89,7 @@ public final class FluidMethods extends AbstractFluidMethods<IFluidHandler> {
return fluid == null
? moveFluid(from, actualLimit, to)
: moveFluid(from, new FluidStack(fluid, actualLimit), to);
: moveFluid(from, fluid, actualLimit, to);
}
@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 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 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.
* @return The amount of fluid moved.
*/
private static int moveFluid(IFluidHandler from, FluidStack fluid, IFluidHandler to) {
return moveFluid(from, from.drain(fluid, IFluidHandler.FluidAction.SIMULATE), fluid.getAmount(), to);
private static int moveFluid(IFluidHandler from, Fluid fluid, int limit, IFluidHandler 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.
*/
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.
extracted = extracted.copy();