Branch 26.1
This mod adds a Scala library to Minecraft 26.1.2 with Forge and NeoForge. NO COMPATIBILITY WITH 1.x version of SLP.
-
For Player – Download a Jar file from Curse Forge or Modrinth and move the file to your
modsfolder. This mod will not appear in the mod list. -
For Developer
See the example directory.In your
build.gradle, add below code in the top-level.repositories { maven { name = "kotori316" url = uri("https://maven.kotori316.com") content { includeModule("com.kotori316", "ScalableCatsForce".toLowerCase()) includeModule("org.typelevel", "cats-core_3") includeModule("org.typelevel", "cats-kernel_3") includeModule("org.typelevel", "cats-free_3") } } } dependencies { // Add Forge or NeoForge dependency as the platform requires // Scala, no need to add Scala2 dependency since 3.8.3 implementation('org.scala-lang:scala3-library_3:3.8.3') // Add if you need this library. I use a modified version of Cats to avoid some module errors. implementation('org.typelevel:cats-kernel_3:2.13.0-kotori') // The language loader. You can put the jar to the mods dir instead of declaring in `build.gradle.kts`. runtimeOnly("com.kotori316:scalablecatsforce:4.0.4-mc26.1.2-3.8.3:dev") { transitive(false) } }- If the Minecraft client doesn't launch with an exception to modules, change scala dependency from "implementation" to "compileOnly" and add slp mod in the mods directory.
- Change the library version if needed.
- See detail pages in CurseForge or Modrinth to get which library version is included in the Jar file.
- From 26.1.2 version, SLP includes Scala 3.8.3
In this section, I note some points you should care.
- Avoid use of
Mod.EventBusSubscriberin Java code. This will cause exception in "compileScala" task.
- Use in Scala code will not throw an exception.
- If you got the compile error "ambiguous reference to overloaded definition", specify the return type.
- For example,
val offsetPos = pos.relative(direction)will cause this error becauserelativeis declared both inBlockPosandVec3i, and the return types are different. So, the compiler can't determine which method to call. To resolve this issue, specify the return type as follows.val offsetPos: BlockPos = pos.relative(direction)
- Scala - GitHub - is licenced under the Apache License, Version 2.0.
- Cats - GitHub - is licenced under
the Licence.
- SLP uses modified version of Cats to avoid module error.