Skip to content

Commit

Permalink
fix rotor holding lighting being funny
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC committed Dec 31, 2024
1 parent 4f4cb8b commit b921f70
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -53,17 +56,21 @@ public void renderMachine(List<BakedQuad> 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));
}
}
}
Expand Down

0 comments on commit b921f70

Please sign in to comment.