diff --git a/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java b/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java index 7d23d4dc7..ca7b14f66 100644 --- a/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java +++ b/src/main/java/net/minecraftforge/client/model/ItemLayerModel.java @@ -224,14 +224,14 @@ public final class ItemLayerModel implements IRetexturableModel } } // front - builder.add(buildQuad(format, transform, EnumFacing.NORTH, tint, + builder.add(buildQuad(format, transform, EnumFacing.NORTH, sprite, tint, 0, 0, 7.5f / 16f, sprite.getMinU(), sprite.getMaxV(), 0, 1, 7.5f / 16f, sprite.getMinU(), sprite.getMinV(), 1, 1, 7.5f / 16f, sprite.getMaxU(), sprite.getMinV(), 1, 0, 7.5f / 16f, sprite.getMaxU(), sprite.getMaxV() )); // back - builder.add(buildQuad(format, transform, EnumFacing.SOUTH, tint, + builder.add(buildQuad(format, transform, EnumFacing.SOUTH, sprite, tint, 0, 0, 8.5f / 16f, sprite.getMinU(), sprite.getMaxV(), 1, 0, 8.5f / 16f, sprite.getMaxU(), sprite.getMaxV(), 1, 1, 8.5f / 16f, sprite.getMaxU(), sprite.getMinV(), @@ -329,7 +329,7 @@ public final class ItemLayerModel implements IRetexturableModel throw new IllegalArgumentException("can't handle z-oriented side"); } return buildQuad( - format, transform, side.getOpposite(), tint, // getOpposite is related either to the swapping of V direction, or something else + format, transform, side.getOpposite(), sprite, tint, // getOpposite is related either to the swapping of V direction, or something else x0, y0, z1, sprite.getInterpolatedU(u0), sprite.getInterpolatedV(v0), x1, y1, z1, sprite.getInterpolatedU(u1), sprite.getInterpolatedV(v1), x1, y1, z2, sprite.getInterpolatedU(u1), sprite.getInterpolatedV(v1), @@ -338,7 +338,7 @@ public final class ItemLayerModel implements IRetexturableModel } private static final BakedQuad buildQuad( - VertexFormat format, Optional transform, EnumFacing side, int tint, + VertexFormat format, Optional 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, float x2, float y2, float z2, float u2, float v2, @@ -347,6 +347,7 @@ public final class ItemLayerModel implements IRetexturableModel UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); builder.setQuadTint(tint); builder.setQuadOrientation(side); + builder.setTexture(sprite); putVertex(builder, format, transform, side, x0, y0, z0, u0, v0); putVertex(builder, format, transform, side, x1, y1, z1, u1, v1); putVertex(builder, format, transform, side, x2, y2, z2, u2, v2); diff --git a/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java b/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java index c9467393c..14746db93 100644 --- a/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java +++ b/src/main/java/net/minecraftforge/client/model/ItemTextureQuadConverter.java @@ -195,10 +195,10 @@ public final class ItemTextureQuadConverter y1 = 1f - y2; y2 = 1f - tmp; - return putQuad(format, transform, facing, color, x1, y1, x2, y2, z, u1, v1, u2, v2); + return putQuad(format, transform, facing, sprite, color, x1, y1, x2, y2, z, u1, v1, u2, v2); } - private static UnpackedBakedQuad putQuad(VertexFormat format, TRSRTransformation transform, EnumFacing side, int color, + private static UnpackedBakedQuad putQuad(VertexFormat format, TRSRTransformation transform, EnumFacing side, TextureAtlasSprite sprite, int color, float x1, float y1, float x2, float y2, float z, float u1, float v1, float u2, float v2) { @@ -206,6 +206,7 @@ public final class ItemTextureQuadConverter UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); builder.setQuadTint(-1); builder.setQuadOrientation(side); + builder.setTexture(sprite); if (side == EnumFacing.NORTH) { diff --git a/src/main/java/net/minecraftforge/client/model/ModelFluid.java b/src/main/java/net/minecraftforge/client/model/ModelFluid.java index be1134a11..50f3774b6 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelFluid.java +++ b/src/main/java/net/minecraftforge/client/model/ModelFluid.java @@ -209,6 +209,7 @@ public final class ModelFluid implements IModelCustomData EnumFacing side = gas ? EnumFacing.DOWN : EnumFacing.UP; UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); builder.setQuadOrientation(side); + builder.setTexture(topSprite); for(int i = gas ? 3 : 0; i != (gas ? -1 : 4); i+= (gas ? -1 : 1)) { putVertex( @@ -224,6 +225,7 @@ public final class ModelFluid implements IModelCustomData side = side.getOpposite(); builder = new UnpackedBakedQuad.Builder(format); builder.setQuadOrientation(side); + builder.setTexture(still); for(int i = gas ? 3 : 0; i != (gas ? -1 : 4); i+= (gas ? -1 : 1)) { putVertex( @@ -245,6 +247,7 @@ public final class ModelFluid implements IModelCustomData { builder = new UnpackedBakedQuad.Builder(format); builder.setQuadOrientation(side); + builder.setTexture(flowing); for(int j = 0; j < 4; j++) { int l = (k * 3) + (1 - 2 * k) * j; @@ -266,6 +269,7 @@ public final class ModelFluid implements IModelCustomData // 1 quad for inventory UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); builder.setQuadOrientation(EnumFacing.UP); + builder.setTexture(still); for(int i = 0; i < 4; i++) { putVertex( diff --git a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java index 34371c50f..6e9cf9071 100644 --- a/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java +++ b/src/main/java/net/minecraftforge/client/model/b3d/B3DLoader.java @@ -723,6 +723,7 @@ public final class B3DLoader implements ICustomModelLoader if(textures == null || textures.isEmpty()) sprite = this.textures.get("missingno"); else if(textures.get(0) == B3DModel.Texture.White) sprite = ModelLoader.White.instance; else sprite = this.textures.get(textures.get(0).getPath()); + quadBuilder.setTexture(sprite); putVertexData(quadBuilder, f.getV1(), f.getNormal(), sprite); putVertexData(quadBuilder, f.getV2(), f.getNormal(), sprite); putVertexData(quadBuilder, f.getV3(), f.getNormal(), sprite); diff --git a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java index fc5306764..585441359 100644 --- a/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java +++ b/src/main/java/net/minecraftforge/client/model/obj/OBJModel.java @@ -1400,6 +1400,7 @@ public class OBJModel implements IRetexturableModel, IModelCustomData } else sprite = this.textures.get(f.getMaterialName()); UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format); builder.setQuadOrientation(EnumFacing.getFacingFromVector(f.getNormal().x, f.getNormal().y, f.getNormal().z)); + builder.setTexture(sprite); Normal faceNormal = f.getNormal(); putVertexData(builder, f.verts[0], faceNormal, TextureCoordinate.getDefaultUVs()[0], sprite); putVertexData(builder, f.verts[1], faceNormal, TextureCoordinate.getDefaultUVs()[1], sprite);