Giter Club home page Giter Club logo

minecraftdev's Introduction

logo

Minecraft Development for IntelliJ

Build Status
Main Build Teamcity Build Status
2023.2 2023.2 Nightly Status
2023.3 2023.3 Nightly Status
2024.1 2024.1 Nightly Status
OS Tests GitHub Action Status

Info and Documentation Current Release

Visit https://minecraftdev.org for some information about the project.

Installation

This plugin is available on the JetBrains IntelliJ plugin repository.

Because of this, you can install the plugin through IntelliJ's internal plugin browser. Navigate to File -> Settings -> Plugins and click the Browse Repositories... button at the bottom of the window. In the search box, simply search for Minecraft. You can install it from there and restart IntelliJ to activate the plugin.

Building

Build the plugin with:

./gradlew build

The output .zip file for the plugin will be in build/distributions.

Test the plugin in IntelliJ with:

./gradlew runIde

Code is generated during the build task, to run the generation task without building use:

./gradlew generate

This task is necessary to work on the code without errors before the initial build.

To format the code in this project:

./gradlew format

This will format using ktlint described below in the style guide section below.

The Gradle IntelliJ Plugin will handle downloading the IntelliJ dependencies and packaging the plugin.

Style Guide

This projects follows the opinionated ktlint linter and formatter. It uses the ktlint-gradle plugin to automatically check and format the code in this repo.

IDE Setup

It's recommended to run the ktlintApplyToIdea and addKtlintFormatGitPreCommitHook tasks to configure your IDE with ktlint style settings and to automatically format this project's code before committing:

./gradlew ktlintApplyToIdea addKtlintFormatGitPreCommitHook

IntelliJ includes a lot of dependencies transitively, including common dependencies that are used a lot, such as Kotlin, Commons Lang3, Guava, etc. Unfortunately, the source distribution for IntelliJ does not contain sources for libraries as well, so these libraries are imported into the IDE without sources by default. If you want to attach sources for (most) of the dependencies IntelliJ includes, run the resolveIntellijLibSources task and refresh the Gradle project in IntelliJ:

./gradlew resolveIntellijLibSources

If you're curious about that task, it is implemented in buildSrc.

Developers

Significant Contributors

License

This project is licensed under MIT.

Supported Platforms

minecraftdev's People

Contributors

aaron1011 avatar aikar avatar crystalmare avatar demonwav avatar denwav avatar earthcomputer avatar gabizou avatar gegy avatar immorpheus avatar jamezrin avatar jamierocks avatar jbyoshi avatar jt122406 avatar kashike avatar llamalad7 avatar marvin-roesch avatar mysterious-dev avatar noahvdaa avatar o7410 avatar paintninja avatar rednesto avatar sizableshrimp avatar stephan-gh avatar texblock avatar thecomputergeek2 avatar thiakil avatar tom-the-geek avatar vinetos avatar voleil avatar willies952002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraftdev's Issues

java.lang.ClassCastException: (various PSI elements) cannot be cast to com.intellij.psi.PsiReferenceExpression

java.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)


java.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)


java.lang.ClassCastException: com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl cannot be cast to com.intellij.psi.PsiReferenceExpression
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorUtil.findColorFromElement(SpongeColorUtil.java:49)
    at com.demonwav.mcdev.platform.sponge.color.SpongeColorLineMarkerProvider.getLineMarkerInfo(SpongeColorLineMarkerProvider.java:39)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:178)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:111)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$0(PassExecutorService.java:432)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1033)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:425)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:424)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:400)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:154)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Projects can have more than one Bukkit project type assigned to it

If a project changes it's dependencies then in some cases it seems the original Bukkit-type isn't removed, while the second Bukkit-type is also added on (so, it could be both a BukkitModuleType and a SpigotModuleType). This shouldn't happen, only the highest Bukkit-type should remain.

Enable Forge Support

Forge support would bring support for normal Forge mods, Sponge Forge mods, and provide the framework for LiteLoader support as well. This is working in an experimental state on the hybridmodules branch.

Finish Sponge Event Listener Generator

Due to the complexity of Sponge's event system, the event listener generator can, and should, be more complex to handle it well. Currently there is a very basic event listener generator in place for Sponge, but it doesn't support things such as event filtering and getter annotations.

Disable/enhance "unused" warning for event handling methods

