Fabric language kotlin mod

Библиотека Fabric Language Kotlin

Fabric Language Kotlin — это специальная библиотека, позволяющая разработчикам писать моды под загрузчик Fabric на языке Kotlin. Она также понадобится пользователям для запуска этих модов. Готового контента в ней нет, устанавливай только в том случае, если этого требует инструкция.

Инструкция по установке Fabric Language Kotlin

  1. Убедись, что у тебя установлен Fabric Loader и Fabric API.
  2. Скачай мод для своей версии игры.
  3. Закинь его в папку mods, которая расположена в папке с игрой.

Похожие Моды

Мод OptiFabric

Совмещение Optifine и модов под Fabric теперь возможно! Для этого нужно лишь скачать мод OptiFabric. Теперь вместе модами для Фабрик ты сможешь использовать шейдеры, анимированные и HD-текстуры, а также получить…

Мод LambDynamicLights [Fabric][Quilt]

Мод LambDynamicLights добавляет в Майнкрафт реалистичное освещение от всех источников. Например, ты сможешь нести в руках факел и освещать местность вокруг. Также светятся спектральные стрелы, горящие и огненные мобы. Мод…

Мод Paintings++ [Fabric]

С модом Paintings++ ты сможешь оживить дизайн структур в Майнкрафте. Этот мод добавляет в игру новые картины разного размера. После установки Paintings++ ты сможешь самостоятельно выбирать картину, которую хочешь повесить….

261632

205287

117329

114057

109101

Наш сайт использует файлы 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.

Читайте также:  Классы методы функции java

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.

Источник

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

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.8+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.8+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
Читайте также:  Генератор случайных последовательностей python

Источник

Fabric Language Kotlin Mod

Fabric Language Kotlin is one of the many Fabric Language adapters for Kotlin. Language adapters let you write mods in programming languages other than pure Java (often but not always JVM-based languages). There are many big Fabric mods which use Kotlin including

  • Adorn
  • Inventory Tweaks
  • AE Additions – ExtraCells2 Fork
  • Bountiful
  • DeftuLib
  • Hex Casting
  • Industrial Revolution
  • Inventerio
  • Kambrik
  • Lakeside
  • LibrarianLib
  • Level Up HP
  • MirageFairy2023
  • Ping Wheel
  • Plethora Peripherals
  • Roughly Enough Trades
  • Roughly Enough Loot Tables
  • RSWires
  • TerrarianSlimes
  • Woods and Mires
  • Zoomify
  • and many more.

Kotlin is primarily a JVM-based programming language like Groovy or Scala and is in many ways considered a newer Scala (though Scala is still being developed), though it does not only compile to JVM, it can also compile to native or to JavaScript or even its own bytecode format. Fabric Language Kotlin is meant to be used with the JVM variant though.

Kotlin as mentioned before has some in common with Scala and a little in common with Crystal. Kotlin Language is a must-use for many people, many people really like it, while others do not. One issue you have is if you use Kotlin you may have compatibility issues with lesser-known tool chains that you may port your mod too. But if you want to use Kotlin because you prefer it you can use this language adapter. There are reasons to prefer Kotlin if you like some of the features or if you want to also do things like Android development (which has recently started to recommend Kotlin over Java which it had previously). If you use Kotlin it is suggested you use IntelliJ because they are made by the same company and eclipse does not have quite as good of support for it.

For players, you should be able to just install the mod in your mods folder. If you are a developer you will need to take extra steps and requires the user already know a little bit about using Kotlin with Gradle (but Groovy DSL can still be used unless you want Kotlin DSL). FabricMC has a tutorial which can be used with basic instructions about getting started. Fabric Language Kotlin does not rely on any specific version of Minecraft, just on Fabric loader.

Читайте также:  margin-bottom

Installation

Follow the procedures described below to install this mod into your game

Fabric installation

  1. Download and install the Fabric
  2. Install Fabric API
  3. Download the mod
  4. Put the mod into .minecraft/mods folder
  5. Launch Minecraft

Источник

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

Источник

Оцените статью