Skip to content

Commit

Permalink
Merge branch 'refs/heads/2023.2' into 2023.3
Browse files Browse the repository at this point in the history
  • Loading branch information
RedNesto committed Apr 25, 2024
2 parents 280aca1 + 0a29cf0 commit 616bec2
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 23 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotlin.code.style=official
ideaVersion = 2023.3
ideaVersionName = 2023.3

coreVersion = 1.7.4
coreVersion = 1.7.5
downloadIdeaSources = true

pluginTomlVersion = 233.11799.172
Expand Down
6 changes: 1 addition & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ Minecraft Development for IntelliJ
<td align="right"><b>Main Build</b></td>
<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>
</tr>
<tr>
<td align="left">2023.1</td>
<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>
</tr>
<tr>
<td align="left">2023.2</td>
<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>
Expand All @@ -35,7 +31,7 @@ Minecraft Development for IntelliJ
</tr>
</table>

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)
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)
----------------------

<a href="https://discord.gg/j6UNcfr"><img src="https://i.imgur.com/JXu9C1G.png" height="48px"></img></a>
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/creator/buildsystem/gradle-steps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration
import org.jetbrains.plugins.gradle.service.project.open.canLinkAndRefreshGradleProject
import org.jetbrains.plugins.gradle.service.project.open.linkAndRefreshGradleProject

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

fun FixedAssetsNewProjectWizardStep.addGradleWrapperProperties(project: Project) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/platform/fabric/creator/gradle-steps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class FabricGradleFilesStep(parent: NewProjectWizardStep) : AbstractLongRunningA
val mcVersion = data.getUserData(FabricVersionChainStep.MC_VERSION_KEY) ?: return
val yarnVersion = data.getUserData(FabricVersionChainStep.YARN_VERSION_KEY) ?: return
val loaderVersion = data.getUserData(FabricVersionChainStep.LOADER_VERSION_KEY) ?: return
val loomVersion = "1.5-SNAPSHOT"
val loomVersion = "1.6-SNAPSHOT"
val javaVersion = findStep<JdkProjectSetupFinalizer>().preferredJdk.ordinal
val apiVersion = data.getUserData(FabricVersionChainStep.API_VERSION_KEY)
val officialMappings = data.getUserData(FabricVersionChainStep.OFFICIAL_MAPPINGS_KEY) ?: false
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/platform/forge/util/ForgePackDescriptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ data class ForgePackDescriptor(val format: Int, val comment: String) {
val FORMAT_15 = ForgePackDescriptor(15, "")
val FORMAT_18 = ForgePackDescriptor(18, "")
val FORMAT_26 = ForgePackDescriptor(26, "")
val FORMAT_41 = ForgePackDescriptor(26, "")

// See https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack#.22pack_format.22
fun forMcVersion(version: SemanticVersion): ForgePackDescriptor? = when {
Expand All @@ -69,7 +70,8 @@ data class ForgePackDescriptor(val format: Int, val comment: String) {
version < MinecraftVersions.MC1_20 -> FORMAT_12
version < MinecraftVersions.MC1_20_2 -> FORMAT_15
version < MinecraftVersions.MC1_20_3 -> FORMAT_18
version >= MinecraftVersions.MC1_20_3 -> FORMAT_26
version < MinecraftVersions.MC1_20_5 -> FORMAT_26
version >= MinecraftVersions.MC1_20_5 -> FORMAT_41
else -> null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@

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

import com.demonwav.mcdev.platform.mixin.util.MixinConstants
import com.demonwav.mcdev.platform.mixin.util.isAccessorMixin
import com.demonwav.mcdev.platform.mixin.util.isMixin
import com.demonwav.mcdev.util.findContainingClass
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.psi.JavaElementVisitor
import com.intellij.psi.PsiAnnotation
import com.intellij.psi.PsiClassType
import com.intellij.psi.PsiElementVisitor
import com.intellij.psi.PsiTypeElement
import com.intellij.psi.util.parentOfType

class MixinClassReferenceInspection : MixinInspection() {

Expand Down Expand Up @@ -58,6 +61,11 @@ class MixinClassReferenceInspection : MixinInspection() {
return
}

val annotation = type.parentOfType<PsiAnnotation>()
if (annotation != null && annotation.hasQualifiedName(MixinConstants.Annotations.DYNAMIC)) {
return
}

holder.registerProblem(type, "Mixin class cannot be referenced directly")
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/platform/neoforge/creator/gradle-steps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.util.lang.JavaVersion

private val ngWrapperVersion = SemanticVersion.release(8, 4)
private val ngWrapperVersion = SemanticVersion.release(8, 6)

const val MAGIC_RUN_CONFIGS_FILE = ".hello_from_mcdev"

Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/util/MinecraftVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ object MinecraftVersions {
val MC1_20_2 = SemanticVersion.release(1, 20, 2)
val MC1_20_3 = SemanticVersion.release(1, 20, 3)
val MC1_20_4 = SemanticVersion.release(1, 20, 4)
val MC1_20_5 = SemanticVersion.release(1, 20, 5)

fun requiredJavaVersion(minecraftVersion: SemanticVersion) = when {
minecraftVersion <= MC1_16_5 -> JavaSdkVersion.JDK_1_8
minecraftVersion <= MC1_17_1 -> JavaSdkVersion.JDK_16
else -> JavaSdkVersion.JDK_17
minecraftVersion <= MC1_20_4 -> JavaSdkVersion.JDK_17
else -> JavaSdkVersion.JDK_21
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ jar {
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
Expand Down Expand Up @@ -56,6 +57,7 @@ public class ${CLASS_NAME}

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

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

// Register the item to a creative tab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.74'
id 'net.neoforged.gradle.userdev' version '7.0.97'
}

version = mod_version
Expand Down Expand Up @@ -109,16 +109,22 @@ dependencies {
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
neo_version : neo_version, neo_version_range: neo_version_range,
loader_version_range: loader_version_range,
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors : mod_authors, mod_description: mod_description,
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
neo_version_range : neo_version_range,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml']) {
expand replaceProperties + [project: project]
expand replaceProperties
}
}

Expand All @@ -139,3 +145,11 @@ publishing {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,26 @@ authors="${mod_authors}" #optional
# 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.
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)

# The description text for the mod (multi line!) (#mandatory)
description='''${mod_description}'''

#set ( $h = "#" )
# The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded.
#if (${MIXIN_CONFIG})
[[mixins]]
config="${MIXIN_CONFIG}"
#else
${h}[[mixins]]
#config="${mod_id}.mixins.json"
#end

# The description text for the mod (multi line!) (#mandatory)
description='''${mod_description}'''
# The [[accessTransformers]] block allows you to declare where your AT file is.
# If this block is omitted, a fallback attempt will be made to load an AT from META-INF/accesstransformer.cfg
${h}[[accessTransformers]]
#file="META-INF/accesstransformer.cfg"

# The coremods config file path is not configurable and is always loaded from META-INF/coremods.json

# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies."${mod_id}"]] #optional
# the modid of the dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pluginManagement {
}

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

0 comments on commit 616bec2

Please sign in to comment.