Note that I'm only going to talk from a Forge perspective here since I don't know any of the other systems in-depth.

Due to the fact that methods annotated with SubscribeEvent or EventHandler (usually) never get called directly, IDEA marks them as unused. This can easily be disabled by using IDEA's built-in support for marking certain annotations as "users". It would be great if the plugin could automatically add these exceptions.

Alternatively, enhanced usage detection could be put in place. This would entail marking the method as used whenever an instance of the containing class is passed into the event bus's register method. Whilst this is a great solution for simple setups, there are some mods out there which search for classes marked by their own annotation (something like @RegisterBus) and then create and register an instance automatically. These mods would obviously have to fall back to the built-in method mentioned above.

[Forge] Event listener generation NPE

Occurred after closing the selector window without choosing an event.

null
java.lang.NullPointerException
    at com.demonwav.mcdev.insight.generation.GenerateEventListenerHandler.isSuperEventListenerAllowed(GenerateEventListenerHandler.java:165)
    at com.demonwav.mcdev.insight.generation.GenerateEventListenerHandler.lambda$chooseOriginalMembers$1(GenerateEventListenerHandler.java:86)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
    at java.util.concurrent.ConcurrentHashMap$ValueSpliterator.tryAdvance(ConcurrentHashMap.java:3574)
    at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
    at com.demonwav.mcdev.insight.generation.GenerateEventListenerHandler.chooseOriginalMembers(GenerateEventListenerHandler.java:87)
    at com.intellij.codeInsight.generation.GenerateMembersHandlerBase.invoke(GenerateMembersHandlerBase.java:84)
    at com.intellij.codeInsight.actions.CodeInsightAction.lambda$null$0(CodeInsightAction.java:59)
    at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$1(CodeInsightAction.java:65)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:129)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:100)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:86)
    at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl(CodeInsightAction.java:55)
    at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformed(CodeInsightAction.java:41)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:197)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:156)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:211)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.performAction(PopupFactoryImpl.java:875)
    at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.lambda$onChosen$0(PopupFactoryImpl.java:863)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:199)
    at com.intellij.ui.popup.AbstractPopup.lambda$null$7(AbstractPopup.java:1390)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:863)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:699)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:385)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Add Access Transformer shortcuts

My "wishlist":

  • Clicking through a Access Transformer to it's location in the code - similar to how "Ctrl+Click" works on usages of functions and classes
  • Generation of an Access Transformer from a class in the IDE. Could have fancy tick boxes for the various transformation options
  • Maybe code suggestions for when a non-public method/variable is being used (and by showing an error in the IDE) despite it having a transformer such as when Gradle dependencies haven't been refreshed

Maven BuildSystem not setting content roots correctly on project create

Basically when Maven projects are created the content roots (sources, resources, test sources, and test resources) aren't being set properly. This is fixable by closing the project and re-opening it, so the Maven importer is working fine, just the create step is messed up. This prevents Bukkit projects from properly enabling until the project is recreated.

Add Gradle support

It would be nice if plugins could be set up with Gradle instead of Maven specifically. I know this is more of speaking from a sponge perspective, but still can use gradle to develop spigot/bukkit plugins just the same.

Deleting all modules from a project will result in ArrayIndexOutOfBoundsException

0
java.lang.ArrayIndexOutOfBoundsException: 0
    at com.demonwav.mcdev.buildsystem.maven.AbstractMavenImporter.resolve(AbstractMavenImporter.java:77)
    at org.jetbrains.idea.maven.project.MavenProjectsTree.resolve(MavenProjectsTree.java:1289)
    at org.jetbrains.idea.maven.project.MavenProjectsProcessorResolvingTask.perform(MavenProjectsProcessorResolvingTask.java:44)
    at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:134)
    at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$100(MavenProjectsProcessor.java:30)
    at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:109)
    at org.jetbrains.idea.maven.utils.MavenUtil$7.run(MavenUtil.java:459)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Support for Minecraft json models

Here's an interesting idea.

Add some limited support for the minecraft json models. Mostly aimed at forge. I'm mostly thinking autocompletion to other models, and maybe some syntax highlighting here.

Choose parent module?

I'm forever accidentally creating new modules while I have SpongeForge selected, which creates it as a sub-module of spongeforge, instead of yet another top level module.

