Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
portlek committed Jul 16, 2024
1 parent a59a820 commit d7e923d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/src/main/java/net/infumia/pack/GlyphImageImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d7e923d

Please sign in to comment.