- Библиотека Fabric Language Kotlin
- Инструкция по установке Fabric Language Kotlin
- Похожие Моды
- Мод Villager Hats [Fabric][Quilt]
- Библиотека TerraBlender [Forge]
- Мод Repurposed Structures [Fabric][Quilt]
- Privacy Overview
- Using Kotlin with Fabric
- Advantage for using Kotlin
- Understanding Limitation
- Step 1: Configure/Initialize mod as same as Java does
- Step 2: Configure Kotlin with IntellIJ’s feature
- Step 3: Modify gradle file
- Method of manage Kotlin core library dependency
- Increasing version of jvmToolchain(Only for MC 1.17+)
- Saved searches
- Use saved searches to filter your results more quickly
- License
- FabricMC/fabric-language-kotlin
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Using Kotlin with Fabric
- Advantage for using Kotlin
- Understanding Limitation
- Step 1: Configure/Initialize mod as same as Java does
- Step 2: Configure Kotlin with IntellIJ’s feature
- Step 3: Modify gradle file
- Method of manage Kotlin core library dependency
- Increasing version of jvmToolchain(Only for MC 1.17+)
Библиотека Fabric Language Kotlin
Fabric Language Kotlin — это специальная библиотека, позволяющая разработчикам писать моды под загрузчик Fabric на языке Kotlin. Она также понадобится пользователям для запуска этих модов. Готового контента в ней нет, устанавливай только в том случае, если этого требует инструкция.
Инструкция по установке Fabric Language Kotlin
- Убедись, что у тебя установлен Fabric Loader и Fabric API.
- Скачай мод для своей версии игры.
- Закинь его в папку mods, которая расположена в папке с игрой.
Похожие Моды
Мод Villager Hats [Fabric][Quilt]
С модом Villager Hats у тебя появится возможность носить шляпы жителей. Мод добавляет рецепты для шляп, так что ты сможешь крафтить их и надевать. Примерь на себя шляпу фермера, пастуха,…
Библиотека TerraBlender [Forge]
TerraBlender часто используется для модов на генерацию мира. С этой библиотекой авторы модов могут легко добавлять в игру новые биомы и редактировать их свойства. Однако, устанавливать её отдельно нет смысла,…
Мод Repurposed Structures [Fabric][Quilt]
Repurposed Structures — это один из наиболее интересных модов на структуры для Майнкрафт. Его особенностью является верность оригинальному стилю, все новые здания созданы на основе уде существующих. Новые структуры появятся…
261332
204849
117038
113900
108960
Наш сайт использует файлы cookie для вашего удобства. Продолжая использовать наш сайт, вы подтверждаете свое согласие на получение таких файлов. ПРИНЯТЬ
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Using Kotlin with Fabric
Kotlin is very powerful language which highly integrated with Java language and able to executed by JVM. With this, you can also use Kotlin language for development of Minecraft fabric mod.
Advantage for using Kotlin
I assume you’re using latest version of IntellIJ.
Understanding Limitation
You cannot use Kotlin file inside Mixin. But, you can redirect with invoking method which marked by @JvmStatic annotation or method in object or companion object .
Step 1: Configure/Initialize mod as same as Java does
Step 2: Configure Kotlin with IntellIJ’s feature
You can use (Tools → Kotlin → Configure Kotlin in Project) or shortcut (Ctrl + Alt + Shift + K or Command + Option + Shift + K). This is the easiest method to configure especially using with Minecraft Development plugin which doesn’t supports Kotlin template. This will apply gradle plugin for Kotlin, add dependencies for Kotlin language.
Finally, sync gradle project.
You can write/compile with Kotlin this point.
Step 3: Modify gradle file
Method of manage Kotlin core library dependency
There are API which provided by fabric project to support kotlin which can integrate easier. With this dependency, core and some extra packages for kotlin has automatically added to project, and you don’t need to spend energy caused by shadowing entire Kotlin classes.
To use this, you can convert
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
modImplementation("net.fabricmc:fabric-language-kotlin:1.9.5+kotlin.1.8.22")
Do not forget to add dependency to fabric.mod.json .
Also, you can change the signature of the initializer handler to Kotlin specified method like method inside object classes.(As described inside the README.md in github)
Increasing version of jvmToolchain(Only for MC 1.17+)
Because Kotlin has exception, sometimes you should mix Java. BUT Minecraft 1.17+ uses java version greater then 11, you should increase the version of jvmToolcahin.
You can simply increasing the number of
greater then version of java.(I suggest using 17 in MC 1.18+)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Fabric language module for Kotlin.
License
FabricMC/fabric-language-kotlin
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Co-authored-by: github-actions
Git stats
Files
Failed to load latest commit information.
README.md
Fabric language module for Kotlin. Adds support for Kotlin exclusive entrypoints and bundles the Kotlin Stdlib as well as common kotlinx libraries.
Add it as a dependency to your Gradle project:
dependencies < modImplementation("net.fabricmc:fabric-language-kotlin:1.10.0+kotlin.1.9.0") >
Use the kotlin adapter for your mod by setting the adapter property in the fabric.mod.json file. Remember to the add a dependency entry to your fabric.mod.json file:
< "schemaVersion": 1, "entrypoints": < "main": [ < "adapter": "kotlin", "value": "package.ClassName" > ] >, "depends": < "fabric-language-kotlin": ">=1.10.0+kotlin.1.9.0" > >
Do not forget to set the schemaVersion to 1 or it will fall back to schema 0 and will not attempt to load entrypoints.
< "adapter": "kotlin", "value": "mymod.MyMod" >
package mymod class MyMod : ModInitializer < override fun onInitialize() < TODO() > >
< "adapter": "kotlin", "value": "mymod.MyMod" >
package mymod object MyMod : ModInitializer < override fun onInitialize() < TODO() > >
< "adapter": "kotlin", "value": "mymod.MyMod::init" >
package mymod object MyMod < fun init() < TODO() > >
< "adapter": "kotlin", "value": "mymod.MyMod::initializer" >
package mymod object MyMod < val initializer = ModInitializer < TODO() > >
< "adapter": "kotlin", "value": "mymod.MyMod$Companion" >
package mymod class MyMod < companion object : ModInitializer < override fun onInitialize() < TODO() > > >
< "adapter": "kotlin", "value": "mymod.MyMod$Companion::init" >
package mymod class MyMod < companion object < fun init() < TODO() > > >
< "adapter": "kotlin", "value": "mymod.MyMod$Companion::initializer" >
package mymod class MyMod < companion object < val initializer = ModInitializer < TODO() > > >
< "adapter": "kotlin", "value": "mymod.MyModKt::init" >
package mymod fun init() < TODO() >
Companion objects can be used by appending $Companion to the class. Take care of processResources there, it might try to expand it, in that case escape it.
- kotlinx-coroutines-core 1.7.2 Guide, API docs, GitHub
- kotlinx-coroutines-jdk8 1.7.2 API docs
- kotlinx-serialization-core 1.5.1 Guide, API docs, GitHub
- kotlinx-serialization-json 1.5.1 API docs
- kotlinx-serialization-cbor 1.5.1 API docs
- atomicfu 0.21.0 GitHub
- kotlinx-datetime 0.4.0 GitHub
Using Kotlin with Fabric
Kotlin is very powerful language which highly integrated with Java language and able to executed by JVM. With this, you can also use Kotlin language for development of Minecraft fabric mod.
Advantage for using Kotlin
I assume you’re using latest version of IntellIJ.
Understanding Limitation
You cannot use Kotlin file inside Mixin. But, you can redirect with invoking method which marked by @JvmStatic annotation or method in object or companion object .
Step 1: Configure/Initialize mod as same as Java does
Step 2: Configure Kotlin with IntellIJ’s feature
You can use (Tools → Kotlin → Configure Kotlin in Project) or shortcut (Ctrl + Alt + Shift + K or Command + Option + Shift + K). This is the easiest method to configure especially using with Minecraft Development plugin which doesn’t supports Kotlin template. This will apply gradle plugin for Kotlin, add dependencies for Kotlin language.
Finally, sync gradle project.
You can write/compile with Kotlin this point.
Step 3: Modify gradle file
Method of manage Kotlin core library dependency
There are API which provided by fabric project to support kotlin which can integrate easier. With this dependency, core and some extra packages for kotlin has automatically added to project, and you don’t need to spend energy caused by shadowing entire Kotlin classes.
To use this, you can convert
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
modImplementation("net.fabricmc:fabric-language-kotlin:1.9.5+kotlin.1.8.22")
Do not forget to add dependency to fabric.mod.json .
Also, you can change the signature of the initializer handler to Kotlin specified method like method inside object classes.(As described inside the README.md in github)
Increasing version of jvmToolchain(Only for MC 1.17+)
Because Kotlin has exception, sometimes you should mix Java. BUT Minecraft 1.17+ uses java version greater then 11, you should increase the version of jvmToolcahin.
You can simply increasing the number of
greater then version of java.(I suggest using 17 in MC 1.18+)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International