Skip to content

Commit

Permalink
add config for emissive textures (default true)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Sep 4, 2021
1 parent 1a75afb commit fb6b042
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/gregtech/api/render/OrientedOverlayRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import codechicken.lib.vec.Cuboid6;
import codechicken.lib.vec.Matrix4;
import gregtech.api.GTValues;
import gregtech.common.ConfigHolder;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.EnumFacing;
Expand Down Expand Up @@ -121,8 +122,13 @@ public void render(CCRenderState renderState, Matrix4 translation, IVertexOperat

TextureAtlasSprite emissiveSprite = predicate.getEmissiveSprite(isActive);
if (emissiveSprite != null) {
IVertexOperation[] lightPipeline = ArrayUtils.add(ops, new LightMapOperation(240, 240));
Textures.renderFace(renderState, translation, lightPipeline, renderSide, bounds, emissiveSprite);
if (ConfigHolder.U.emissiveTextures) {
IVertexOperation[] lightPipeline = ArrayUtils.add(ops, new LightMapOperation(240, 240));
Textures.renderFace(renderState, translation, lightPipeline, renderSide, bounds, emissiveSprite);
} else {
// have to still render both overlays or else textures will be broken
Textures.renderFace(renderState, translation, ops, renderSide, bounds, emissiveSprite);
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ public static class UnofficialOptions {
@Config.RequiresWorldRestart
public double multiblockSteamToEU = 0.5;

@Config.Comment("Whether or not to enable Emissive Textures for GregTech Machines. Default: true")
public boolean emissiveTextures = true;

public static class GT5U {

@Config.Comment("This config requires 'B:Use custom machine tank sizes' = true to take effect. Changes the input tank size to the first value, and out tank size to the second value for nearly every single block machine. Units are millibuckets. Default: {64000, 64000}")
Expand Down

0 comments on commit fb6b042

Please sign in to comment.