Skip to content

Commit 8f135ef

Browse files
committed
Merge branch 'refs/heads/2023.3' into 2024.1
2 parents 1f6801a + 5782568 commit 8f135ef

File tree

14 files changed

+38
-20
lines changed

14 files changed

+38
-20
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ plugins {
3434
mcdev
3535
groovy
3636
idea
37-
id("org.jetbrains.intellij") version "1.17.0"
37+
id("org.jetbrains.intellij") version "1.17.2"
3838
id("org.cadixdev.licenser")
3939
id("org.jlleitschuh.gradle.ktlint") version "10.3.0"
4040
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ kotlin.code.style=official
2424
ideaVersion = 241.11761.10-EAP-SNAPSHOT
2525
ideaVersionName = 2024.1
2626

27-
coreVersion = 1.7.2
27+
coreVersion = 1.7.3
2828
downloadIdeaSources = true
2929

3030
pluginTomlVersion = 241.11761.9

gradle/wrapper/gradle-wrapper.jar

-19.8 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

src/main/kotlin/platform/forge/gradle/ForgeRunConfigDataService.kt

+4
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ class ForgeRunConfigDataService : AbstractProjectDataService<ProjectData, Projec
176176
}
177177
}
178178

179+
if (project.isDisposed) {
180+
return
181+
}
182+
179183
project.guessProjectDir()?.let { dir ->
180184
LocalFileSystem.getInstance().refreshFiles(listOf(dir), true, true, null)
181185
}

src/main/kotlin/platform/forge/util/ForgeConstants.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ object ForgeConstants {
5151
// From https://github.com/MinecraftForge/MinecraftForge/blob/38a5400a8c878fe39cd389e6d4f68619d2738b88/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModInfo.java#L45
5252
val MOD_ID_REGEX = "^[a-z][a-z0-9_-]{1,63}$".toRegex()
5353

54-
val DISPLAY_TEST_MANIFEST_VERSION = SemanticVersion.release(41, 0, 15)
54+
val DISPLAY_TEST_MANIFEST_VERSION = SemanticVersion.release(40, 2, 14)
5555
val CLIENT_ONLY_MANIFEST_VERSION = SemanticVersion.release(49, 0, 6)
5656
}

src/main/kotlin/platform/mixin/handlers/injectionPoint/NewInsnInjectionPoint.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class NewInsnSelectorParser : MixinSelectorParser {
223223
return if (strippedValue.startsWith('(')) {
224224
NewInsnDescriptorSelector(strippedValue)
225225
} else {
226-
NewInsnTypeSelector(strippedValue)
226+
NewInsnTypeSelector(strippedValue.removeSurrounding("L", ";"))
227227
}
228228
}
229229
}

src/main/kotlin/platform/velocity/creator/asset-steps.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ class VelocityModifyMainClassStep(
103103
val authors = data.getUserData(AuthorsStep.KEY) ?: emptyList()
104104
val dependencies = data.getUserData(DependStep.KEY) ?: emptyList()
105105

106-
NonProjectFileWritingAccessProvider.disableChecksDuring {
107-
project.runWriteTaskInSmartMode {
106+
project.runWriteTaskInSmartMode {
107+
NonProjectFileWritingAccessProvider.disableChecksDuring {
108108
val mainClassVirtualFile = VfsUtil.findFile(Path.of(mainClassFile), true)
109-
?: return@runWriteTaskInSmartMode
109+
?: return@disableChecksDuring
110110
val mainClassPsi = PsiManager.getInstance(project).findFile(mainClassVirtualFile) as? PsiJavaFile
111-
?: return@runWriteTaskInSmartMode
111+
?: return@disableChecksDuring
112112

113113
val psiClass = mainClassPsi.classes[0]
114114
val annotation = buildString {

src/main/kotlin/platform/velocity/creator/ui-steps.kt

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class VelocityVersionStep(
9595
private fun applyJdkVersion() {
9696
SemanticVersion.tryParse(version)?.let { version ->
9797
val preferredJdk = when {
98+
version >= SemanticVersion.release(3, 3) -> JavaSdkVersion.JDK_17
9899
version >= SemanticVersion.release(3) -> JavaSdkVersion.JDK_11
99100
else -> JavaSdkVersion.JDK_1_8
100101
}

src/main/kotlin/toml/platform/forge/ModsTomlSchema.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ license="All rights reserved"
4848
showAsResourcePack=false
4949
# A URL to refer people to when problems occur with this mod.
5050
issueTrackerURL="http://my.issue.tracker/"
51+
# If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN), set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers.
52+
clientSideOnly=false
5153
# A list of mods - how many allowed here is determined by the individual mod loader
5254
[[mods]]
5355
# The modid of the mod.
@@ -74,7 +76,7 @@ authors="Love, Cheese and small house plants"
7476
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
7577
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
7678
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
77-
displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
79+
displayTest="MATCH_VERSION" # if nothing is specified, MATCH_VERSION is the default when clientSideOnly=false, otherwise IGNORE_ALL_VERSION when clientSideOnly=true (#optional)
7880
7981
# The description text for the mod (multi line!)
8082
description='''

src/main/kotlin/toml/platform/forge/completion/ModsTomlCompletionContributor.kt

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ModsTomlCompletionContributor : CompletionContributor() {
5858
extendBooleanValues("showAsResourcePack")
5959
extendBooleanValues("logoBlur")
6060
extendBooleanValues("mandatory")
61+
extendBooleanValues("clientSideOnly")
6162
}
6263

6364
private fun extendKnownValues(key: String, values: Set<String>) =

src/main/kotlin/toml/platform/forge/inspections/ModsTomlValidationInspection.kt

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ class ModsTomlValidationInspection : LocalInspectionTool() {
112112
holder.registerProblem(value, TextRange(1, endOffset), "Order $order does not exist")
113113
}
114114
}
115+
"clientSideOnly" -> {
116+
val forgeVersion = runCatching {
117+
keyValue.findMcpModule()?.getSettings()?.platformVersion?.let(SemanticVersion::parse)
118+
}.getOrNull()
119+
val minVersion = ForgeConstants.CLIENT_ONLY_MANIFEST_VERSION
120+
if (forgeVersion != null && forgeVersion < minVersion) {
121+
holder.registerProblem(keyValue.key, "ClientSideOnly is only available since $minVersion")
122+
}
123+
}
115124
}
116125
}
117126

src/test/kotlin/platform/forge/ModsTomlCompletionTest.kt

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ModsTomlCompletionTest : BasePlatformTestCase() {
5353
"license",
5454
"showAsResourcePack",
5555
"issueTrackerURL",
56+
"clientSideOnly",
5657
)
5758
}
5859

0 commit comments

Comments
 (0)