Skip to content

Commit 1f9687f

Browse files
committed
Merge branch 'refs/heads/2023.3' into 2024.1
2 parents 3e005a6 + 616bec2 commit 1f9687f

File tree

13 files changed

+63
-23
lines changed

13 files changed

+63
-23
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ kotlin.code.style=official
2424
ideaVersion = 2024.1
2525
ideaVersionName = 2024.1
2626

27-
coreVersion = 1.7.4
27+
coreVersion = 1.7.5
2828
downloadIdeaSources = true
2929

3030
pluginTomlVersion = 241.14494.150

readme.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ Minecraft Development for IntelliJ
1111
<td align="right"><b>Main Build</b></td>
1212
<td colspan="2"><a href="https://ci.mcdev.io/viewType.html?buildTypeId=MinecraftDev_Build"><img src="https://ci.mcdev.io/app/rest/builds/buildType:(id:MinecraftDev_Build)/statusIcon.svg" alt="Teamcity Build Status" /></a></td>
1313
</tr>
14-
<tr>
15-
<td align="left">2023.1</td>
16-
<td align="left"><a href="https://ci.mcdev.io/viewType.html?buildTypeId=MinecraftDev_Nightly_20231"><img src="https://ci.mcdev.io/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20231)/statusIcon.svg" alt="2023.1 Nightly Status" /></a></td>
17-
</tr>
1814
<tr>
1915
<td align="left">2023.2</td>
2016
<td align="left"><a href="https://ci.mcdev.io/viewType.html?buildTypeId=MinecraftDev_Nightly_20232"><img src="https://ci.mcdev.io/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20232)/statusIcon.svg" alt="2023.2 Nightly Status" /></a></td>
@@ -35,7 +31,7 @@ Minecraft Development for IntelliJ
3531
</tr>
3632
</table>
3733

38-
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.7.4-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
34+
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.7.5-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
3935
----------------------
4036

4137
<a href="https://discord.gg/j6UNcfr"><img src="https://i.imgur.com/JXu9C1G.png" height="48px"></img></a>

src/main/kotlin/creator/buildsystem/gradle-steps.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration
6161
import org.jetbrains.plugins.gradle.service.project.open.canLinkAndRefreshGradleProject
6262
import org.jetbrains.plugins.gradle.service.project.open.linkAndRefreshGradleProject
6363

64-
val DEFAULT_GRADLE_VERSION = SemanticVersion.release(8, 5)
64+
val DEFAULT_GRADLE_VERSION = SemanticVersion.release(8, 7)
6565
val GRADLE_VERSION_KEY = Key.create<SemanticVersion>("mcdev.gradleVersion")
6666

