Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove old SideOnly code
  • Loading branch information
Earthcomputer committed Aug 24, 2020
commit a3fbaac57aee12aa18f58f714810dcd5631cb5a2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.demonwav.mcdev.creator.buildsystem.gradle.GradleBuildSystem
import com.demonwav.mcdev.creator.buildsystem.gradle.GradleCreator
import com.demonwav.mcdev.platform.PlatformType
import com.demonwav.mcdev.platform.fabric.EntryPoint
import com.demonwav.mcdev.platform.forge.inspections.sideonly.Side
import com.demonwav.mcdev.sideonly.Side
import com.demonwav.mcdev.util.License
import com.demonwav.mcdev.util.SemanticVersion
import com.intellij.openapi.module.Module
Expand All @@ -35,7 +35,7 @@ class FabricProjectConfig : ProjectConfig(), GradleCreator {
var apiMavenLocation: String? = null
var loomVersion = SemanticVersion.release()
var gradleVersion = SemanticVersion.release()
var environment = Side.NONE
var environment = Side.BOTH
var entryPoints: List<EntryPoint> = arrayListOf()
var modRepo: String? = null
var mixins = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.demonwav.mcdev.creator.ValidatedFieldType.NON_BLANK
import com.demonwav.mcdev.platform.PlatformType
import com.demonwav.mcdev.platform.fabric.EntryPoint
import com.demonwav.mcdev.platform.fabric.util.FabricConstants
import com.demonwav.mcdev.platform.forge.inspections.sideonly.Side
import com.demonwav.mcdev.sideonly.Side
import com.demonwav.mcdev.util.License
import com.demonwav.mcdev.util.SemanticVersion
import com.demonwav.mcdev.util.modUpdateStep
Expand Down Expand Up @@ -255,7 +255,7 @@ class FabricProjectSettingsWizard(private val creator: MinecraftProjectCreator)
conf.environment = when ((environmentBox.selectedItem as? String)?.toLowerCase(Locale.ROOT)) {
"client" -> Side.CLIENT
"server" -> Side.SERVER
else -> Side.NONE
else -> Side.BOTH
}
conf.license = licenseBox.selectedItem as? License
conf.entryPoints = entryPoints.filter { it.valid }
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/platform/fabric/creator/FabricTemplate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package com.demonwav.mcdev.platform.fabric.creator

import com.demonwav.mcdev.creator.buildsystem.BuildSystem
import com.demonwav.mcdev.platform.BaseTemplate
import com.demonwav.mcdev.platform.forge.inspections.sideonly.Side
import com.demonwav.mcdev.sideonly.Side
import com.demonwav.mcdev.util.License
import com.demonwav.mcdev.util.MinecraftTemplates.Companion.FABRIC_BUILD_GRADLE_TEMPLATE
import com.demonwav.mcdev.util.MinecraftTemplates.Companion.FABRIC_GRADLE_PROPERTIES_TEMPLATE
Expand Down
24 changes: 0 additions & 24 deletions src/main/kotlin/platform/forge/ForgeModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.demonwav.mcdev.insight.generation.GenerationData
import com.demonwav.mcdev.inspection.IsCancelled
import com.demonwav.mcdev.platform.AbstractModule
import com.demonwav.mcdev.platform.PlatformType
import com.demonwav.mcdev.platform.forge.inspections.sideonly.SidedProxyAnnotator
import com.demonwav.mcdev.platform.forge.util.ForgeConstants
import com.demonwav.mcdev.util.SourceType
import com.demonwav.mcdev.util.extendsOrImplements
Expand All @@ -26,7 +25,6 @@ import com.demonwav.mcdev.util.waitForAllSmart
import com.intellij.json.JsonFileType
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.fileTypes.FileTypeManager
import com.intellij.openapi.project.DumbService
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiClassType
Expand All @@ -36,7 +34,6 @@ import com.intellij.psi.PsiMethod
import com.intellij.psi.PsiMethodCallExpression
import com.intellij.psi.PsiType
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.search.searches.AnnotatedElementsSearch

class ForgeModule internal constructor(facet: MinecraftFacet) : AbstractModule(facet) {

Expand All @@ -54,27 +51,6 @@ class ForgeModule internal constructor(facet: MinecraftFacet) : AbstractModule(f
runWriteTaskLater {
FileTypeManager.getInstance().associatePattern(JsonFileType.INSTANCE, ForgeConstants.MCMOD_INFO)
}

// Index @SideOnly
val service = DumbService.getInstance(project)
service.runReadActionInSmartMode runSmart@{
if (service.isDumb || project.isDisposed) {
return@runSmart
}

val scope = GlobalSearchScope.projectScope(project)
val sidedProxy = JavaPsiFacade.getInstance(project)
.findClass(ForgeConstants.SIDED_PROXY_ANNOTATION, scope) ?: return@runSmart
val annotatedFields = AnnotatedElementsSearch.searchPsiFields(sidedProxy, scope).findAll()

for (field in annotatedFields) {
if (service.isDumb || project.isDisposed) {
return@runSmart
}

SidedProxyAnnotator.check(field)
}
}
}
}

Expand Down

This file was deleted.

This file was deleted.

Loading