KubeJS GT Dynamic Render
Modby P_nutsK
Addon for adding GregTech CEu Modern renderers with KubeJS
Type
Mod
CurseForge Downloads
8,160
CurseForge ID
1427855
Last Updated
Aug 22, 2026
Description
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); }Recommended Gear
AffiliateHardware and extras that pair well with this mod.
As an Amazon Associate I earn from qualifying purchases.
Similar Mods
Netherite Extras
A vanilla-friendly mod that adds more uses for Netherite, including Nuggets, Wolf Armor, Horse Armor, Apples and a multi...
Lag'B'Gon Reborn
Lag reduction utility for Forge, inspired by ClearLagg for Bukkit.
project-877101
Realistic Vehicles in Mineacraft!
Default Potion Tweaks
Changes the behavior of certain vanilla potion effects, as well as allowing greater control over their specific values
AURORA SHADERS [FULL REVAMP]
Aurora Shaders is a lightweight shader engine for Forge 1.20.1 that focuses on clarity, color, and performance. It provi...
[SBW] Electronic Countermeasure Force
Electronic Warfare Radio Systems for Minecraft