1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-06-27 07:32:56 +00:00

Bump dependency versions

Mostly in prep for 1.19.4.

 - Update to Loom 1.1.

   - Simplifies our handling of remapped configurations a little.
   - Removes the need for a fake fabric.mod.json in the API jar.

   For reasons I don't quite understand, this required us to bump the
   Fabric API version. Otherwise interfaces are not injected.

 - Update to Rollup 3.0.

 - Do NOT update NullAway: It now correctly checks @Nullable fields in
   inherited classes. This is good, but also a pain as Minecraft is a
   little over-eager in where it puts @Nullable.
This commit is contained in:
Jonathan Coates 2023-03-14 18:41:31 +00:00
parent 04fed62dad
commit a74089d8ae
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
21 changed files with 638 additions and 866 deletions

View File

@ -172,7 +172,7 @@ spotless {
} }
val ktlintConfig = mapOf( val ktlintConfig = mapOf(
"disabled_rules" to "no-wildcard-imports", "ktlint_standard_no-wildcard-imports" to "disabled",
"ij_kotlin_allow_trailing_comma" to "true", "ij_kotlin_allow_trailing_comma" to "true",
"ij_kotlin_allow_trailing_comma_on_call_site" to "true", "ij_kotlin_allow_trailing_comma_on_call_site" to "true",
) )

View File

@ -2,24 +2,25 @@
# Minecraft # Minecraft
# 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.
fabric-api = "0.68.1+1.19.3" # Remember to update corresponding versions in fabric.mod.json/mods.toml
fabric-loader = "0.14.11" fabric-api = "0.75.1+1.19.3"
fabric-loader = "0.14.17"
forge = "44.1.0" forge = "44.1.0"
forgeSpi = "6.0.0" forgeSpi = "6.0.0"
mixin = "0.8.5" mixin = "0.8.5"
parchment = "2022.11.27" parchment = "2023.03.12"
parchmentMc = "1.19.2" parchmentMc = "1.19.3"
# Normal dependencies # Normal dependencies
asm = "9.3" asm = "9.3"
autoService = "1.0.1" autoService = "1.0.1"
checkerFramework = "3.12.0" checkerFramework = "3.32.0"
cobalt = "0.6.0" cobalt = "0.6.0"
fastutil = "8.5.9" fastutil = "8.5.9"
guava = "31.1-jre" guava = "31.1-jre"
jetbrainsAnnotations = "23.0.0" jetbrainsAnnotations = "24.0.1"
jsr305 = "3.0.2" jsr305 = "3.0.2"
kotlin = "1.8.0" kotlin = "1.8.10"
kotlin-coroutines = "1.6.4" kotlin-coroutines = "1.6.4"
netty = "4.1.82.Final" netty = "4.1.82.Final"
nightConfig = "3.6.5" nightConfig = "3.6.5"
@ -36,30 +37,30 @@ rubidium = "0.6.1"
sodium = "mc1.19.3-0.4.6" sodium = "mc1.19.3-0.4.6"
# Testing # Testing
byteBuddy = "1.12.19" byteBuddy = "1.14.2"
hamcrest = "2.2" hamcrest = "2.2"
jqwik = "1.7.0" jqwik = "1.7.2"
junit = "5.9.1" junit = "5.9.2"
# Build tools # Build tools
cctJavadoc = "1.6.0" cctJavadoc = "1.6.0"
checkstyle = "10.3.4" checkstyle = "10.3.4"
curseForgeGradle = "1.0.11" curseForgeGradle = "1.0.11"
errorProne-core = "2.14.0" errorProne-core = "2.18.0"
errorProne-plugin = "2.0.2" errorProne-plugin = "3.0.1"
fabric-loom = "1.0-SNAPSHOT" fabric-loom = "1.1.10"
forgeGradle = "5.1.+" forgeGradle = "5.1.+"
githubRelease = "2.2.12" githubRelease = "2.2.12"
ideaExt = "1.1.6" ideaExt = "1.1.6"
illuaminate = "0.1.0-20-g8c483a4" illuaminate = "0.1.0-24-gdb28902"
librarian = "1.+" librarian = "1.+"
minotaur = "2.+" minotaur = "2.+"
mixinGradle = "0.7.+" mixinGradle = "0.7.+"
nullAway = "0.9.9" nullAway = "0.9.9"
quiltflower = "1.7.3" quiltflower = "1.8.0"
shadow = "7.1.2" shadow = "7.1.2"
spotless = "6.8.0" spotless = "6.17.0"
taskTree = "2.1.0" taskTree = "2.1.1"
vanillaGradle = "0.2.1-SNAPSHOT" vanillaGradle = "0.2.1-SNAPSHOT"
[libraries] [libraries]
@ -145,7 +146,7 @@ kotlin = ["kotlin-stdlib", "kotlin-coroutines"]
externalMods-common = ["jei-api", "forgeConfig", "nightConfig-core", "nightConfig-toml"] externalMods-common = ["jei-api", "forgeConfig", "nightConfig-core", "nightConfig-toml"]
externalMods-forge-compile = ["oculus", "jei-api"] externalMods-forge-compile = ["oculus", "jei-api"]
externalMods-forge-runtime = [] externalMods-forge-runtime = []
externalMods-fabric = ["fabric-loader", "fabric-api", "forgeConfig", "nightConfig-core", "nightConfig-toml"] externalMods-fabric = ["forgeConfig", "nightConfig-core", "nightConfig-toml"]
externalMods-fabric-compile = ["iris", "jei-api", "rei-api", "rei-builtin"] externalMods-fabric-compile = ["iris", "jei-api", "rei-api", "rei-builtin"]
externalMods-fabric-runtime = ["modmenu"] externalMods-fabric-runtime = ["modmenu"]

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

