-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin Support #722
Comments
Maybe, depends on when Jetbrain's multi JVM language API work truly gets to a point when it can support it. The issue now is any features written for Java don't work for Kotlin, though that should be changing / is changing due to new API changes Jetbrains is working on. If it's to the point where mcdev features work or only require minor changes to work then it's something to consider possibly. |
Alright. It’s not too big of a deal. I just have to recreate my main class as a kotlin class and add maven dependencies for kotlin to set it up, but if it could be automatic, that would we awesome! |
+1 |
Problem? NO!I don't see a problem in using Kotlin on a bukkit server, because libraries from e.g. https://dev.bukkit.org/projects/kotlin are adding the "compatibility" directly. On the contrary, currently it is easier than ever to use the programming language Kotlin in a Java environment! For comparison, Forge usually has to be installed on the server AND even manually by the user, Kotlin has to be added ONLY as a default plugin by the administrator Since Kotlin also works directly with Java and refers to it several times, Kotlin is indirectly a Java framework, but I would not go that far :D It is a fact that nowadays it is not a technical problem to use Kotlin instead of Java or with Java, so that such a feature is important for the current market. As an example: new Android apps are nowadays also developed natively with Kotlin (problems? NO!) Since this plugin has unfortunately already 'missed' some new systems, it would be a pity to miss this system as well. For people like me this would be a reason to change to another system or to develop a plugin which offers these basic simple functions and extended support.
|
There is no reason to spam. Lack of kotlin support in the plugin is a technical limitation. If we didn't see the merits of kotlin, do you really think MinecraftDev itself would be written in kotlin? |
Hello, sorry for replying to an old-ish issue. I'm new to JVM dependency-management world such as Gradle/Maven (coming from JS/Python/Go), and would like to try on developing Spigot plugins. I'm currently trying to use Kotlin as the language. I understand MinecraftDev currently does not support Kotlin yet, but with the spirit of "getting the minimal workspace right" (what I feel from this project, similar to "bootstraper", boilerplate, scaffolding, generator, etc. from other languages), do you guys have a migration guide for migrating Java-Gradle Spigot plugin MinecraftDev project to use Kotlin? I have looked around at some repositories here on GitHub but seems everyone have their own way to setup the Gradle etc. If that's currently available, or if there's a recommended article/repository that I can refer to, that'd be great, but if there's none currently, that's ok as well. Thanks and cheers :) |
I haven't used the MinecraftDev setup in a while, but iirc it sets up your plugin.yml and leaves you with a project structure similar to this: When I do plugins, I just add a folder to that structure at package dev.jaims.relicthub
import dev.jaims.mcutils.bukkit.log
import dev.jaims.mcutils.bukkit.register
import dev.jaims.relicthub.listener.JoinLeaveListener
import org.bukkit.plugin.java.JavaPlugin
class RelictHub : JavaPlugin() {
// startup login
override fun onEnable() {
}
// shutdown logic
override fun onDisable() {
}
} You shouldn't need to change much of the build.gradle, but I've copied a recent one I did for a 1.16 paper plugin. plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
id 'com.github.johnrengelman.shadow' version '6.0.0'
}
group 'dev.jaims'
version '1.0'
shadowJar {
archiveClassifier.set("")
}
repositories {
mavenCentral()
maven { url 'https://papermc.io/repo/repository/maven-public/' }
maven { url 'https://repo.jaims.dev/repository/maven-releases' }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation 'dev.jaims.mcutils:bukkit:2.1.1'
compileOnly 'com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
} I think the only difference is adding the compileKotlin and compileTestKotlin tasks, as well as the kotlin std lib and kotlin plugin. I also added the shadowJar stuff to be able to shade dependencies. Hopefully this sorta answered what you were asking, but to sum it all up, I would usually just add the two Kotlin tasks, then start writing code at |
Thank you for your suggestion @Jaimss! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
To shed more light on what the technical limitation is: Creating a project with a Kotlin template is very easy. Not hard at all, and that's NOT the issue we are referring to. The plugin does a lot more than simply project creation. It's kind of disheartening how few people seem to actually understand that, but regardless, it does. I have pretty high standards for my own projects and work, and I am not going to release a half-baked feature. Creating a project in Kotlin when none of the other inspections and quick fixes that this plugin provides also work in Kotlin would definitely be half-baked. I didn't realize I hadn't marked this issue as accepted, so I did that. Hopefully that makes it more clear about where we stand on this, I hope. |
+1 |
Definitely need an update on this, this is still an issue |
+1 |
2 similar comments
+1 |
+1 |
Hi everyone! I would love to see full first class support for Kotlin, especially including all the quick fixes and inspections. |
+1 |
2 similar comments
+1 |
+1 |
It seems like it throws internal errors when using Kotlin in Architectury mods too. |
Has there been any work done on this matter and is there some kind of list of things that would have to be implemented (or list of blockers) for this issue to get closed? Maybe if we can all work together then this can be finished. |
Any news on adding Kotlin support? |
I believe this has been implemented as of the latest update? |
You can PR any missing templates to https://github.com/minecraft-dev/templates |
Should this issue be closed then, as Kotlin support is already implemented? |
Kotlin support is more than just the creator, I'm working on supporting event listener generation for example. |
Hi, I love using this plugin to setup my minecraft plugin projects. In the past I have always used Java, but recently, I switched to Kotlin because I personally like it more and I think it is better.
Would it be possible to add Kotlin support to the options when setting up a project?
The text was updated successfully, but these errors were encountered: