Custom colors, swamp colors, smooth biomes

This commit is contained in:
PeytonPlayz595 2024-04-14 20:36:32 -04:00
parent 77c5c24a18
commit 8118c4fca3
16 changed files with 354 additions and 96 deletions

View File

@ -1458,4 +1458,90 @@ public class CustomColors {
boolean isColorConstant();
}
public static int getColorMultiplier(BakedQuad p_getColorMultiplier_0_, Block p_getColorMultiplier_1_, IBlockAccess p_getColorMultiplier_2_, BlockPos p_getColorMultiplier_3_, RenderEnv p_getColorMultiplier_4_) {
if (blockColormaps != null) {
IBlockState iblockstate = p_getColorMultiplier_4_.getBlockState();
if (!p_getColorMultiplier_0_.hasTintIndex()) {
if (p_getColorMultiplier_1_ == Blocks.grass) {
iblockstate = BLOCK_STATE_DIRT;
}
if (p_getColorMultiplier_1_ == Blocks.redstone_wire) {
return -1;
}
}
if (p_getColorMultiplier_1_ == Blocks.double_plant && p_getColorMultiplier_4_.getMetadata() >= 8) {
p_getColorMultiplier_3_ = p_getColorMultiplier_3_.down();
iblockstate = p_getColorMultiplier_2_.getBlockState(p_getColorMultiplier_3_);
}
CustomColormap customcolormap = getBlockColormap(iblockstate);
if (customcolormap != null) {
if (Config.isSmoothBiomes() && !customcolormap.isColorConstant()) {
return getSmoothColorMultiplier(iblockstate, p_getColorMultiplier_2_, p_getColorMultiplier_3_, customcolormap, p_getColorMultiplier_4_.getColorizerBlockPosM());
}
return customcolormap.getColor(p_getColorMultiplier_2_, p_getColorMultiplier_3_);
}
}
if (!p_getColorMultiplier_0_.hasTintIndex()) {
return -1;
} else if (p_getColorMultiplier_1_ == Blocks.waterlily) {
return getLilypadColorMultiplier(p_getColorMultiplier_2_, p_getColorMultiplier_3_);
} else if (p_getColorMultiplier_1_ == Blocks.redstone_wire) {
return getRedstoneColor(p_getColorMultiplier_4_.getBlockState());
} else if (p_getColorMultiplier_1_ instanceof BlockStem) {
return getStemColorMultiplier(p_getColorMultiplier_1_, p_getColorMultiplier_2_, p_getColorMultiplier_3_, p_getColorMultiplier_4_);
} else if (useDefaultGrassFoliageColors) {
return -1;
} else {
int i = p_getColorMultiplier_4_.getMetadata();
CustomColors.IColorizer customcolors$icolorizer;
IBlockState iblockstate = p_getColorMultiplier_4_.getBlockState();
if (p_getColorMultiplier_1_ != Blocks.grass && p_getColorMultiplier_1_ != Blocks.tallgrass && p_getColorMultiplier_1_ != Blocks.double_plant) {
if (p_getColorMultiplier_1_ == Blocks.double_plant) {
customcolors$icolorizer = COLORIZER_GRASS;
if (i >= 8) {
p_getColorMultiplier_3_ = p_getColorMultiplier_3_.down();
}
} else if (p_getColorMultiplier_1_ == Blocks.leaves) {
switch (i & 3) {
case 0:
customcolors$icolorizer = COLORIZER_FOLIAGE;
break;
case 1:
customcolors$icolorizer = COLORIZER_FOLIAGE_PINE;
break;
case 2:
customcolors$icolorizer = COLORIZER_FOLIAGE_BIRCH;
break;
default:
customcolors$icolorizer = COLORIZER_FOLIAGE;
}
} else if (p_getColorMultiplier_1_ == Blocks.leaves2) {
customcolors$icolorizer = COLORIZER_FOLIAGE;
} else {
if (p_getColorMultiplier_1_ != Blocks.vine) {
return -1;
}
customcolors$icolorizer = COLORIZER_FOLIAGE;
}
} else {
customcolors$icolorizer = COLORIZER_GRASS;
}
return Config.isSmoothBiomes() && !customcolors$icolorizer.isColorConstant() ? getSmoothColorMultiplier(iblockstate, p_getColorMultiplier_2_, p_getColorMultiplier_3_, customcolors$icolorizer, p_getColorMultiplier_4_.getColorizerBlockPosM()) : customcolors$icolorizer.getColor(iblockstate, p_getColorMultiplier_2_, p_getColorMultiplier_3_);
}
}
}