If this matches other peoples workflows, it would be handy to have a step before naming the project in the wizard, that just confirms under what module that you wish to create, because I could then change it there, instead of cancelling the wizard, losing everything I've entered, de-selecting SpongeForge then recreating everything again.

Kotlin support?

None of the inspections and similar fire in kotlin, which is both a language that can be used for modding and supported directly through Jetbrains.

Mixin support?

Would it be possible to add support for

  • Navigating to targeted Mixin method/class
  • generate an @At notation targetting annotation for the current cursor position?
  • get the current method/class names in a mixin compatible format, e.g. Lfoo/bar/Baz;func_1234_a(DDD)V

Read access is allowed from event dispatch thread or inside read-action only

Read access is allowed from event dispatch thread or inside read-action only (see com.intellij.openapi.application.Application.runReadAction())
Details: Current thread: Thread[ApplicationImpl pooled thread 19,4,main] 251040830
; dispatch thread: false; isDispatchThread(): false
SystemEventQueueThread: Thread[AWT-EventQueue-0 2016.2.1#IU-162.1447.7 IDEA, eap:true, os:Windows 10 10.0, java-version:Oracle Corporation 1.8.0_92-b14,6,main] 1638708094
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:138)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:950)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.getDocument(FileDocumentManagerImpl.java:167)
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem.createSubModule(GradleBuildSystem.java:686)
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem.createMultiModuleProject(GradleBuildSystem.java:590)
    at com.demonwav.mcdev.creator.MinecraftProjectCreator$2.run(MinecraftProjectCreator.java:108)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:128)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:308)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Please let me know if you need more information.

Translation and i18n

I'm pretty sure IntelliJ already has support for this, however I can't seem to find out how to make use of it. Would be neat if the .lang files would be autodetected here.

Don't know how it is with other platforms and translation.

Deadlock on latest version

For some reason I get this issue while using the latest version, it renders the IDE unusable
The cause of it seems to be this plugin, but I'm not sure.
It just starts loading as normal, and when it finishes loading the project it freezes.
Removing the plugin fixes this issue.
This appears at the bottom left part of the IDE

2016-07-04 01:56:13,219 [  10444]  ERROR - plication.impl.ApplicationImpl - Calling invokeAndWait from read-action leads to possible deadlock. 
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:127)
    at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:728)
    at com.demonwav.mcdev.util.Util.runWriteTask(Util.java:9)
    at com.demonwav.mcdev.platform.MinecraftModule.getInstance(MinecraftModule.java:68)
    at com.demonwav.mcdev.platform.MinecraftModule.getInstance(MinecraftModule.java:94)
    at com.demonwav.mcdev.platform.bukkit.BukkitFileIconProvider.getIcon(BukkitFileIconProvider.java:22)
    at com.intellij.util.IconUtil.getProvidersIcon(IconUtil.java:182)
    at com.intellij.util.IconUtil.access$200(IconUtil.java:49)
    at com.intellij.util.IconUtil$2.fun(IconUtil.java:145)
    at com.intellij.util.IconUtil$2.fun(IconUtil.java:136)
    at com.intellij.ui.DeferredIconImpl.evaluate(DeferredIconImpl.java:287)
    at com.intellij.ui.DeferredIconImpl$2$1$1.run(DeferredIconImpl.java:158)
    at com.intellij.ui.IconDeferrerImpl.evaluateDeferred(IconDeferrerImpl.java:122)
    at com.intellij.ui.DeferredIconImpl$2$1.run(DeferredIconImpl.java:155)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1178)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils$2.run(ProgressIndicatorUtils.java:80)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils$5.run(ProgressIndicatorUtils.java:141)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:137)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:77)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:102)
    at com.intellij.ui.DeferredIconImpl$2.run(DeferredIconImpl.java:152)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Full log

Random Error

Not sure what I did to trigger this, but it happened so I thought I'd report it, just in case it's helpful.

2
java.lang.ArrayIndexOutOfBoundsException: 2
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem$1.lambda$null$1(GradleBuildSystem.java:467)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem$1.lambda$run$2(GradleBuildSystem.java:461)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:856)
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem$1.run(GradleBuildSystem.java:389)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:128)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:308)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Add Command

Option to add a command that creates a command executor

class package name should use JavaPlugin class as "base", and if base.commands package exists, default to that, else default to base

