diff --git a/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java b/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java index 31e2c2dd5..ca7a2e2a5 100644 --- a/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java +++ b/src/main/java/net/minecraftforge/client/model/SimpleModelFontRenderer.java @@ -71,6 +71,7 @@ public abstract class SimpleModelFontRenderer extends FontRenderer { float ht = h / 128f; UnpackedBakedQuad.Builder quadBuilder = new UnpackedBakedQuad.Builder(format); + quadBuilder.setTexture(sprite); quadBuilder.setQuadOrientation(orientation); addVertex(quadBuilder, posX + sh, posY, x, y); @@ -84,6 +85,7 @@ public abstract class SimpleModelFontRenderer extends FontRenderer { float cuv = 15f / 16f; quadBuilder = new UnpackedBakedQuad.Builder(format); + quadBuilder.setTexture(sprite); quadBuilder.setQuadOrientation(orientation); addVertex(quadBuilder, posX + w + sh, posY, cuv, cuv); @@ -93,6 +95,7 @@ public abstract class SimpleModelFontRenderer extends FontRenderer { builder.add(quadBuilder.build()); quadBuilder = new UnpackedBakedQuad.Builder(format); + quadBuilder.setTexture(sprite); quadBuilder.setQuadOrientation(orientation); addVertex(quadBuilder, posX + sh, posY + h, cuv, cuv); diff --git a/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java b/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java index dfd3a58fe..6999c4582 100644 --- a/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java +++ b/src/main/java/net/minecraftforge/client/model/pipeline/UnpackedBakedQuad.java @@ -124,6 +124,7 @@ public class UnpackedBakedQuad extends BakedQuad this.orientation = orientation; } + // FIXME: move (or at least add) into constructor public void setTexture(TextureAtlasSprite texture) { this.texture = texture; @@ -167,6 +168,10 @@ public class UnpackedBakedQuad extends BakedQuad { throw new IllegalStateException("not enough data"); } + if(texture == null) + { + throw new IllegalStateException("texture not set"); + } if(contractUVs) { float tX = texture.getOriginX() / texture.getMinU();