Bassebombecraft

Bassebombecraft

18.5k Downloads

The method turnBackOn() is undefined for the type Lighting

athrane opened this issue ยท 1 comments

commented
commented

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

`