Fix incorrect lighting of item models (#4493)

This commit is contained in:
Ben Staddon authored and LexManos committed 2017-11-09 14:32:43 -08:00
1 parent 4b3799f460
commit 23ea237f2c
1 file changed
+8 -2
@@ -372,7 +372,7 @@ public final class ItemLayerModel implements IModel
float v1 = 16f * (1f - y1 - dy);
return buildQuad(
format, transform, side.getOpposite(), sprite, tint, // getOpposite is related either to the swapping of V direction, or something else
format, transform, remap(side), sprite, tint,
x0, y0, z0, sprite.getInterpolatedU(u0), sprite.getInterpolatedV(v0),
x1, y1, z0, sprite.getInterpolatedU(u1), sprite.getInterpolatedV(v1),
x1, y1, z1, sprite.getInterpolatedU(u1), sprite.getInterpolatedV(v1),
@@ -380,7 +380,13 @@ public final class ItemLayerModel implements IModel
);
}
private static final BakedQuad buildQuad(
private static EnumFacing remap(EnumFacing side)
{
// getOpposite is related to the swapping of V direction
return side.getAxis() == EnumFacing.Axis.Y ? side.getOpposite() : side;
}
private static BakedQuad buildQuad(
VertexFormat format, Optional<TRSRTransformation> transform, EnumFacing side, TextureAtlasSprite sprite, int tint,
float x0, float y0, float z0, float u0, float v0,
float x1, float y1, float z1, float u1, float v1,