6
gradlew vendored
View File

@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \ org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args. # Use "xargs" to parse quoted args.
# #
# With -n1 it outputs one arg per line, with the quotes and backslashes removed. # With -n1 it outputs one arg per line, with the quotes and backslashes removed.

14
gradlew.bat vendored
View File

@ -14,7 +14,7 @@
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +75,15 @@ set CLASSPATH=%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
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

1309
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,19 +10,19 @@
"tslib": "^2.0.3" "tslib": "^2.0.3"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-typescript": "^8.2.5", "@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-url": "^7.0.0", "@rollup/plugin-typescript": "^11.0.0",
"@types/glob": "^7.2.0", "@rollup/plugin-url": "^8.0.1",
"@types/glob": "^8.1.0",
"@types/react-dom": "^18.0.5", "@types/react-dom": "^18.0.5",
"glob": "^8.0.3", "glob": "^9.3.0",
"react": "^18.1.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",
"rehype": "^12.0.1", "react": "^18.1.0",
"rehype-highlight": "^5.0.2", "rehype-highlight": "^6.0.0",
"rehype-react": "^7.1.1", "rehype-react": "^7.1.1",
"rehype": "^12.0.1",
"requirejs": "^2.3.6", "requirejs": "^2.3.6",
"rollup": "^2.33.1", "rollup": "^3.19.1",
"rollup-plugin-terser": "^7.0.2",
"ts-node": "^10.8.0", "ts-node": "^10.8.0",
"typescript": "^4.0.5" "typescript": "^4.0.5"
} }

View File

