diff --git a/common/src/main/java/net/infumia/pack/GlyphImageImpl.java b/common/src/main/java/net/infumia/pack/GlyphImageImpl.java index cdb0676..9bee8b1 100644 --- a/common/src/main/java/net/infumia/pack/GlyphImageImpl.java +++ b/common/src/main/java/net/infumia/pack/GlyphImageImpl.java @@ -46,11 +46,11 @@ public boolean produced() { @Override public void produce(final ArbitraryCharacterFactory characterFactory) throws ResourceAlreadyProducedException { - if (this.fontProviders != null) { + if (this.fontProviders != null || this.character != null) { throw new ResourceAlreadyProducedException(); } - final BitMapFontProvider.Builder fontProviderBuilder = FontProvider.bitMap(); this.character = characterFactory.create(); + final BitMapFontProvider.Builder fontProviderBuilder = FontProvider.bitMap(); fontProviderBuilder.characters(String.valueOf(this.character)); fontProviderBuilder.file(this.texture.key()); fontProviderBuilder.ascent(this.properties.ascent()); @@ -94,7 +94,7 @@ public int width() { @Override public char character() throws ResourceNotProducedException { - if (this.fontProviders == null) { + if (this.character == null) { throw new ResourceNotProducedException(); } return this.character;