package com.demonwav.mcdev.platform.bungeecord;

import com.demonwav.mcdev.asset.PlatformAssets;
import com.demonwav.mcdev.buildsystem.BuildSystem;
import com.demonwav.mcdev.buildsystem.SourceType;
import com.demonwav.mcdev.platform.AbstractModule;
import com.demonwav.mcdev.platform.MinecraftModuleType;
import com.demonwav.mcdev.platform.PlatformType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;

import javax.swing.Icon;
import java.util.HashMap;
import java.util.Map;

public class BungeeCordModule extends AbstractModule {

    private static final Map<Module, BungeeCordModule> map = new HashMap<>();

    private VirtualFile pluginYml;

    private BungeeCordModule(@NotNull Module module) {
        this.module = module;
        buildSystem = BuildSystem.getInstance(module);
        if (buildSystem != null) {
            buildSystem.reImport(module, PlatformType.BUNGEECORD);
            pluginYml = buildSystem.findFile("plugin.yml", SourceType.RESOURCE);
        }
    }

    @NotNull
    public Module getModule() {
        return module;
    }

    @Override
    public MinecraftModuleType getModuleType() {
        return BungeeCordModuleType.getInstance();
    }

    public VirtualFile getPluginYml() {
        return pluginYml;
    }

    public void setPluginYml(VirtualFile pluginYml) {
        this.pluginYml = pluginYml;
    }

    @Override
    public PlatformType getType() {
        return PlatformType.BUNGEECORD;
    }

    @Override
    public Icon getIcon() {
        return PlatformAssets.BUNGEECORD_ICON;
    }
}

@@ -1295,24 +1295,319 @@
 uginYml() %7B%0A
+        if (pluginYml == null && buildSystem != null) %7B%0A            // try and find the file again if it's not already present%0A            // when this object was first created it may not have been ready%0A            pluginYml = buildSystem.findFile(%22plugin.yml%22, SourceType.RESOURCE);%0A        %7D%0A
         retu

Apply same plugin.yml fix to BungeeCordModule.java