so if I have co.aikar.MyPlugin, and co.aikar.commands package, it would default to co.aikar.commands package, else co.aikar

on creation, add the setup commands to a "registerCommands()" method, and add the method to onEnable if it does not exists.

This should then encourage plugin devs to put any of their manual commands in that method.

If they don't like the auto placement, they could manually move it.

MC and Sponge Sources Not Available After Creating LiteLoader Project

When creating a project using the LiteLoader template, it seems that net.minecraft.* and org.spongepowered.* are missing from the project, meaning that any time that an import from those package is needed, they will not properly import, as well as show up as a sea of red when viewing LiteLoader's sources.

Please keep in mind, this is an observation and there are no related error logs.

Integrate with a VCS versioning system.

Every plugin system in use requires some presence of a versioning system. My suggestion is to allow a VCS commit hash to be used in place of a manually-updated version. I'd recommend a customize-able version string that could have a placeholder for the commit hash (most likely the abridged hash). See https://github.com/spigotmc/scriptus for a bit of clarification on the idea. Note that, as far as I know, Bukkit, Spigot, and BungeeCord plugins would be the only platforms that would allow this, as Forge enforced semver last time I checked. I'd PR this, but I can't be arsed to learn how IntelliJ plugins work.

Search for event handling methods when passing instance to event bus

Note that I'm only going to talk from a Forge perspective here since I don't know any of the other systems in-depth.

It sometimes may happen that you register the wrong class to an event bus, making you wonder why your handlers are not called. To mitigate this issue, arguments for EventBus.register could be inspected, displaying a warning whenever a class is used which does not have any methods annotated with @SubscribeEvent. This obviously can't catch cases where the wrong class with @SubscribeEvent methods is passed, but it would help a great deal either way!

Issue with latest version

This exception happened to me twice, with the first one failing while opening the project and another one but with a fully functional project.

Access is allowed from event dispatch thread only.
 EventQueue.isDispatchThread()=false isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@10b922 Current thread: Thread[ApplicationImpl pooled thread 199,4,main] 16121638 SystemEventQueueThread: Thread[AWT-EventQueue-0 2016.1.3#IC-145.1617.8 IDEA, eap:false, os:Windows 10 10.0, java-version:Oracle Corporation 1.8.0_77-b03,6,main] 11433535

java.lang.Throwable
    at com.intellij.psi.impl.DebugUtil.currentStackTrace(DebugUtil.java:501)
    at com.intellij.diagnostic.LogEventException.<init>(LogEventException.java:29)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1115)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1099)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1091)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.doAddPane(ProjectViewImpl.java:432)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.doAddUninitializedPanes(ProjectViewImpl.java:387)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.addProjectPane(ProjectViewImpl.java:360)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.ensurePanesLoaded(ProjectViewImpl.java:596)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.getProjectViewPaneById(ProjectViewImpl.java:735)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.getCurrentProjectViewPane(ProjectViewImpl.java:752)
    at com.intellij.ide.projectView.impl.ProjectViewImpl.refresh(ProjectViewImpl.java:757)
    at com.demonwav.mcdev.platform.MinecraftModule.getInstance(MinecraftModule.java:67)
    at com.demonwav.mcdev.platform.MinecraftModule.getInstance(MinecraftModule.java:92)
    at com.demonwav.mcdev.platform.bukkit.BukkitFileIconProvider.getIcon(BukkitFileIconProvider.java:22)
    at com.intellij.util.IconUtil.getProvidersIcon(IconUtil.java:182)
    at com.intellij.util.IconUtil.access$200(IconUtil.java:49)
    at com.intellij.util.IconUtil$2.fun(IconUtil.java:145)
    at com.intellij.util.IconUtil$2.fun(IconUtil.java:136)
    at com.intellij.ui.DeferredIconImpl.evaluate(DeferredIconImpl.java:287)
    at com.intellij.ui.DeferredIconImpl$2$1$1.run(DeferredIconImpl.java:158)
    at com.intellij.ui.IconDeferrerImpl.evaluateDeferred(IconDeferrerImpl.java:122)
    at com.intellij.ui.DeferredIconImpl$2$1.run(DeferredIconImpl.java:155)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1178)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils$2.run(ProgressIndicatorUtils.java:80)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils$5.run(ProgressIndicatorUtils.java:141)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:137)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:77)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:102)
    at com.intellij.ui.DeferredIconImpl$2.run(DeferredIconImpl.java:152)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Thread Dump