6767
fun FixedAssetsNewProjectWizardStep.addGradleWrapperProperties(project: Project) {

src/main/kotlin/platform/fabric/creator/gradle-steps.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FabricGradleFilesStep(parent: NewProjectWizardStep) : AbstractLongRunningA
5757
val mcVersion = data.getUserData(FabricVersionChainStep.MC_VERSION_KEY) ?: return
5858
val yarnVersion = data.getUserData(FabricVersionChainStep.YARN_VERSION_KEY) ?: return
5959
val loaderVersion = data.getUserData(FabricVersionChainStep.LOADER_VERSION_KEY) ?: return
60-
val loomVersion = "1.5-SNAPSHOT"
60+
val loomVersion = "1.6-SNAPSHOT"
6161
val javaVersion = findStep<JdkProjectSetupFinalizer>().preferredJdk.ordinal
6262
val apiVersion = data.getUserData(FabricVersionChainStep.API_VERSION_KEY)
6363
val officialMappings = data.getUserData(FabricVersionChainStep.OFFICIAL_MAPPINGS_KEY) ?: false

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ data class ForgePackDescriptor(val format: Int, val comment: String) {
5555
val FORMAT_15 = ForgePackDescriptor(15, "")
5656
val FORMAT_18 = ForgePackDescriptor(18, "")
5757
val FORMAT_26 = ForgePackDescriptor(26, "")
58+
val FORMAT_41 = ForgePackDescriptor(26, "")
5859

5960
// See https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack#.22pack_format.22
6061
fun forMcVersion(version: SemanticVersion): ForgePackDescriptor? = when {
@@ -69,7 +70,8 @@ data class ForgePackDescriptor(val format: Int, val comment: String) {
6970
version < MinecraftVersions.MC1_20 -> FORMAT_12
7071
version < MinecraftVersions.MC1_20_2 -> FORMAT_15
7172
version < MinecraftVersions.MC1_20_3 -> FORMAT_18
72-
version >= MinecraftVersions.MC1_20_3 -> FORMAT_26
73+
version < MinecraftVersions.MC1_20_5 -> FORMAT_26
74+
version >= MinecraftVersions.MC1_20_5 -> FORMAT_41
7375
else -> null
7476
}
7577
}

src/main/kotlin/platform/mixin/inspection/MixinClassReferenceInspection.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020

2121
package com.demonwav.mcdev.platform.mixin.inspection
2222

23+
import com.demonwav.mcdev.platform.mixin.util.MixinConstants
2324
import com.demonwav.mcdev.platform.mixin.util.isAccessorMixin
2425
import com.demonwav.mcdev.platform.mixin.util.isMixin
2526
import com.demonwav.mcdev.util.findContainingClass
2627
import com.intellij.codeInspection.ProblemsHolder
2728
import com.intellij.psi.JavaElementVisitor
29+
import com.intellij.psi.PsiAnnotation
2830
import com.intellij.psi.PsiClassType
2931
import com.intellij.psi.PsiElementVisitor
3032
import com.intellij.psi.PsiTypeElement
33+
import com.intellij.psi.util.parentOfType
3134

3235
class MixinClassReferenceInspection : MixinInspection() {
3336

@@ -58,6 +61,11 @@ class MixinClassReferenceInspection : MixinInspection() {
5861
return
5962
}
6063

64+
val annotation = type.parentOfType<PsiAnnotation>()
65+
if (annotation != null && annotation.hasQualifiedName(MixinConstants.Annotations.DYNAMIC)) {
66+
return
67+
}
68+
6169
holder.registerProblem(type, "Mixin class cannot be referenced directly")
6270
}
6371
}

src/main/kotlin/platform/neoforge/creator/gradle-steps.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
4949
import com.intellij.openapi.vfs.VfsUtil
5050
import com.intellij.util.lang.JavaVersion
5151

52-
private val ngWrapperVersion = SemanticVersion.release(8, 4)
52+
private val ngWrapperVersion = SemanticVersion.release(8, 6)
5353

5454
const val MAGIC_RUN_CONFIGS_FILE = ".hello_from_mcdev"
5555

src/main/kotlin/util/MinecraftVersions.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ object MinecraftVersions {
3838
val MC1_20_2 = SemanticVersion.release(1, 20, 2)
3939
val MC1_20_3 = SemanticVersion.release(1, 20, 3)
4040
val MC1_20_4 = SemanticVersion.release(1, 20, 4)
41+
val MC1_20_5 = SemanticVersion.release(1, 20, 5)
4142

4243
fun requiredJavaVersion(minecraftVersion: SemanticVersion) = when {
4344
minecraftVersion <= MC1_16_5 -> JavaSdkVersion.JDK_1_8
4445
minecraftVersion <= MC1_17_1 -> JavaSdkVersion.JDK_16
45-
else -> JavaSdkVersion.JDK_17
46+
minecraftVersion <= MC1_20_4 -> JavaSdkVersion.JDK_17
47+
else -> JavaSdkVersion.JDK_21
4648
}
4749
}

src/main/resources/fileTemplates/j2ee/fabric/fabric_build.gradle.ft

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ jar {
7979
// configure the maven publication
8080
publishing {
8181
publications {
82-
mavenJava(MavenPublication) {
82+
create("mavenJava", MavenPublication) {
83+
artifactId = project.archives_base_name
8384
from components.java
8485
}
8586
}

src/main/resources/fileTemplates/j2ee/neoforge/NeoForge Main Class.java.ft

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
44
import net.minecraft.client.Minecraft;
55
import net.minecraft.core.registries.BuiltInRegistries;
66
import net.minecraft.core.registries.Registries;
7+
import net.minecraft.network.chat.Component;
78
import net.minecraft.world.food.FoodProperties;
89
import net.minecraft.world.item.BlockItem;
910
import net.minecraft.world.item.CreativeModeTab;
@@ -56,6 +57,7 @@ public class ${CLASS_NAME}
5657

5758
// Creates a creative tab with the id "${MOD_ID}:example_tab" for the example item, that is placed after the combat tab
5859
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder()
60+
.title(Component.translatable("itemGroup.${MOD_ID}"))
5961
.withTabsBefore(CreativeModeTabs.COMBAT)
6062
.icon(() -> EXAMPLE_ITEM.get().getDefaultInstance())
6163
.displayItems((parameters, output) -> {
@@ -76,7 +78,9 @@ public class ${CLASS_NAME}
7678
// Register the Deferred Register to the mod event bus so tabs get registered
7779
CREATIVE_MODE_TABS.register(modEventBus);
7880

79-
// Register ourselves for server and other game events we are interested in
81+
// Register ourselves for server and other game events we are interested in.
82+
// Note that this is necessary if and only if we want *this* class (ExampleMod) to respond directly to events.
83+
// Do not add this line if there are no @SubscribeEvent-annotated functions in this class, like onServerStarting() below.
8084
NeoForge.EVENT_BUS.register(this);
8185

8286
// Register the item to a creative tab

src/main/resources/fileTemplates/j2ee/neoforge/NeoForge build.gradle.ft

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'eclipse'
44
id 'idea'
55
id 'maven-publish'
6-
id 'net.neoforged.gradle.userdev' version '7.0.74'
6+
id 'net.neoforged.gradle.userdev' version '7.0.97'
77
}
88

99
version = mod_version
@@ -109,16 +109,22 @@ dependencies {
109109
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
110110
tasks.withType(ProcessResources).configureEach {
111111
var replaceProperties = [
112-
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
113-
neo_version : neo_version, neo_version_range: neo_version_range,
114-
loader_version_range: loader_version_range,
115-
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
116-
mod_authors : mod_authors, mod_description: mod_description,
112+
minecraft_version : minecraft_version,
113+
minecraft_version_range: minecraft_version_range,
114+
neo_version : neo_version,
115+
neo_version_range : neo_version_range,
116+
loader_version_range : loader_version_range,
117+
mod_id : mod_id,
118+
mod_name : mod_name,
119+
mod_license : mod_license,
120+
mod_version : mod_version,
121+
mod_authors : mod_authors,
122+
mod_description : mod_description
117123
]
118124
inputs.properties replaceProperties
119125

120126
filesMatching(['META-INF/mods.toml']) {
121-
expand replaceProperties + [project: project]
127+
expand replaceProperties
122128
}
123129
}
124130

@@ -139,3 +145,11 @@ publishing {
139145
tasks.withType(JavaCompile).configureEach {
140146
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
141147
}
148+
149+
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
150+
idea {
151+
module {
152+
downloadSources = true
153+
downloadJavadoc = true
154+
}
155+
}

src/main/resources/fileTemplates/j2ee/neoforge/NeoForge mods.toml.ft

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,26 @@ authors="${mod_authors}" #optional
4646
# 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.
4747
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
4848

49+
# The description text for the mod (multi line!) (#mandatory)
50+
description='''${mod_description}'''
51+
52+
#set ( $h = "#" )
53+
# The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded.
4954
#if (${MIXIN_CONFIG})
5055
[[mixins]]
5156
config="${MIXIN_CONFIG}"
57+
#else
58+
${h}[[mixins]]
59+
#config="${mod_id}.mixins.json"
5260
#end
5361

54-
# The description text for the mod (multi line!) (#mandatory)
55-
description='''${mod_description}'''
62+
# The [[accessTransformers]] block allows you to declare where your AT file is.
63+
# If this block is omitted, a fallback attempt will be made to load an AT from META-INF/accesstransformer.cfg
64+
${h}[[accessTransformers]]
65+
#file="META-INF/accesstransformer.cfg"
66+
67+
# The coremods config file path is not configurable and is always loaded from META-INF/coremods.json
68+
5669
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
5770
[[dependencies."${mod_id}"]] #optional
5871
# the modid of the dependency

src/main/resources/fileTemplates/j2ee/neoforge/NeoForge settings.gradle.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ pluginManagement {
77
}
88

99
plugins {
10-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
10+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
1111
}

0 commit comments

Comments
 (0)