Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Krysztal's Language Scala

Krysztal's Language Scala

A fork of fabric-language-scala, but support the newest LTS version of Scala3

1,203
5
Library
AboutChangelogVersions

Krysztal's fork of fabric-language-scala

Modrinth Version

This is a fork of fabric-language-scala, support the newest Scala3 version and bundled Scala Library.

Why fork?

The number of people who use Scala is very small, but the power of Scala's expressiveness makes the language practically perfect for developing mods.

The original fabric-language-scala was unmaintained and the maintainers couldn't spare any more effort to maintain it, so it slowly became unmaintained and non-functional.

Support for Scala3 is, if anything, almost non-existent.

So I decided to fork it and maintain it myself and implement it to be compatible with the original fabric-language-scala,named krysztal-language-scala.

NOTE

  • This language adaptor will synchronize content upstream as much as possible and will ensure availability as much as possible.

How to use?

Add dependence

Add those lines to your project's build.gradle


plugins {
  ...
	id 'scala' // Add `scala` plugin for gradle
  ...
}

repositories {
  ...
	maven { url "https://maven.krysztal.dev/releases" }
  ...
}

dependencies {
  ...
	modImplementation "dev.krysztal:krysztal-language-scala:${project.kls_version}+scala.${project.scala_version}"
  ...
}

Usage: class

Suppose your entry name is ExampleEntry.scala

import net.fabricmc.api.ModInitializer;

class ExampleEntry extends ModInitializer {
   lazy val logger = LoggerFactory.getLogger("KMMO")
   override def onInitialize(): Unit = {
       logger.info("Hi")
   }
}

And in fabric.mod.json

    ...
 "entrypoints": {
    "main": [
      "dev.example.ExampleEntry"
    ],
  },
    ...

But thanks to Scala's excellent interoperability with Java, we can use this library simply as a Java entry point :)

Usage: object

Suppose your entry name is ExampleEntry.scala

import net.fabricmc.api.ModInitializer;

object ExampleEntry extends ModInitializer {
    lazy val logger = LoggerFactory.getLogger("KMMO")
    override def onInitialize(): Unit = {
        logger.info("Hi")
    }
}

And in fabric.mod.json

    ...
 "entrypoints": {
    "main": [
      {
        "adapter": "scala",
        "value": "dev.example.ExampleEntry"
      }
    ],
  },
    ...

Known issues

unknown invokedynamic bsm: scala/runtime*

This issues caused by scala's class loading mechanism.

It won't affect almost anything. Ignore it.

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

24w34a
1.21.x
1.20.x
1.19.x
1.18.x
1.17.x

Platforms

Fabric

Supported environments

Client and server

Links

Report issues View source

Creators

Krysztal112233
Krysztal112233 Member

Details

Licensed Apache-2.0
Published last year
Updated 3 weeks ago

Modrinth is open source.

main@a0bd011

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.