@ -70,7 +70,7 @@ public class CommandBuilder<S> implements CommandNodeBuilder<S, Command<S>> {
return argMany(name, RepeatArgumentType.someFlat(type, ARGUMENT_EXPECTED), empty); return argMany(name, RepeatArgumentType.someFlat(type, ARGUMENT_EXPECTED), empty);
} }
private <T, U> CommandNodeBuilder<S, ArgCommand<S, List<T>>> argMany(String name, RepeatArgumentType<T, ?> type, Supplier<List<T>> empty) { private <T> CommandNodeBuilder<S, ArgCommand<S, List<T>>> argMany(String name, RepeatArgumentType<T, ?> type, Supplier<List<T>> empty) {
if (args.isEmpty()) throw new IllegalStateException("Cannot have empty arg chain builder"); if (args.isEmpty()) throw new IllegalStateException("Cannot have empty arg chain builder");
return command -> { return command -> {

View File

@ -7,6 +7,7 @@ package dan200.computercraft.shared.util;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.Month; import java.time.Month;
import java.time.ZoneId;
public enum Holiday { public enum Holiday {
NONE, NONE,
@ -24,9 +25,9 @@ public enum Holiday {
CHRISTMAS; CHRISTMAS;
public static Holiday getCurrent() { public static Holiday getCurrent() {
var calendar = LocalDateTime.now(); var now = LocalDateTime.now(ZoneId.systemDefault());
var month = calendar.getMonth(); var month = now.getMonth();
var day = calendar.getDayOfMonth(); var day = now.getDayOfMonth();
if (month == Month.FEBRUARY && day == 14) return VALENTINES; if (month == Month.FEBRUARY && day == 14) return VALENTINES;
if (month == Month.DECEMBER && day >= 24 && day <= 26) return CHRISTMAS; if (month == Month.DECEMBER && day >= 24 && day <= 26) return CHRISTMAS;
return NONE; return NONE;

View File

@ -9,6 +9,7 @@ import net.minecraft.SharedConstants;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Overwrite;
// TODO(1.19.4): Remove this
@Mixin(SharedConstants.class) @Mixin(SharedConstants.class)
class SharedConstantsMixin { class SharedConstantsMixin {
/** /**

View File

@ -19,6 +19,4 @@ tasks.jar {
manifest { manifest {
attributes["Fabric-Loom-Remap"] = "true" attributes["Fabric-Loom-Remap"] = "true"
} }
from("src/main/modJson") // TODO: Remove once Loom 1.1 is out.
} }

View File

@ -1,9 +0,0 @@
{
"schemaVersion": 1,
"id": "computercraft_api_stub",
"version": "1.0",
"name": "ComputerCraft API",
"description": "A placeholder mod to ensure Loom deobfuscates the API jar.",
"license": "ComputerCraft Public License (https://raw.githubusercontent.com/dan200/ComputerCraft/master/LICENSE)",
"environment": "*"
}

View File

@ -18,7 +18,7 @@ cct {
} }
fun addRemappedConfiguration(name: String) { fun addRemappedConfiguration(name: String) {
val original = configurations.create(name) { configurations.create(name) {
isCanBeConsumed = false isCanBeConsumed = false
isCanBeResolved = true isCanBeResolved = true
} }
@ -28,7 +28,6 @@ fun addRemappedConfiguration(name: String) {
onRuntimeClasspath.set(false) onRuntimeClasspath.set(false)
targetConfigurationName.set(name) targetConfigurationName.set(name)
} }
original.extendsFrom(configurations["mod${capitalName}Mapped"])
} }
addRemappedConfiguration("testWithSodium") addRemappedConfiguration("testWithSodium")

View File

@ -49,8 +49,8 @@ import java.util.concurrent.Executor;
public class ComputerCraft { public class ComputerCraft {
public static void init() { public static void init() {
NetworkHandler.init(); NetworkHandler.init();
FabricRegistryBuilder.createSimple(TurtleUpgradeSerialiser.class, TurtleUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); FabricRegistryBuilder.createSimple(TurtleUpgradeSerialiser.REGISTRY_ID).buildAndRegister();
FabricRegistryBuilder.createSimple(PocketUpgradeSerialiser.class, PocketUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); FabricRegistryBuilder.createSimple(PocketUpgradeSerialiser.REGISTRY_ID).buildAndRegister();
ModRegistry.register(); ModRegistry.register();
ModRegistry.registerMainThread(); ModRegistry.registerMainThread();
ModRegistry.registerCreativeTab(FabricItemGroup.builder(new ResourceLocation(ComputerCraftAPI.MOD_ID, "tab"))).build(); ModRegistry.registerCreativeTab(FabricItemGroup.builder(new ResourceLocation(ComputerCraftAPI.MOD_ID, "tab"))).build();

View File

@ -47,7 +47,7 @@
], ],
"depends": { "depends": {
"fabricloader": ">=0.14.11", "fabricloader": ">=0.14.11",
"fabric-api": ">=0.68.1", "fabric-api": ">=0.75.1",
"minecraft": ">=1.19.3 <1.20" "minecraft": ">=1.19.3 <1.20"
}, },
"accessWidener": "computercraft.accesswidener" "accessWidener": "computercraft.accesswidener"

View File

@ -1,59 +0,0 @@
/*
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.mixin.gametest;
import net.minecraft.gametest.framework.StructureUtils;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* Undo Fabric's mixin which ignores {@link StructureUtils#testStructuresDir}.
*/
@Mixin(value = StructureUtils.class, priority = 0)
public class StructureUtilsMixin {
// TODO: Replace with https://github.com/FabricMC/fabric/pull/2555 if merged.
@Inject(method = "getStructureTemplate", at = @At("HEAD"), cancellable = true)
@SuppressWarnings("UnusedMethod")
private static void getStructureTemplate(String structureName, ServerLevel serverLevel, CallbackInfoReturnable<StructureTemplate> result) {
result.setReturnValue(getStructureTemplateImpl(structureName, serverLevel));
}
@Unique
private static StructureTemplate getStructureTemplateImpl(String structureName, ServerLevel serverLevel) {
var structureTemplateManager = serverLevel.getStructureManager();
var structureId = new ResourceLocation(structureName);
var resourceStructure = structureTemplateManager.get(structureId);
if (resourceStructure.isPresent()) {
return resourceStructure.get();
} else {
var path = Paths.get(StructureUtils.testStructuresDir, structureId.getPath() + ".snbt");
var structureInfo = tryLoadStructure(path);
if (structureInfo == null) {
throw new RuntimeException("Could not find structure file " + path + ", and the structure is not available in the world structures either.");
}
return structureTemplateManager.readStructure(structureInfo);
}
}
@Shadow
private static CompoundTag tryLoadStructure(Path pathToStructure) {
throw new IllegalArgumentException("Uncallable");
}
}

View File

@ -1,12 +0,0 @@
{
"required": true,
"package": "dan200.computercraft.mixin.gametest",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_17",
"injectors": {
"defaultRequire": 1
},
"mixins": [
"StructureUtilsMixin"
]
}

View File

@ -11,8 +11,7 @@
] ]
}, },
"mixins": [ "mixins": [
"computercraft-gametest.mixins.json", "computercraft-gametest.mixins.json"
"computercraft-gametest.fabric.mixins.json"
], ],
"depends": { "depends": {
"computercraft": "*" "computercraft": "*"

View File

@ -3,7 +3,7 @@ import path from "path";
import typescript from "@rollup/plugin-typescript"; import typescript from "@rollup/plugin-typescript";
import url from '@rollup/plugin-url'; import url from '@rollup/plugin-url';
import { terser } from "rollup-plugin-terser"; import terser from "@rollup/plugin-terser";
const input = "src"; const input = "src";
const requirejs = readFileSync("../../node_modules/requirejs/require.js"); const requirejs = readFileSync("../../node_modules/requirejs/require.js");
@ -25,7 +25,10 @@ export default {
}); });
`, `,
format: "amd", format: "amd",
preferConst: true, generatedCode: {
preset: "es2015",
constBindings: true,
},
amd: { amd: {
define: "require", define: "require",
} }

View File

@ -7,7 +7,7 @@
* Yes, this would be so much nicer with next.js. * Yes, this would be so much nicer with next.js.
*/ */
import * as fs from "fs/promises"; import * as fs from "fs/promises";
import globModule from "glob"; import glob from "glob";
import * as path from "path"; import * as path from "path";
import { createElement, createElement as h, Fragment } from 'react'; import { createElement, createElement as h, Fragment } from 'react';
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
@ -15,14 +15,11 @@ import rehypeHighlight from "rehype-highlight";
import rehypeParse from 'rehype-parse'; import rehypeParse from 'rehype-parse';
import rehypeReact from 'rehype-react'; import rehypeReact from 'rehype-react';
import { unified } from 'unified'; import { unified } from 'unified';
import { promisify } from "util";
// Our components // Our components
import Recipe from "./components/Recipe.js"; import Recipe from "./components/Recipe.js";
import { noChildren } from "./components/support.js"; import { noChildren } from "./components/support.js";
import { DataExport, WithExport } from "./components/WithExport.js"; import { DataExport, WithExport } from "./components/WithExport.js";
const glob = promisify(globModule);
(async () => { (async () => {
const base = "build/illuaminate"; const base = "build/illuaminate";