athrane / bassebombecraft

Bassebombecraft Minecraft Mod
https://www.curseforge.com/minecraft/mc-mods/bassebombecraft
GNU General Public License v3.0
0 stars 0 forks source link

The method turnBackOn() is undefined for the type Lighting #1388

Closed athrane closed 2 years ago

athrane commented 2 years ago

Solution: To disable manipulation of the lightning system. It MUST be verified that this actually works.

` @Override public void run(Ports ports) { RenderGameOverlayEvent event = clientApplyV(fnGetEvent, ports); Vec2 textAnchor = applyV(fnGetTextAnchor, ports); ItemStack itemStack = applyV(fnGetItemStack, ports);

    // get rendering engine
    Minecraft mcClient = Minecraft.getInstance();
    ItemRenderer itemRenderer = mcClient.getItemRenderer();

    // push matrix
    PoseStack matrixStack = event.getMatrixStack();
    matrixStack.pushPose();

    // enable lightning
    Lighting.turnBackOn();

    // calculate icon position
    int xp = (int) (textAnchor.x + x);
    int yp = (int) (textAnchor.y + y);

    // render item stack
    itemRenderer.renderGuiItem(itemStack, xp, yp);

    // disable lightning
    Lighting.turnOff();

    // restore matrix
    matrixStack.popPose();
}

`