Skip to content

Commit

Permalink
add configurable colors for machines and cables
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Jul 5, 2021
1 parent 0201b71 commit 23f9c5d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import gregtech.api.render.Textures;
import gregtech.api.util.GTFluidUtils;
import gregtech.api.util.GTUtility;
import gregtech.common.ConfigHolder;
import net.minecraft.block.Block;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
Expand Down Expand Up @@ -60,7 +61,7 @@

public abstract class MetaTileEntity implements ICoverable {

public static final int DEFAULT_PAINTING_COLOR = 0xFFFFFF;
public static int DEFAULT_PAINTING_COLOR = ConfigHolder.U.GT5u.defaultPaintingColor;
public static final IndexedCuboid6 FULL_CUBE_COLLISION = new IndexedCuboid6(null, Cuboid6.full);
public static final String TAG_KEY_PAINTING_COLOR = "PaintingColor";
public static final String TAG_KEY_FRAGILE = "Fragile";
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gregtech/api/pipenet/tile/IPipeTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import gnu.trove.map.TIntIntMap;
import gregtech.api.pipenet.block.BlockPipe;
import gregtech.api.pipenet.block.IPipeType;
import gregtech.common.ConfigHolder;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
Expand All @@ -13,7 +14,7 @@

public interface IPipeTile<PipeType extends Enum<PipeType> & IPipeType<NodeDataType>, NodeDataType> {

int DEFAULT_INSULATION_COLOR = 0x777777;
int DEFAULT_INSULATION_COLOR = ConfigHolder.U.GT5u.defaultInsulationColor;

World getPipeWorld();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ public double getCoverPlateThickness() {

@Override
public int getPaintingColor() {
return holder.getInsulationColor() == IPipeTile.DEFAULT_INSULATION_COLOR ? 0xFFFFFF : holder.getInsulationColor();
//todo make insulation colors separate for pipes and cables so cover plates have the correct overlay
return holder.getInsulationColor() == IPipeTile.DEFAULT_INSULATION_COLOR ? IPipeTile.DEFAULT_INSULATION_COLOR : holder.getInsulationColor();
}

@Override
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ public static class GT5U {

@Config.Comment("Whether or not to use polymers instead of rare metals for Carbon Fibers. REMOVES THE CHANCED OUTPUT! Default: false")
public boolean polymerCarbonFiber = false;

@Config.Comment("The default color to overlay onto machines. \n16777215 (0xFFFFFF in decimal) is no coloring (default), and 13819135 (0xD2DCFF in decimal) is the classic blue from GT5.")
@Config.Name("Default Machine Color")
@Config.RequiresMcRestart
public int defaultPaintingColor = 0xFFFFFF;

@Config.Comment("The default color to overlay onto machines. \n7829367 (0x777777 in decimal) is no coloring (default), and 4210752 (0x404040 in decimal) is the classic black from GT5.")
@Config.Name("Default Cable Color")
@Config.RequiresMcRestart
public int defaultInsulationColor = 0x777777;
}

public static class GT6 {
Expand Down

0 comments on commit 23f9c5d

Please sign in to comment.