Fixed color disabling not working for forge pipeline. Closes #2286.
This commit is contained in:
parent
56eba05237
commit
09e9a181ee
2 changed files with 15 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||||
@@ -578,6 +578,11 @@
|
@@ -578,6 +578,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,11 @@
|
||||||
+ {
|
+ {
|
||||||
+ this.func_181670_b(field_179011_q.func_177338_f()/* / 4 * 4 */);
|
+ this.func_181670_b(field_179011_q.func_177338_f()/* / 4 * 4 */);
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ public boolean isColorDisabled()
|
||||||
|
+ {
|
||||||
|
+ return field_78939_q;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class State
|
public class State
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
|
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
|
@ -12,6 +13,7 @@ import net.minecraft.util.EnumFacing;
|
||||||
*/
|
*/
|
||||||
public class WorldRendererConsumer implements IVertexConsumer
|
public class WorldRendererConsumer implements IVertexConsumer
|
||||||
{
|
{
|
||||||
|
private static final float[] dummyColor = new float[]{ 1, 1, 1, 1 };
|
||||||
private final WorldRenderer renderer;
|
private final WorldRenderer renderer;
|
||||||
private final int[] quadData;
|
private final int[] quadData;
|
||||||
private int v = 0;
|
private int v = 0;
|
||||||
|
@ -31,8 +33,13 @@ public class WorldRendererConsumer implements IVertexConsumer
|
||||||
|
|
||||||
public void put(int e, float... data)
|
public void put(int e, float... data)
|
||||||
{
|
{
|
||||||
LightUtil.pack(data, quadData, getVertexFormat(), v, e);
|
VertexFormat format = getVertexFormat();
|
||||||
if(e == getVertexFormat().getElementCount() - 1)
|
if(renderer.isColorDisabled() && format.getElement(e).getUsage() == EnumUsage.COLOR)
|
||||||
|
{
|
||||||
|
data = dummyColor;
|
||||||
|
}
|
||||||
|
LightUtil.pack(data, quadData, format, v, e);
|
||||||
|
if(e == format.getElementCount() - 1)
|
||||||
{
|
{
|
||||||
v++;
|
v++;
|
||||||
if(v == 4)
|
if(v == 4)
|
||||||
|
|
Loading…
Reference in a new issue