update things

yes that is a very vague title
add a button so you can update minecraft/forge to Latest version and MCP mappings to Latest
and the rest that you support

Add Event Factory Generation

Sponge provides a nice event generation utility that consumes event interfaces and produces a static factory generating the necessary methods to create those events. It would be a long term goal to possibly have some sort of event class generation through the modules.

For Bukkit based platforms, the event generation would be as simple as providing the class name, the fields desired, etc.

Forge Run Configs should use GradleStart

Instead of launching using runClient and runServer, Forge mods should launch as an Application using GradleStart and GradleStartServer.

  • This should use the classpath of the PROJECT_main module.
  • The working directory should default to PROJECT_DIR\run.

Example

Exception thrown , too long to summarize in title.

I created a new Sponge module, accidentally inside my SpongeForge module which has been correctly identifed as a forge module.

I closed intellij then moved the module to my top level Sponge folder which contains SpongeForge + plugins.

I restarted intellij, and it reported the following exception.

IntelliJ IDEA 2016.2.3 EAP
Build #IU-162.1812.2, built on August 16, 2016
--snip--
JRE: 1.8.0_76-release-b216 x86
JVM: OpenJDK Server VM by JetBrains s.r.o

MinecraftDevIntelliJ alpha-0.1.9 from the IntelliJ repository.

0
java.lang.ArrayIndexOutOfBoundsException: 0
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem$1.lambda$run$2(GradleBuildSystem.java:393)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:856)
    at com.demonwav.mcdev.buildsystem.gradle.GradleBuildSystem$1.run(GradleBuildSystem.java:389)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:494)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:128)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:308)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Weird packaging pattern

suppose my group is com.kinggoesgaming and artifact is Test then the main class comes at com.kinggoesgaming.Test.Test. This is quiet unusual and does not follow convention...

Plugin is incompatible with IntelliJ Ultimate Edition

I have the latest version of IntelliJ IDEA Ultimate edition of IntelliJ (basically just lots of fancy 1st-party plugins), yet I can't install the plugin.

I'm unable to find it in the repositories, and when I compile and try to load the built zip it says it's "incompatibly with this installation.

Looking at the repo page, it seems that this is because my build number is #143.2370 whereas the supported builds are #145.x

Package names

The package names in the filesystem are uppercase when cloning the repository

Problem Image

@SideOnly inspection triggered in proxy classes

While experimenting with Forge modding, with this plugin installed, I found that when referencing classes annotated @SideOnly(Side.CLIENT) in my ClientProxy, the inspection warnings were triggered (As proxy classes aren't annotated.)

As I'm aware that DemonWav isn't the most familiar with Forge, I'll explain. A typical forge mod will have 3 proxy classes, CommonProxy, ClientProxy, and ServerProxy (The second 2 extending the first). CommonProxy contains initializations for code common to both platforms, while ClientProxy contains client specific initializations (Code that won't be run on the server), and ServerProxy is the same (For servers).

Package naming conventions wrong

So when you create a project with this, you capitalize the package names. This is something that really should be changed, as I don't like having to go and make them all lowercase. Also when I type a name in CamelCase, you remove any capitals after the first one. Can you just leave the name as is (except for package names) :)

Unregistered Listener Analysis

Demon mentioned he will be adding Unregistered listener Inspection.

Requesting to make it smart about determining automatically registered listeners.

I have

public final class BukkitUtil {

    public static void registerListener(@NonNull org.bukkit.event.Listener listener) {
        Bukkit.getServer().getPluginManager().registerEvents(listener, Empire.getEmpire());
    }

    @SuppressWarnings("PublicInnerClass")
    public static class Listener implements org.bukkit.event.Listener {
        public Listener() {
            BukkitUtil.registerListener(this);
        }
    }
}

then my listeners extend BukkitUtil.Listener and I simply instantiate the Listener to register it.

Add TextColor parsing to the Gutter

Just like event listeners and how IntelliJ ultimate will show off java.awt.Color instances in the gutter, and Icons, we should be able to parse over PsiElements that contain references to some various color based classes from different platforms.

Perhaps optionally make it where they are explicit to only show the first color instance found in a line if there are multiple colors in play?

It'd be very similar to how the ListenerLineMarkerProvider is handled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.