View File

@ -27,7 +27,7 @@ public class RenderEnv {
private boolean[] borderFlags = null;
private static ThreadLocal threadLocalInstance = new ThreadLocal();
private RenderEnv(IBlockAccess p_i94_1_, IBlockState p_i94_2_, BlockPos p_i94_3_) {
public RenderEnv(IBlockState p_i94_2_, BlockPos p_i94_3_) {
this.blockState = p_i94_2_;
this.blockPos = p_i94_3_;
this.gameSettings = Config.getGameSettings();
@ -37,7 +37,7 @@ public class RenderEnv {
RenderEnv renderenv = (RenderEnv)threadLocalInstance.get();
if (renderenv == null) {
renderenv = new RenderEnv(p_getInstance_0_, p_getInstance_1_, p_getInstance_2_);
renderenv = new RenderEnv(p_getInstance_1_, p_getInstance_2_);
threadLocalInstance.set(renderenv);
return renderenv;
} else {

View File

@ -97,6 +97,7 @@ public class TextureUtils {
update();
BetterGrass.update();
BetterSnow.update();
CustomColors.update();
CustomSky.update();
CustomItems.updateModels();
//SmartLeaves.updateLeavesModels();

View File

@ -7,12 +7,15 @@ import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import net.PeytonPlayz585.shadow.RenderEnv;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformBufferFunctions;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.vector.Vector3f;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
/**
@ -47,6 +50,8 @@ public class WorldRenderer {
private FloatBuffer floatBuffer;
private boolean hasBeenFreed = false;
public RenderEnv renderEnv = null;
public WorldRenderer(int bufferSizeIn) {
this.byteBuffer = GLAllocation.createDirectByteBuffer(bufferSizeIn << 2);
@ -556,4 +561,14 @@ public class WorldRenderer {
return this.stateVertexFormat;
}
}
public RenderEnv getRenderEnv(IBlockState p_getRenderEnv_1_, BlockPos p_getRenderEnv_2_) {
if (this.renderEnv == null) {
this.renderEnv = new RenderEnv(p_getRenderEnv_1_, p_getRenderEnv_2_);
return this.renderEnv;
} else {
this.renderEnv.reset(p_getRenderEnv_1_, p_getRenderEnv_2_);
return this.renderEnv;
}
}
}

View File

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Properties;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.FontUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
@ -395,6 +396,11 @@ public class FontRenderer implements IResourceManagerReloadListener {
}
int j1 = this.colorCode[i1];
if (Config.isCustomColors()) {
j1 = CustomColors.getTextColor(i1, j1);
}
this.textColor = j1;
GlStateManager.color((float) (j1 >> 16) / 255.0F, (float) (j1 >> 8 & 255) / 255.0F,
(float) (j1 & 255) / 255.0F, this.alpha);
@ -882,6 +888,18 @@ public class FontRenderer implements IResourceManagerReloadListener {
}
public int getColorCode(char character) {
return this.colorCode["0123456789abcdef".indexOf(character)];
}
int i = "0123456789abcdef".indexOf(character);
if (i >= 0 && i < this.colorCode.length) {
int j = this.colorCode[i];
if (Config.isCustomColors()) {
j = CustomColors.getTextColor(i, j);
}
return j;
} else {
return 16777215;
}
}
}

View File

@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.Collection;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
@ -386,6 +387,11 @@ public class GuiIngame extends Gui {
if (this.mc.thePlayer.experienceLevel > 0) {
this.mc.mcProfiler.startSection("expLevel");
int i1 = 8453920;
if (Config.isCustomColors()) {
i1 = CustomColors.getExpBarTextColor(i1);
}
String s = "" + this.mc.thePlayer.experienceLevel;
int j1 = (parScaledResolution.getScaledWidth() - this.getFontRenderer().getStringWidth(s)) / 2;
int l = parScaledResolution.getScaledHeight() - 31 - 4;

View File

@ -1,5 +1,7 @@
package net.minecraft.client.renderer;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.RenderEnv;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.BlockVertexIDs;
@ -60,7 +62,8 @@ public class BlockFluidRenderer {
boolean realistic = !lava && DeferredStateManager.isRenderingRealisticWater();
blockliquid.setBlockBoundsBasedOnState(blockAccess, blockPosIn);
EaglerTextureAtlasSprite[] atextureatlassprite = lava ? this.atlasSpritesLava : this.atlasSpritesWater;
int i = blockliquid.colorMultiplier(blockAccess, blockPosIn);
RenderEnv renderenv = worldRendererIn.getRenderEnv(blockStateIn, blockPosIn);
int i = CustomColors.getFluidColor(blockAccess, blockStateIn, blockPosIn, renderenv);
float f = (float) (i >> 16 & 255) / 255.0F;
float f1 = (float) (i >> 8 & 255) / 255.0F;
float f2 = (float) (i & 255) / 255.0F;

View File

@ -6,6 +6,7 @@ import java.util.List;
import net.PeytonPlayz585.shadow.BetterGrass;
import net.PeytonPlayz585.shadow.BetterSnow;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.RenderEnv;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -105,7 +106,7 @@ public class BlockModelRenderer {
list = BetterGrass.getFaceQuads(blockAccessIn, blockIn, blockPosIn, enumfacing, list);
}
this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list, afloat, bitset, blockmodelrenderer$ambientocclusionface, RenderEnv.getInstance(blockAccessIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn));
flag = true;
}
}
@ -114,7 +115,7 @@ public class BlockModelRenderer {
List list1 = modelIn.getGeneralQuads();
if (list1.size() > 0) {
this.renderModelAmbientOcclusionQuads(blockAccessIn, blockIn, blockPosIn, worldRendererIn, list1, afloat,
bitset, blockmodelrenderer$ambientocclusionface);
bitset, blockmodelrenderer$ambientocclusionface, RenderEnv.getInstance(blockAccessIn, blockAccessIn.getBlockState(blockPosIn), blockPosIn));
flag = true;
}
@ -176,7 +177,7 @@ public class BlockModelRenderer {
private void renderModelAmbientOcclusionQuads(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn,
WorldRenderer worldRendererIn, List<BakedQuad> listQuadsIn, float[] quadBounds, BitSet boundsFlags,
BlockModelRenderer.AmbientOcclusionFace aoFaceIn) {
BlockModelRenderer.AmbientOcclusionFace aoFaceIn, RenderEnv renderenv) {
boolean isDeferred = DeferredStateManager.isDeferredRenderer();
double d0 = (double) blockPosIn.getX();
double d1 = (double) blockPosIn.getY();
@ -191,42 +192,41 @@ public class BlockModelRenderer {
}
}
for (int i = 0, l = listQuadsIn.size(); i < l; ++i) {
BakedQuad bakedquad = listQuadsIn.get(i);
for (BakedQuad bakedquad : listQuadsIn) {
int[] vertData = isDeferred ? bakedquad.getVertexDataWithNormals() : bakedquad.getVertexData();
this.fillQuadBounds(blockIn, vertData, bakedquad.getFace(), quadBounds, boundsFlags, isDeferred ? 8 : 7);
aoFaceIn.updateVertexBrightness(blockAccessIn, blockIn, blockPosIn, bakedquad.getFace(), quadBounds,
boundsFlags);
worldRendererIn.addVertexData(vertData);
worldRendererIn.putBrightness4(aoFaceIn.vertexBrightness[0], aoFaceIn.vertexBrightness[1],
aoFaceIn.vertexBrightness[2], aoFaceIn.vertexBrightness[3]);
if (bakedquad.hasTintIndex()) {
int j = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable) {
j = TextureUtil.anaglyphColor(j);
}
worldRendererIn.putBrightness4(aoFaceIn.vertexBrightness[0], aoFaceIn.vertexBrightness[1], aoFaceIn.vertexBrightness[2], aoFaceIn.vertexBrightness[3]);
int k = CustomColors.getColorMultiplier(bakedquad, blockIn, blockAccessIn, blockPosIn, renderenv);
if (!bakedquad.hasTintIndex() && k == -1) {
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0], 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1], 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2], 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3], 1);
} else {
int j;
float f = (float) (j >> 16 & 255) / 255.0F;
float f1 = (float) (j >> 8 & 255) / 255.0F;
float f2 = (float) (j & 255) / 255.0F;
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0] * f,
aoFaceIn.vertexColorMultiplier[0] * f1, aoFaceIn.vertexColorMultiplier[0] * f2, 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1] * f,
aoFaceIn.vertexColorMultiplier[1] * f1, aoFaceIn.vertexColorMultiplier[1] * f2, 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2] * f,
aoFaceIn.vertexColorMultiplier[2] * f1, aoFaceIn.vertexColorMultiplier[2] * f2, 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3] * f,
aoFaceIn.vertexColorMultiplier[3] * f1, aoFaceIn.vertexColorMultiplier[3] * f2, 1);
} else {
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0], aoFaceIn.vertexColorMultiplier[0],
aoFaceIn.vertexColorMultiplier[0], 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1], aoFaceIn.vertexColorMultiplier[1],
aoFaceIn.vertexColorMultiplier[1], 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2], aoFaceIn.vertexColorMultiplier[2],
aoFaceIn.vertexColorMultiplier[2], 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3], aoFaceIn.vertexColorMultiplier[3],
aoFaceIn.vertexColorMultiplier[3], 1);
}
if (k != -1) {
j = k;
} else {
j = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex());
}
if (EntityRenderer.anaglyphEnable) {
j = TextureUtil.anaglyphColor(j);
}
float f = (float)(j >> 16 & 255) / 255.0F;
float f1 = (float)(j >> 8 & 255) / 255.0F;
float f2 = (float)(j & 255) / 255.0F;
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[0] * f, aoFaceIn.vertexColorMultiplier[0] * f1, aoFaceIn.vertexColorMultiplier[0] * f2, 4);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[1] * f, aoFaceIn.vertexColorMultiplier[1] * f1, aoFaceIn.vertexColorMultiplier[1] * f2, 3);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[2] * f, aoFaceIn.vertexColorMultiplier[2] * f1, aoFaceIn.vertexColorMultiplier[2] * f2, 2);
worldRendererIn.putColorMultiplier(aoFaceIn.vertexColorMultiplier[3] * f, aoFaceIn.vertexColorMultiplier[3] * f1, aoFaceIn.vertexColorMultiplier[3] * f2, 1);
}
worldRendererIn.putPosition(d0, d1, d2);
}

View File

@ -14,6 +14,7 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.DebugChunkRenderer;
import net.PeytonPlayz585.shadow.Lagometer;
import net.PeytonPlayz585.shadow.TextureUtils;
@ -788,6 +789,14 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.mc.mcProfiler.startSection("lightTex");
WorldClient worldclient = this.mc.theWorld;
if (worldclient != null) {
if (Config.isCustomColors() && CustomColors.updateLightmap(worldclient, this.torchFlickerX, this.lightmapColors, this.mc.thePlayer.isPotionActive(Potion.nightVision), partialTicks)) {
this.lightmapTexture.updateDynamicTexture();
this.lightmapUpdateNeeded = false;
this.mc.mcProfiler.endSection();
return;
}
float f = worldclient.getSunBrightness(1.0F);
float f1 = f * 0.95F + 0.05F;
@ -1671,10 +1680,12 @@ public class EntityRenderer implements IResourceManagerReloadListener {
float f = 0.25F + 0.75F * (float) this.mc.gameSettings.renderDistanceChunks / 32.0F;
f = 1.0F - (float) Math.pow((double) f, 0.25D);
Vec3 vec3 = worldclient.getSkyColor(this.mc.getRenderViewEntity(), partialTicks);
vec3 = CustomColors.getWorldSkyColor(vec3, worldclient, this.mc.getRenderViewEntity(), partialTicks);
float f1 = (float) vec3.xCoord;
float f2 = (float) vec3.yCoord;
float f3 = (float) vec3.zCoord;
Vec3 vec31 = worldclient.getFogColor(partialTicks);
vec31 = CustomColors.getWorldFogColor(vec31, worldclient, this.mc.getRenderViewEntity(), partialTicks);
this.fogColorRed = (float) vec31.xCoord;
this.fogColorGreen = (float) vec31.yCoord;
this.fogColorBlue = (float) vec31.zCoord;
@ -1736,10 +1747,24 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.fogColorRed = 0.02F + f12;
this.fogColorGreen = 0.02F + f12;
this.fogColorBlue = 0.2F + f12;
Vec3 vec35 = CustomColors.getUnderwaterColor(this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ);
if (vec35 != null) {
this.fogColorRed = (float)vec35.xCoord;
this.fogColorGreen = (float)vec35.yCoord;
this.fogColorBlue = (float)vec35.zCoord;
}
} else if (block.getMaterial() == Material.lava) {
this.fogColorRed = 0.6F;
this.fogColorGreen = 0.1F;
this.fogColorBlue = 0.0F;
Vec3 vec34 = CustomColors.getUnderlavaColor(this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ);
if (vec34 != null) {
this.fogColorRed = (float)vec34.xCoord;
this.fogColorGreen = (float)vec34.yCoord;
this.fogColorBlue = (float)vec34.zCoord;
}
}
float f13 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * partialTicks;

View File

@ -10,9 +10,11 @@ import java.util.List;
import java.util.Map;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.CustomSky;
import net.PeytonPlayz585.shadow.DynamicLights;
import net.PeytonPlayz585.shadow.Lagometer;
import net.PeytonPlayz585.shadow.RenderEnv;
import net.PeytonPlayz585.shadow.experimental.VisGraphExperimental;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.HString;
@ -187,6 +189,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
private double prevRenderSortY;
private double prevRenderSortZ;
boolean displayListEntitiesDirty = true;
private RenderEnv renderEnv = new RenderEnv(Blocks.air.getDefaultState(), new BlockPos(0, 0, 0));
public RenderGlobal(Minecraft mcIn) {
this.mc = mcIn;
@ -377,6 +380,8 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
DynamicLights.clear();
}
this.renderEnv.reset((IBlockState)null, (BlockPos)null);
if (worldClientIn != null) {
worldClientIn.addWorldAccess(this);
this.loadRenderers();
@ -1333,12 +1338,24 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
}
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(0.0D, 0.0D).color(40, 40, 40, 255).endVertex();
worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(0.0D, 16.0D).color(40, 40, 40, 255).endVertex();
worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(16.0D, 16.0D).color(40, 40, 40, 255).endVertex();
worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(16.0D, 0.0D).color(40, 40, 40, 255).endVertex();
tessellator.draw();
GlStateManager.popMatrix();
int j = 40;
int k = 40;
int l = 40;
if (Config.isCustomColors()) {
Vec3 vec3 = new Vec3((double)j / 255.0D, (double)k / 255.0D, (double)l / 255.0D);
vec3 = CustomColors.getWorldSkyColor(vec3, this.theWorld, this.mc.getRenderViewEntity(), 0.0F);
j = (int)(vec3.xCoord * 255.0D);
k = (int)(vec3.yCoord * 255.0D);
l = (int)(vec3.zCoord * 255.0D);
}
worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(0.0D, 0.0D).color(j, k, l, 255).endVertex();
worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(0.0D, 16.0D).color(j, k, l, 255).endVertex();
worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(16.0D, 16.0D).color(j, k, l, 255).endVertex();
worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(16.0D, 0.0D).color(j, k, l, 255).endVertex();
tessellator.draw();
GlStateManager.popMatrix();
}
GlStateManager.depthMask(true);
@ -1353,6 +1370,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
} else if (this.mc.theWorld.provider.isSurfaceWorld()) {
GlStateManager.disableTexture2D();
Vec3 vec3 = this.theWorld.getSkyColor(this.mc.getRenderViewEntity(), partialTicks);
vec3 = CustomColors.getSkyColor(vec3, this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ);
float f = (float) vec3.xCoord;
float f1 = (float) vec3.yCoord;
float f2 = (float) vec3.zCoord;
@ -2337,6 +2355,31 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
return null;
} else {
EntityFX entityfx = this.mc.effectRenderer.spawnEffectParticle(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_);
if (p_174974_1_ == EnumParticleTypes.WATER_BUBBLE.getParticleID()) {
CustomColors.updateWaterFX(entityfx, this.theWorld, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv);
}
if (p_174974_1_ == EnumParticleTypes.WATER_SPLASH.getParticleID()) {
CustomColors.updateWaterFX(entityfx, this.theWorld, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv);
}
if (p_174974_1_ == EnumParticleTypes.WATER_DROP.getParticleID()) {
CustomColors.updateWaterFX(entityfx, this.theWorld, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv);
}
if (p_174974_1_ == EnumParticleTypes.TOWN_AURA.getParticleID()) {
CustomColors.updateMyceliumFX(entityfx);
}
if (p_174974_1_ == EnumParticleTypes.PORTAL.getParticleID()) {
CustomColors.updatePortalFX(entityfx);
}
if (p_174974_1_ == EnumParticleTypes.REDSTONE.getParticleID()) {
CustomColors.updateReddustFX(entityfx, this.theWorld, p_174974_3_, p_174974_5_, p_174974_7_);
}
return entityfx;
}
}

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.concurrent.Callable;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.PeytonPlayz585.shadow.CustomItems;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -309,6 +310,11 @@ public class RenderItem implements IResourceManagerReloadListener {
int k = color;
if (flag && bakedquad.hasTintIndex()) {
k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());
if (Config.isCustomColors()) {
k = CustomColors.getColorFromItemStack(stack, bakedquad.getTintIndex(), k);
}
if (EntityRenderer.anaglyphEnable) {
k = TextureUtil.anaglyphColor(k);
}
@ -512,10 +518,8 @@ public class RenderItem implements IResourceManagerReloadListener {
}
if (stack.isItemDamaged()) {
int j = (int) Math
.round(13.0D - (double) stack.getItemDamage() * 13.0D / (double) stack.getMaxDamage());
int i = (int) Math
.round(255.0D - (double) stack.getItemDamage() * 255.0D / (double) stack.getMaxDamage());
int j1 = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
@ -525,7 +529,20 @@ public class RenderItem implements IResourceManagerReloadListener {
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - i) / 4, 64, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, j, 1, 255 - i, i, 0, 255);
int j = 255 - i;
int k = i;
int l = 0;
if (Config.isCustomColors()) {
int i1 = CustomColors.getDurabilityColor(i);
if (i1 >= 0) {
j = i1 >> 16 & 255;
k = i1 >> 8 & 255;
l = i1 >> 0 & 255;
}
}
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, j1, 1, j, k, l, 255);
GlStateManager.enableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();

View File

@ -1,5 +1,7 @@
package net.minecraft.client.renderer.entity;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -48,49 +50,59 @@ public class RenderXPOrb extends Render<EntityXPOrb> {
* public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityXPOrb entityxporb, double d0, double d1, double d2, float f, float f1) {
GlStateManager.pushMatrix();
GlStateManager.translate((float) d0, (float) d1, (float) d2);
this.bindEntityTexture(entityxporb);
int i = entityxporb.getTextureByXP();
float f2 = (float) (i % 4 * 16 + 0) / 64.0F;
float f3 = (float) (i % 4 * 16 + 16) / 64.0F;
float f4 = (float) (i / 4 * 16 + 0) / 64.0F;
float f5 = (float) (i / 4 * 16 + 16) / 64.0F;
float f6 = 1.0F;
float f7 = 0.5F;
float f8 = 0.25F;
int j = entityxporb.getBrightnessForRender(f1);
int k = j % 65536;
int l = j / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) k / 1.0F, (float) l / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f10 = 255.0F;
float f11 = ((float) entityxporb.xpColor + f1) / 2.0F;
l = (int) ((MathHelper.sin(f11 + 0.0F) + 1.0F) * 0.5F * 255.0F);
boolean flag = true;
int i1 = (int) ((MathHelper.sin(f11 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f9 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
worldrenderer.pos((double) (0.0F - f7), (double) (0.0F - f8), 0.0D).tex((double) f2, (double) f5)
.color(l, 255, i1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (f6 - f7), (double) (0.0F - f8), 0.0D).tex((double) f3, (double) f5)
.color(l, 255, i1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (f6 - f7), (double) (1.0F - f8), 0.0D).tex((double) f3, (double) f4)
.color(l, 255, i1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (0.0F - f7), (double) (1.0F - f8), 0.0D).tex((double) f2, (double) f4)
.color(l, 255, i1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entityxporb, d0, d1, d2, f, f1);
}
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks) {
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindEntityTexture(entity);
int i = entity.getTextureByXP();
float f = (float)(i % 4 * 16 + 0) / 64.0F;
float f1 = (float)(i % 4 * 16 + 16) / 64.0F;
float f2 = (float)(i / 4 * 16 + 0) / 64.0F;
float f3 = (float)(i / 4 * 16 + 16) / 64.0F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
int j = entity.getBrightnessForRender(partialTicks);
int k = j % 65536;
int l = j / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f7 = 255.0F;
float f8 = ((float)entity.xpColor + partialTicks) / 2.0F;
l = (int)((MathHelper.sin(f8 + 0.0F) + 1.0F) * 0.5F * 255.0F);
int i1 = 255;
int j1 = (int)((MathHelper.sin(f8 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
float f9 = 0.3F;
GlStateManager.scale(0.3F, 0.3F, 0.3F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
int k1 = l;
int l1 = 255;
int i2 = j1;
if (Config.isCustomColors()) {
int j2 = CustomColors.getXpOrbColor(f8);
if (j2 >= 0) {
k1 = j2 >> 16 & 255;
l1 = j2 >> 8 & 255;
i2 = j2 >> 0 & 255;
}
}
worldrenderer.pos((double)(0.0F - f5), (double)(0.0F - f6), 0.0D).tex((double)f, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f4 - f5), (double)(0.0F - f6), 0.0D).tex((double)f1, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f4 - f5), (double)(1.0F - f6), 0.0D).tex((double)f1, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer.pos((double)(0.0F - f5), (double)(1.0F - f6), 0.0D).tex((double)f, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
/**+
* Returns the location of an entity's texture. Doesn't seem to

View File

@ -1,5 +1,7 @@
package net.minecraft.client.renderer.entity.layers;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.model.ModelSheep1;
import net.minecraft.client.renderer.entity.RenderSheep;
@ -49,10 +51,21 @@ public class LayerSheepWool implements LayerRenderer<EntitySheep> {
float f7 = ((float) (entitysheep.ticksExisted % 25) + f2) / 25.0F;
float[] afloat1 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(k));
float[] afloat2 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(l));
if (Config.isCustomColors()) {
afloat1 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(k), afloat1);
afloat2 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(l), afloat2);
}
GlStateManager.color(afloat1[0] * (1.0F - f7) + afloat2[0] * f7,
afloat1[1] * (1.0F - f7) + afloat2[1] * f7, afloat1[2] * (1.0F - f7) + afloat2[2] * f7);
} else {
float[] afloat = EntitySheep.func_175513_a(entitysheep.getFleeceColor());
if (Config.isCustomColors()) {
afloat = CustomColors.getSheepColors(entitysheep.getFleeceColor(), afloat);
}
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
}

View File

@ -1,5 +1,7 @@
package net.minecraft.client.renderer.entity.layers;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.renderer.entity.RenderWolf;
import net.minecraft.entity.passive.EntitySheep;
@ -41,6 +43,11 @@ public class LayerWolfCollar implements LayerRenderer<EntityWolf> {
this.wolfRenderer.bindTexture(WOLF_COLLAR);
EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitywolf.getCollarColor().getMetadata());
float[] afloat = EntitySheep.func_175513_a(enumdyecolor);
if (Config.isCustomColors()) {
afloat = CustomColors.getWolfCollarColors(enumdyecolor, afloat);
}
GlStateManager.color(afloat[0], afloat[1], afloat[2]);
this.wolfRenderer.getMainModel().render(entitywolf, f, f1, f2, f3, f4, f5);
}

View File

@ -7,6 +7,8 @@ import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import java.util.List;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
@ -99,7 +101,11 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
GlStateManager.scale(f3, -f3, f3);
EaglercraftGPU.glNormal3f(0.0F, 0.0F, -1.0F * f3);
GlStateManager.depthMask(false);
byte b0 = 0;
int i1 = 0;
if (Config.isCustomColors()) {
i1 = CustomColors.getSignTextColor(i);
}
if (i < 0) {
if (DeferredStateManager.isInDeferredPass()) {
_wglDrawBuffers(_GL_COLOR_ATTACHMENT0);
@ -114,10 +120,10 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
if (j == tileentitysign.lineBeingEdited) {
s = "> " + s + " <";
fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2,
j * 10 - tileentitysign.signText.length * 5, b0);
j * 10 - tileentitysign.signText.length * 5, i1);
} else {
fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2,
j * 10 - tileentitysign.signText.length * 5, b0);
j * 10 - tileentitysign.signText.length * 5, i1);
}
}
}

View File

@ -8,6 +8,8 @@ import java.util.Map;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomColors;
import net.minecraft.util.IntegerCache;
/**+
@ -110,6 +112,10 @@ public class PotionHelper {
for (PotionEffect potioneffect : parCollection) {
if (potioneffect.getIsShowParticles()) {
int j = Potion.potionTypes[potioneffect.getPotionID()].getLiquidColor();
if (Config.isCustomColors()) {
j = CustomColors.getPotionColor(potioneffect.getPotionID(), j);
}
for (int k = 0; k <= potioneffect.getAmplifier(); ++k) {
f += (float) (j >> 16 & 255) / 255.0F;
@ -129,7 +135,7 @@ public class PotionHelper {
return (int) f << 16 | (int) f1 << 8 | (int) f2;
}
} else {
return i;
return Config.isCustomColors() ? CustomColors.getPotionColor(0, i) : i;
}
}