mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix incorrect lighting of item models (#4493)
This commit is contained in:
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,
|
||||
|
||||
Reference in new issue
Block a user