All versions
0.1-alpha.4
Alpha
ClassJS 0.1-alpha.4last year 26
Compatibility
Minecraft: Java Edition
1.20.1
Platform
Forge
Supported environments
Client and server
Required content
Any compatible version
Any compatible version
Any compatible version
Changes
New Features
-
ClassJSUtils.loadClass- Allows to load a class that was created by
ClassCreator.
let TestClass = ClassCreator.create("TestClass") .toPublic() .defaultConstructor() .defineClass(); let loaded = ClassJSUtils.loadClass("TestClass"); console.info(loaded === TestClass); // true - Allows to load a class that was created by
-
MethodCreator.codeJSWithThis- Allows to define a method where the first parameter is
this.
let TestClass = ClassCreator.create("TestClass") .toPublic() .defaultConstructor() .createField("testField", "int") .toPublic() .build() .createMethod("testMethod", ["java.lang.String", "int"], "void") .toPublic() .codeJSWithThis((thisObj, s, r) => { // Now, `thisObj` represents the instance of TestClass console.info(s + 's'.repeat(r)); thisObj.testField = r; }) .defineClass(); - Allows to define a method where the first parameter is
Fixed Bugs
- Reloading methods written in
invokeJSthat are never used causedNullPointerException. - Specifying a method's parameter types or its return type as the currently defining class caused
TypeNotPresentException.
Optional dependencies
Any compatible version
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:AR7tLpwK:x8qQUxkf"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:AR7tLpwK:x8qQUxkf"
}

