Skip to content

Commit 6a04b37

Browse files
committed
Merge branch '2022.3' into 2023.1
# Conflicts: # src/main/kotlin/platform/mixin/handlers/ModifyConstantHandler.kt
2 parents b0c7c8c + b13eb25 commit 6a04b37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1642
-750
lines changed

build.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.cadixdev.gradle.licenser.tasks.LicenseUpdate
2323
import org.gradle.internal.jvm.Jvm
2424
import org.jetbrains.gradle.ext.settings
2525
import org.jetbrains.gradle.ext.taskTriggers
26+
import org.jetbrains.intellij.tasks.PrepareSandboxTask
2627
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2728
import org.jlleitschuh.gradle.ktlint.tasks.BaseKtLintCheckTask
2829
import org.jlleitschuh.gradle.ktlint.tasks.KtLintFormatTask
@@ -71,6 +72,12 @@ val gradleToolingExtensionJar = tasks.register<Jar>(gradleToolingExtensionSource
7172
archiveClassifier.set("gradle-tooling-extension")
7273
}
7374

75+
val externalAnnotationsJar = tasks.register<Jar>("externalAnnotationsJar") {
76+
from("externalAnnotations")
77+
destinationDirectory.set(layout.buildDirectory.dir("externalAnnotations"))
78+
archiveFileName.set("externalAnnotations.jar")
79+
}
80+
7481
repositories {
7582
maven("https://repo.denwav.dev/repository/maven-public/")
7683
maven("https://maven.fabricmc.net/") {
@@ -301,6 +308,9 @@ license {
301308
register("grammars") {
302309
files.from(project.fileTree("src/main/grammars"))
303310
}
311+
register("externalAnnotations") {
312+
files.from(project.fileTree("externalAnnotations"))
313+
}
304314
}
305315
}
306316

@@ -359,6 +369,12 @@ tasks.register("cleanSandbox", Delete::class) {
359369
delete(layout.projectDirectory.dir(".sandbox"))
360370
}
361371

372+
tasks.withType<PrepareSandboxTask> {
373+
from(externalAnnotationsJar) {
374+
into("Minecraft Development/lib/resources")
375+
}
376+
}
377+
362378
tasks.runIde {
363379
maxHeapSize = "4G"
364380

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="com.mojang.blaze3d.platform.InputConstants com.mojang.blaze3d.platform.InputConstants.Key getKey(java.lang.String) 0">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
24+
</item>
25+
</root>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, int, java.lang.String) 0">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
24+
</item>
25+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, int, java.lang.String) 2">
26+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
27+
</item>
28+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 0">
29+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
30+
</item>
31+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 3">
32+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
33+
</item>
34+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 0">
35+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
36+
</item>
37+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 4">
38+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
39+
</item>
40+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, com.mojang.blaze3d.platform.InputConstants.Key, java.lang.String) 0">
41+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
42+
</item>
43+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, com.mojang.blaze3d.platform.InputConstants.Key, java.lang.String) 3">
44+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
45+
</item>
46+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, net.minecraftforge.client.settings.KeyModifier, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 0">
47+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
48+
</item>
49+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, net.minecraftforge.client.settings.KeyModifier, com.mojang.blaze3d.platform.InputConstants.Type, int, java.lang.String) 5">
50+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
51+
</item>
52+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, net.minecraftforge.client.settings.KeyModifier, com.mojang.blaze3d.platform.InputConstants.Key, java.lang.String) 0">
53+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
54+
</item>
55+
<item name="net.minecraft.client.KeyMapping KeyMapping(java.lang.String, net.minecraftforge.client.settings.IKeyConflictContext, net.minecraftforge.client.settings.KeyModifier, com.mojang.blaze3d.platform.InputConstants.Key, java.lang.String) 4">
56+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
57+
</item>
58+
</root>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="net.minecraft.client.resources.language.I18n java.lang.String get(java.lang.String, java.lang.Object...) 0">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable">
24+
<val name="foldMethod" val="true"/>
25+
</annotation>
26+
</item>
27+
<item name="net.minecraft.client.resources.language.I18n boolean exists(java.lang.String) 0">
28+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
29+
</item>
30+
</root>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="net.minecraft.command.CommandException CommandException(java.lang.String, java.lang.Object...) 0">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
24+
</item>
25+
</root>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="net.minecraft.network.chat.TranslatableComponent TranslatableComponent(java.lang.String) 0">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable">
24+
<val name="foldMethod" val="true"/>
25+
</annotation>
26+
</item>
27+
<item name="net.minecraft.network.chat.TranslatableComponent TranslatableComponent(java.lang.String, java.lang.Object...) 0">
28+
<annotation name="com.demonwav.mcdev.annotations.Translatable">
29+
<val name="foldMethod" val="true"/>
30+
</annotation>
31+
</item>
32+
<item name="net.minecraft.network.chat.Component net.minecraft.network.chat.MutableComponent translatable(java.lang.String) 0">
33+
<annotation name="com.demonwav.mcdev.annotations.Translatable">
34+
<val name="foldMethod" val="true"/>
35+
</annotation>
36+
</item>
37+
<item name="net.minecraft.network.chat.Component net.minecraft.network.chat.MutableComponent translatable(java.lang.String, java.lang.Object...) 0">
38+
<annotation name="com.demonwav.mcdev.annotations.Translatable">
39+
<val name="foldMethod" val="true"/>
40+
</annotation>
41+
</item>
42+
<item name="net.minecraft.network.chat.Component net.minecraft.network.chat.MutableComponent translatableWithFallback(java.lang.String, java.lang.String) 0">
43+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
44+
</item>
45+
<item name="net.minecraft.network.chat.Component net.minecraft.network.chat.MutableComponent translatableWithFallback(java.lang.String, java.lang.String, java.lang.Object...) 0">
46+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
47+
</item>
48+
</root>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Minecraft Development for IntelliJ
3+
4+
https://mcdev.io/
5+
6+
Copyright (C) 2023 minecraft-dev
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as published
10+
by the Free Software Foundation, version 3.0 only.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
-->
20+
21+
<root>
22+
<item name="net.minecraftforge.server.command.TextComponentHelper net.minecraft.network.chat.BaseComponent createComponentTranslation(net.minecraft.commands.CommandSource, java.lang.String, java.lang.Object...) 1">
23+
<annotation name="com.demonwav.mcdev.annotations.Translatable"/>
24+
</item>
25+
</root>

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Minecraft Development for IntelliJ
2323
<td align="left">2023.2</td>
2424
<td align="left"><a href="https://ci.denwav.dev/viewType.html?buildTypeId=MinecraftDev_Nightly_20232"><img src="https://ci.denwav.dev/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20232)/statusIcon.svg" alt="2023.2 Nightly Status" /></a></td>
2525
</tr>
26+
<tr>
27+
<td align="left">2023.3</td>
28+
<td align="left"><a href="https://ci.denwav.dev/viewType.html?buildTypeId=MinecraftDev_Nightly_20233"><img src="https://ci.denwav.dev/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20233)/statusIcon.svg" alt="2023.3 Nightly Status" /></a></td>
29+
</tr>
2630
<tr>
2731
<td align="right"><b>OS Tests</b></td>
2832
<td align="left" colspan="2">

