- /*
- * 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.bungeecord
- 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 BungeeCordFileIconProvider : 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 bungeecordModule =
- MinecraftFacet.getInstance(module, BungeeCordModuleType, WaterfallModuleType) ?: return null
- if (file == bungeecordModule.pluginYml) {
- return bungeecordModule.icon
- }
- return null
- }
- }
- /*
- * Minecraft Development for IntelliJ
- *
- * https://mcdev.io/
- *
- * Copyright (C) 2025 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.bungeecord
- 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 BungeeCordFileIconProvider : 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 bungeecordModule =
- MinecraftFacet.getInstance(module, BungeeCordModuleType, WaterfallModuleType) ?: return null
- if (file == bungeecordModule.pluginYml) {
- return bungeecordModule.icon
- }
- return null
- }
- }