diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockGlowRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockGlowRenderer.java index 00503ee0..365127e5 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockGlowRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockGlowRenderer.java @@ -1,5 +1,6 @@ package com.cricketcraft.chisel.client.render; +import com.cricketcraft.chisel.config.Configurations; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -25,7 +26,7 @@ public class BlockGlowRenderer implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GeneralClient.setGLColorFromInt(ItemDye.field_150922_c[metadata]); + GeneralClient.setGLColorFromInt(Configurations.configColors[metadata]); GL11.glDisable(GL11.GL_LIGHTING); Drawing.drawBlock(block, ((BlockCarvableGlow)block).getGlowTexture(), renderer); GL11.glEnable(GL11.GL_LIGHTING); @@ -36,7 +37,7 @@ public class BlockGlowRenderer implements ISimpleBlockRenderingHandler { @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - Tessellator.instance.setColorOpaque_I(ItemDye.field_150922_c[world.getBlockMetadata(x, y, z)]); + Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]); Tessellator.instance.setBrightness(0xF000F0); Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture()); renderer.renderStandardBlock(block, x, y, z); diff --git a/src/main/java/com/cricketcraft/chisel/config/Configurations.java b/src/main/java/com/cricketcraft/chisel/config/Configurations.java index 2cec134d..76c812c5 100644 --- a/src/main/java/com/cricketcraft/chisel/config/Configurations.java +++ b/src/main/java/com/cricketcraft/chisel/config/Configurations.java @@ -1,6 +1,8 @@ package com.cricketcraft.chisel.config; +import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.Features; +import net.minecraft.item.ItemDye; import net.minecraftforge.common.config.Configuration; import org.apache.commons.lang3.StringUtils; @@ -47,6 +49,8 @@ public class Configurations { public static String getRoadLineTool; public static int roadLineToolLevel; + public static int[] configColors = new int[ItemDye.field_150923_a.length]; + public static boolean refreshConfig() { String category; @@ -63,8 +67,7 @@ public class Configurations { enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true); chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); chiselBackToVanillaLeaves = config.get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.") - .getBoolean( - false); + .getBoolean(false); /* worldgen */ category = "worldgen"; @@ -103,6 +106,21 @@ public class Configurations { "The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0") .getInt(); + /* hexColors */ + category = "hexColors"; + + for(int i = 0; i < ItemDye.field_150923_a.length; i++) { + // tterrag... don't kill me over this formatting. + String temp = config.get(category, "hex" + ItemDye.field_150923_a[i], "#" + Integer.toHexString(ItemDye.field_150922_c[i]), Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1) + " color for hex block overlay #RRGGBB").getString(); + // Or this + try { + configColors[i] = Integer.decode(temp); + } catch (NumberFormatException e) { + Chisel.logger.warn("Configuration error, " + temp + " was not recognized as a color. Using default: #" + Integer.toHexString(ItemDye.field_150922_c[i])); + configColors[i] = ItemDye.field_150922_c[i]; + } + } + if (config.hasChanged()) { config.save(); }