Back to mods
KubeJS GT Dynamic Render project artwork

CurseForge · Minecraft mod

KubeJS GT Dynamic Render

Addon for adding GregTech CEu Modern renderers with KubeJS

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which KubeJS GT Dynamic Render release should I use?

Updated 9 months ago
Latest stable file kubejs_gtrender-0.2.2.jar
Game version 1.20.1
Loader Forge

KubeJS GT Dynamic Render kubejs_gtrender-0.2.2.jar targets 1.20.1 with Forge. The project page does not say whether this file belongs on the client, dedicated server, or both. All 4 required mods have matching files.

Where it goes

Is KubeJS GT Dynamic Render required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release Forge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does KubeJS GT Dynamic Render kubejs_gtrender-0.2.2.jar need?

kubejs_gtrender-0.2.2.jar. Change the file and its required mods may change too.

All 4 required mods have matching files

Install KubeJS, GregTech CEu Modern, Rhino, Architectury API first. We found matching files for this game-version and loader setup. 7 come through another mod in the chain.

2 listed on this file 7 pulled in by those mods
KubeJS Needed by KubeJS GT Dynamic Render kubejs_gtrender-0.2.2.jar
required
Matching file found Matched file: KubeJS Forge 2001.6.5-build.26
GregTech CEu Modern Needed by KubeJS GT Dynamic Render kubejs_gtrender-0.2.2.jar
required
Matching file found Matched file: GregTech CEu 1.20.1-7.5.3
Rhino Needed by KubeJS
pulled in
Matching file found Matched file: Rhino Forge 2001.2.3-build.10
Architectury API Needed by KubeJS
pulled in
Matching file found Matched file: [Forge 1.20(.1)] v9.2.14
Just Enough Items (JEI) Needed by GregTech CEu Modern
pulled in
Matching file found Matched file: 15.62.0.219 for Forge 1.20.1
EMI Needed by GregTech CEu Modern
pulled in
Matching file found Matched file: emi-1.1.24+1.20.1+forge
Jade 🔍 Needed by GregTech CEu Modern
pulled in
Matching file found Matched file: [Forge 1.20.1] 11.13.3
MezzConfig Needed by Just Enough Items (JEI)
pulled in
Matching file found Matched file: MezzConfig 0.6.8 for Forge 1.20.1
MezzConfigGUI Needed by Just Enough Items (JEI)
pulled in
Matching file found Matched file: MezzConfig GUI mc1.20.1-0.5.10 for Forge

7 extra mods were pulled in by other dependencies. Indented rows show who needs each one. We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add KubeJS GT Dynamic Render without breaking your instance.

Built for KubeJS GT Dynamic Render kubejs_gtrender-0.2.2.jar. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use kubejs_gtrender-0.2.2.jar. It targets 1.20.1 with Forge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install KubeJS, GregTech CEu Modern, Rhino, Architectury API first. We found matching files for this game-version and loader setup. 7 come through another mod in the chain.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside kubejs_gtrender-0.2.2.jar. It opens that exact file at the source.

About this project

What does KubeJS GT Dynamic Render add?

Wouldn't you like to add cool rendering to GregTech CEu Modern? But that requires Java? Don't worry! This mod solves that.

We only support 1.20.1 Forge because that's where GTCEu is.

Example:

in startup_scripts:

GTRenderJSEvents.registerModelsForRender(event => {
    event.register("kubejs:obj/space");
    event.register("kubejs:obj/star");
    event.register("kubejs:obj/foo");
    event.register("kubejs:obj/bar");
    event.register("kubejs:obj/baz");
});

These obj files should be placed in /assets/kubejs/models.

in startup_scripts (gregtech multiblockmachine registry)

// before
.workableCasingModel(
            "gtceu:block/casings/solid/machine_casing_stable_titanium",
            "gtceu:block/multiblock/implosion_compressor"
        );
// You will use this instead of that.
// after
.model(
            GTMachineModels.createWorkableCasingMachineModel(
                "gtceu:block/casings/solid/machine_casing_stable_titanium",
                 "gtceu:block/multiblock/implosion_compressor"
            )["andThen(java.util.function.Consumer)"](b =>
                b.addDynamicRenderer(() => KubeJSDynamicRender.of("kubejs:example"))
            )
        );

in client_scripts

const OverlayTexture = Java.loadClass("net.minecraft.client.renderer.texture.OverlayTexture");
const RenderType = Java.loadClass("net.minecraft.client.renderer.RenderType");
const LightTexture = Java.loadClass("net.minecraft.client.renderer.LightTexture");

GTRenderJSEvents.registerDynamicRender(event => {
    event.create(
        "kubejs:example",
        /**
         *@param {Internal.RenderBuilder<Internal.WorkableElectricMultiblockMachine,{ someValue:string }>} builder
         */
        builder => {
            // default: raw => raw
            // By using this API, you can utilize arguments with type safety and default values.
            // The result of this function is cached.
            builder.prepareBindings(raw => {
                return {
                    someValue: raw.someValue || "default value",
                };
            });

            builder.render(ctx => {
                // you can use bindings here
                console.log(ctx.binding.someValue);
                // const light = ctx.packedLight;
                // const overlay = ctx.packedOverlay;
                const machine = ctx.machine;
                const poseStack = ctx.poseStack;
                const buffer = ctx.buffer;
                var tick = machine.getOffsetTimer() + ctx.partialTick;
                // offsets
                var x = 0.5,
                    y = 0.5,
                    z = 0.5;
                switch (machine.getFrontFacing()) {
                    case Direction.NORTH:
                        z = 16.5;
                        break;
                    case Direction.SOUTH:
                        z = -15.5;
                        break;
                    case Direction.WEST:
                        x = 16.5;
                        break;
                    case Direction.EAST:
                        x = -15.5;
                        break;
                }
                poseStack.pushPose();
                poseStack.translate(x, y, z);
                renderOuterSpaceShell(poseStack, buffer.getBuffer(RenderType.solid()));
                poseStack.popPose();
            });
            const shouldRender = machine => machine.isFormed();

            builder
                .viewDistance(256)
                .shouldRender(shouldRender)
                .shouldRenderOffScreen(shouldRender)
                .renderBoundingBox(() => {
                    // todo ちゃんとやる
                    const rad = 32;
                    return AABB.of(-rad, -rad, -rad, rad, rad, rad);
                });
        }
    );
});
/**
 * @param {Internal.PoseStack} poseStack
 * @param {Internal.MultiBufferSource} buffer
 * @param {number} scale
 */
function renderOuterSpaceShell(poseStack, buffer) {
    const scale = 0.01 * 17.5;
    poseStack.pushPose();
    poseStack.scale(scale, scale, scale);
    const rt = RenderType.solid();
    BakedModelRenderer.renderModel(poseStack.last(), buffer.getBuffer(rt), getBakedModel("kubejs:obj/space"), rt);
    poseStack.popPose();
}

/**
 * @param {ResourceLocation_} id
 */
function getBakedModel(id) {
    // In the context of KubeJS, Client = Minecraft.getInstance()
    return Client.getModelManager().getModel(id);
}

Project description from CurseForge.

Pick your setup

KubeJS GT Dynamic Render by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

1 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

KubeJS GT Dynamic Render versions and loaders

2 of 2 releases match

Looking for an older file? The official CurseForge project page is in Resources.