Fix closing font textures that were cached

Fixes #64
This commit is contained in:
embeddedt 2023-04-28 10:51:58 -04:00
parent 006c487b86
commit f85d19340b
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -43,6 +43,11 @@ public abstract class LegacyUnicodeBitmapsProviderMixin {
return image;
}
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/NativeImage;close()V"))
private void skipCloseNativeImage(NativeImage image) {
/* we can't close here, as the image has been stored for use later */
}
@Inject(method = "<init>", at = @At("RETURN"))
private void clearLocation(CallbackInfo ci) {
currentCharIdx = null;