This commit is contained in:
tterrag1098 committed 2015-02-11 22:04:11 -05:00
commit c3ee02b3f2
3 files changed
+55 -15

No files matched your search

@@ -255,19 +255,40 @@ public class CarvableHelper {
else if (n)
return variation.seamsCtmVert.icons[reverse ? 3 : 2];
return variation.seamsCtmVert.icons[0];
case V9:
case V4:
int index = x + y + z;
if ((side==2)||(side==5))
{
index=-index;
}
while (index < 0)
{
index = index+10000;
case V9:
case V4:
int variationSize = (variation.kind == V9) ? 3 : 2;
int xModulus = x % variationSize;
int zModulus = z % variationSize;
//This ensures that blocks placed near 0,0 or it's axis' do not misbehave
int textureX = (xModulus < 0) ? (xModulus + variationSize) : xModulus;
int textureZ = (zModulus < 0) ? (zModulus + variationSize) : zModulus;
//Always invert the y index
int textureY = (variationSize - (y % variationSize) - 1);
if (side == 2 || side == 5) {
//For WEST, SOUTH reverse the indexes for both X and Z
textureX = (variationSize - textureX - 1);
textureZ = (variationSize - textureZ - 1);
} else if (side == 0) {
//For DOWN, reverse the indexes for only Z
textureZ = (variationSize - textureZ - 1);
}
return variation.variations9.icons[index % ((variation.kind == V9) ? 9 : 4)];
int index;
if (side == 0 || side == 1) {
// DOWN || UP
index = textureX + textureZ * variationSize;
} else if (side == 2 || side == 3) {
// NORTH || SOUTH
index = textureX + textureY * variationSize;
} else {
// WEST || EAST
index = textureZ + textureY * variationSize;
}
return variation.variations9.icons[index];
case CTMX:
return variation.icon;
case R16:
@@ -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);
@@ -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();
}