From b921f709bb3434e9859b7232653a83f433a62023 Mon Sep 17 00:00:00 2001 From: YoungOnion <39562198+YoungOnionMC@users.noreply.github.com> Date: Mon, 30 Dec 2024 19:13:46 -0700 Subject: [PATCH] fix rotor holding lighting being funny --- .../machine/RotorHolderMachineRenderer.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/RotorHolderMachineRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/RotorHolderMachineRenderer.java index ef72a42219..4fa0ae488f 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/RotorHolderMachineRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/RotorHolderMachineRenderer.java @@ -1,10 +1,13 @@ package com.gregtechceu.gtceu.client.renderer.machine; import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.data.chemical.material.Material; +import com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey; import com.gregtechceu.gtceu.api.machine.MachineDefinition; import com.gregtechceu.gtceu.api.machine.MetaMachine; import com.gregtechceu.gtceu.api.machine.feature.multiblock.IRotorHolderMachine; import com.gregtechceu.gtceu.client.util.StaticFaceBakery; +import com.gregtechceu.gtceu.common.item.TurbineRotorBehaviour; import com.lowdragmc.lowdraglib.client.model.ModelFactory; @@ -53,17 +56,21 @@ public void renderMachine(List quads, MachineDefinition definition, @ var aabb = new AABB(-1, -1, -0.01, 2, 2, 1.01); if (!rotorHolderMachine.getControllers().isEmpty()) { quads.add(StaticFaceBakery.bakeFace(aabb, modelFacing, ModelFactory.getBlockSprite(BASE_RING), - modelState, -101, 15, true, false)); + modelState, -101, 0, true, false)); quads.add(StaticFaceBakery.bakeFace(aabb, modelFacing, ModelFactory.getBlockSprite(BASE_BG), - modelState, -101, 15, true, false)); + modelState, -101, 0, true, false)); if (rotorHolderMachine.hasRotor()) { + Material mat = TurbineRotorBehaviour.getBehaviour(rotorHolderMachine.getRotorStack()) + .getPartMaterial(rotorHolderMachine.getRotorStack()); + boolean emissive = mat.hasProperty(PropertyKey.ORE) && + mat.getProperty(PropertyKey.ORE).isEmissive(); if (rotorHolderMachine.isRotorSpinning()) { quads.add( StaticFaceBakery.bakeFace(aabb, modelFacing, ModelFactory.getBlockSprite(SPINNING), - modelState, 2, 0, true, true)); + modelState, 2, emissive ? 12 : 5, true, true)); } else { quads.add(StaticFaceBakery.bakeFace(aabb, modelFacing, ModelFactory.getBlockSprite(IDLE), - modelState, 2, 0, true, true)); + modelState, 2, emissive ? 12 : 5, true, true)); } } }