src/main/kotlin/facet/MinecraftFacetConfiguration.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ import com.intellij.util.xmlb.annotations.XCollection
3131
class MinecraftFacetConfiguration : FacetConfiguration, PersistentStateComponent<MinecraftFacetConfigurationData> {
3232

3333
var facet: MinecraftFacet? = null
34-
private var state = MinecraftFacetConfigurationData()
34+
private var state = MinecraftFacetConfigurationData(
35+
projectReimportVersion = ProjectReimporter.CURRENT_REIMPORT_VERSION
36+
)
3537

3638
override fun createEditorTabs(editorContext: FacetEditorContext?, validatorsManager: FacetValidatorsManager?) =
3739
arrayOf(MinecraftFacetEditorTabV2(this))
@@ -50,4 +52,6 @@ data class MinecraftFacetConfigurationData(
5052
var autoDetectTypes: MutableSet<PlatformType> = mutableSetOf(),
5153
@Tag("forgePatcher")
5254
var forgePatcher: Boolean = false,
55+
@Tag("projectReimportVersion")
56+
var projectReimportVersion: Int = 0,
5357
)

src/main/kotlin/facet/MinecraftFacetDetector.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class MinecraftFacetDetector : StartupActivity {
7070

7171
fun doCheck(project: Project) {
7272
val moduleManager = ModuleManager.getInstance(project)
73+
74+
var needsReimport = false
75+
7376
for (module in moduleManager.modules) {
7477
val facetManager = FacetManager.getInstance(module)
7578
val minecraftFacet = facetManager.getFacetByType(MinecraftFacet.ID)
@@ -78,8 +81,15 @@ class MinecraftFacetDetector : StartupActivity {
7881
checkNoFacet(module)
7982
} else {
8083
checkExistingFacet(module, minecraftFacet)
84+
if (ProjectReimporter.needsReimport(minecraftFacet)) {
85+
needsReimport = true
86+
}
8187
}
8288
}
89+
90+
if (needsReimport) {
91+
ProjectReimporter.reimport(project)
92+
}
8393
}
8494

8595
private fun checkNoFacet(module: Module) {

0 commit comments

Comments
 (0)