⁠
rednesto: NeoForge support (#2196 )
* NeoForged support
* 2024 license
* Add Parchment mappings
* Fix NeoGradle integration
* License
* Fix ktlint error
* Allow using parchment mappings for older versions
* Address reviews
* Quote mod_id placeholder in mods.toml template
See 59677b86ece5864084819bbbe3c616636e9d37f8
* NeoForged support
* 2024 license
* Add Parchment mappings
* Fix NeoGradle integration
* License
* Fix ktlint error
* Allow using parchment mappings for older versions
* Address reviews
* Quote mod_id placeholder in mods.toml template
See 59677b86ece5864084819bbbe3c616636e9d37f8
- /*
- * 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.neoforge
- import com.demonwav.mcdev.MinecraftSettings
- import com.demonwav.mcdev.facet.MinecraftFacet
- import com.intellij.ide.FileIconProvider
- import com.intellij.openapi.module.ModuleUtilCore
- import com.intellij.openapi.project.Project
- import com.intellij.openapi.util.Iconable
- import com.intellij.openapi.vfs.VirtualFile
- import javax.swing.Icon
- class NeoForgeFileIconProvider : FileIconProvider {
- override fun getIcon(file: VirtualFile, @Iconable.IconFlags flags: Int, project: Project?): Icon? {
- project ?: return null
- if (!MinecraftSettings.instance.isShowProjectPlatformIcons) {
- return null
- }
- val module = ModuleUtilCore.findModuleForFile(file, project) ?: return null
- val forgeModule = MinecraftFacet.getInstance(module, NeoForgeModuleType) ?: return null
- if (file == forgeModule.mcmod) {
- return forgeModule.icon
- }
- return null
- }
- }