▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/ClassJS
ClassJS

ClassJS

A KubeJS addon to create Java classes

Оцените первым
1.4K
1
Все версии→ClassJS 0.1-alpha.4

ClassJS 0.1-alpha.4

Alpha17.10.2025

Список изменений

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
    
  • 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();
    

Fixed Bugs

  • Reloading methods written in invokeJS that are never used caused NullPointerException.
  • Specifying a method's parameter types or its return type as the currently defining class caused TypeNotPresentException.

Файлы

classjs-1.20.1-0.1-alpha.4.jar(199.98 KiB)
Основной
Скачать

Метаданные

Канал релиза

Alpha

Номер версии

0.1-alpha.4

Загрузчики

Forge

Версии игры

1.20.1

Загрузок

19

Дата публикации

17.10.2025

Загрузил

ID версии

Главная