Skip to content

Commit

Permalink
Merge branch '2023.2' into 2023.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Jan 24, 2024
2 parents b579f11 + 9067dd7 commit 01146d9
Show file tree
Hide file tree
Showing 102 changed files with 4,358 additions and 350 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.6.12
coreVersion = 1.7.0
downloadIdeaSources = true

pluginTomlVersion = 233.11799.172
Expand Down
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Minecraft Development for IntelliJ
<td align="left">2023.3</td>
<td align="left"><a href="https://ci.mcdev.io/viewType.html?buildTypeId=MinecraftDev_Nightly_20233"><img src="https://ci.mcdev.io/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20233)/statusIcon.svg" alt="2023.3 Nightly Status" /></a></td>
</tr>
<tr>
<td align="left">2024.1</td>
<td align="left"><a href="https://ci.mcdev.io/viewType.html?buildTypeId=MinecraftDev_Nightly_20241"><img src="https://ci.mcdev.io/app/rest/builds/buildType:(id:MinecraftDev_Nightly_20241)/statusIcon.svg" alt="2024.1 Nightly Status" /></a></td>
</tr>
<tr>
<td align="right"><b>OS Tests</b></td>
<td align="left" colspan="2">
Expand All @@ -31,7 +35,7 @@ Minecraft Development for IntelliJ
</tr>
</table>

Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.6.12-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
Info and Documentation [![Current Release](https://img.shields.io/badge/release-1.7.0-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 Expand Up @@ -133,6 +137,7 @@ Supported Platforms
- [![Sponge Icon](src/main/resources/assets/icons/platform/Sponge_dark.png?raw=true) **Sponge**](https://www.spongepowered.org/)
- [![Architectury Icon](src/main/resources/assets/icons/platform/Architectury.png?raw=true) **Architectury**](https://github.com/architectury/architectury-api)
- [![Forge Icon](src/main/resources/assets/icons/platform/Forge.png?raw=true) **Minecraft Forge**](https://forums.minecraftforge.net/)
- <a href="https://neoforged.net/"><img src="src/main/resources/assets/icons/platform/NeoForge.png?raw=true" width="16" height="16"/> <b>Neoforge</b><a/>
- [![Fabric Icon](src/main/resources/assets/icons/platform/Fabric.png?raw=true) **Fabric**](https://fabricmc.net)
- [![Mixins Icon](src/main/resources/assets/icons/platform/Mixins_dark.png?raw=true) **Mixins**](https://github.com/SpongePowered/Mixin)
- [![BungeeCord Icon](src/main/resources/assets/icons/platform/BungeeCord.png?raw=true) **BungeeCord**](https://www.spigotmc.org/wiki/bungeecord/) ([![Waterfall Icon](src/main/resources/assets/icons/platform/Waterfall.png?raw=true) Waterfall](https://github.com/PaperMC/Waterfall))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Minecraft Development for IntelliJ
*
* https://mcdev.io/
*
* Copyright (C) 2024 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, version 3.0 only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.demonwav.mcdev.platform.mcp.gradle.tooling.neogradle

import com.demonwav.mcdev.platform.mcp.gradle.tooling.McpModelNG7
import org.gradle.api.Project
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.gradle.tooling.ErrorMessageBuilder
import org.jetbrains.plugins.gradle.tooling.ModelBuilderService

final class NeoGradle7ModelBuilderImpl implements ModelBuilderService {

@Override
boolean canBuild(String modelName) {
return McpModelNG7.name == modelName
}

@Override
Object buildAll(String modelName, Project project) {
def extension = project.extensions.findByName('minecraft')
if (extension == null) {
return null
}

if (!project.plugins.findPlugin("net.neoforged.gradle.userdev")) {
return null
}

// NG userdev
def runtimes = project.extensions.findByName('userDevRuntime').runtimes.get()
def neoforgeVersion = null
for (def entry in runtimes) {
neoforgeVersion = entry.value.specification.forgeVersion
break
}
if (neoforgeVersion == null) {
return null
}

def mappingsFile = project.tasks.neoFormMergeMappings.output.get().asFile

def accessTransformers = extension.accessTransformers.files.asList()

//noinspection GroovyAssignabilityCheck
return new NeoGradle7ModelImpl(neoforgeVersion, mappingsFile, accessTransformers)
}

@Override
ErrorMessageBuilder getErrorMessageBuilder(@NotNull Project project, @NotNull Exception e) {
return ErrorMessageBuilder.create(
project, e, "MinecraftDev import errors"
).withDescription("Unable to build MinecraftDev MCP project configuration")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Minecraft Development for IntelliJ
*
* https://mcdev.io/
*
* Copyright (C) 2024 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, version 3.0 only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.demonwav.mcdev.platform.mcp.gradle.tooling.neogradle


import com.demonwav.mcdev.platform.mcp.gradle.tooling.McpModelNG7
import groovy.transform.CompileStatic

@CompileStatic
final class NeoGradle7ModelImpl implements McpModelNG7, Serializable {

final String neoForgeVersion
final File mappingsFile
final List<File> accessTransformers

NeoGradle7ModelImpl(
final String neoForgeVersion,
final File mappingsFile,
final List<File> accessTransformers
) {
this.neoForgeVersion = neoForgeVersion
this.mappingsFile = mappingsFile
this.accessTransformers = accessTransformers
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Minecraft Development for IntelliJ
*
* https://mcdev.io/
*
* Copyright (C) 2024 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, version 3.0 only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.demonwav.mcdev.platform.mcp.gradle.tooling;

import java.io.File;
import java.util.List;

public interface McpModelNG7 {
String getNeoForgeVersion();
File getMappingsFile();
List<File> getAccessTransformers();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
com.demonwav.mcdev.platform.mcp.gradle.tooling.archloom.ArchitecturyModelBuilderImpl
com.demonwav.mcdev.platform.mcp.gradle.tooling.fabricloom.FabricLoomModelBuilderImpl
com.demonwav.mcdev.platform.mcp.gradle.tooling.neogradle.NeoGradle7ModelBuilderImpl
com.demonwav.mcdev.platform.mcp.gradle.tooling.vanillagradle.VanillaGradleModelBuilderImpl
com.demonwav.mcdev.platform.mcp.gradle.tooling.McpModelFG2BuilderImpl
com.demonwav.mcdev.platform.mcp.gradle.tooling.McpModelFG3BuilderImpl
7 changes: 7 additions & 0 deletions src/main/kotlin/MinecraftConfigurable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ class MinecraftConfigurable : Configurable {
}
}

group(MCDevBundle("minecraft.settings.mixin")) {
row {
checkBox(MCDevBundle("minecraft.settings.mixin.shadow_annotation_same_line"))
.bindSelected(settings::isShadowAnnotationsSameLine)
}
}

onApply {
for (project in ProjectManager.getInstance().openProjects) {
ProjectView.getInstance(project).refresh()
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/MinecraftSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class MinecraftSettings : PersistentStateComponent<MinecraftSettings.State> {
var isShowChatColorGutterIcons: Boolean = true,
var isShowChatColorUnderlines: Boolean = false,
var underlineType: UnderlineType = UnderlineType.DOTTED,

var isShadowAnnotationsSameLine: Boolean = true,
)

private var state = State()
Expand Down Expand Up @@ -78,6 +80,12 @@ class MinecraftSettings : PersistentStateComponent<MinecraftSettings.State> {
state.underlineType = underlineType
}

var isShadowAnnotationsSameLine: Boolean
get() = state.isShadowAnnotationsSameLine
set(shadowAnnotationsSameLine) {
state.isShadowAnnotationsSameLine = shadowAnnotationsSameLine
}

enum class UnderlineType(private val regular: String, val effectType: EffectType) {

NORMAL("Normal", EffectType.LINE_UNDERSCORE),
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/asset/PlatformAssets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package com.demonwav.mcdev.asset

import com.intellij.util.IconUtil

@Suppress("unused")
object PlatformAssets : Assets() {
val MINECRAFT_ICON = loadIcon("/assets/icons/platform/Minecraft.png")
Expand Down Expand Up @@ -62,6 +64,9 @@ object PlatformAssets : Assets() {
val MIXIN_ICON_DARK = loadIcon("/assets/icons/platform/Mixins_dark.png")
val MIXIN_ICON_2X_DARK = loadIcon("/assets/icons/platform/Mixins@2x_dark.png")

val NEOFORGE_ICON = IconUtil.scale(loadIcon("/assets/icons/platform/NeoForge.png"), null, 0.125f)
val NEOFORGE_ICON_2X = IconUtil.scale(loadIcon("/assets/icons/platform/NeoForge.png"), null, 0.25f)

val MCP_ICON = loadIcon("/assets/icons/platform/MCP.png")
val MCP_ICON_2X = loadIcon("/assets/icons/platform/[email protected]")
val MCP_ICON_DARK = loadIcon("/assets/icons/platform/MCP_dark.png")
Expand Down
Loading

0 comments on commit 01146d9

Please sign in to comment.