Krysztal's Language Scala
ModA fork of fabric-language-scala, but support the newest version of Scala3
Description
Krysztal's fork of fabric-language-scala
This is a fork of fabric-language-scala, support the newest Scala3 version.
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 adapter will synchronize content upstream as much as possible and will ensure availability as much as possible.
- If you are DEVELOPER, please reading FOR_DEVELOPER, and remind your user which Scala3 version you used
- I suggested you should using the newest version as possible
- If you are USER, please reading FOR_USER
From KLS 3.3.2, the compile target is Java 25. Older Java runtimes are not supported.
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://api.modrinth.com/maven" }
...
}
dependencies {
...
// Scala 3 language support (Fabric language adapter + Scala runtime, bundled at runtime by this mod).
implementation("maven.modrinth:krysztal-language-scala:${property("krysztal_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.
Compatibility
Mod Loaders
Game Versions
Recommended Gear
AffiliateHardware and extras that pair well with this mod.
As an Amazon Associate I earn from qualifying purchases.
Similar Mods
SCP: Lockdown Labels Expansion
A discontinued continuation of the SCP Labels mod
CobbleBuilds: Leaders [Cobblemon Addon]
Gym structures and leaders for Cobblemon
Create Aeronautics: Dyeable Components
This is an addon for Create Aeronautics that makes various components dyeable!
SnAssets Library - Particles
An asset library containing particle textures from and for my mods.
Powah: Overcharged
A maintaned fork of powah for 1.16.5 that adds an 8th tier of capacitors and other stuff!
Advanced Rotten Flesh to Leather
Simple mod, allows You to turn rotten flesh into leather