From d7e923d3a0e37246381e78ac35f91f83159f8bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Demirta=C5=9F?= Date: Tue, 16 Jul 2024 18:25:42 +0300 Subject: [PATCH] fix. --- common/src/main/java/net/infumia/pack/GlyphImageImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;