Fix texture reload failing on second try

This commit is contained in:
embeddedt 2023-05-08 19:17:00 -04:00
parent 9d4d1cc9b4
commit d33ebd69e8
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -85,6 +85,11 @@ public abstract class TextureAtlasMixin {
cir.getReturnValue().addAll(storedResults);
}
@Inject(method = "prepareToStitch", at = @At("HEAD"))
private void initMap(CallbackInfoReturnable<TextureAtlas.Preparations> cir) {
loadedImages = new ConcurrentHashMap<>();
}
@Inject(method = "prepareToStitch", at = @At("RETURN"))
private void clearLoadedImages(CallbackInfoReturnable<TextureAtlas.Preparations> cir) {
loadedImages = Collections.emptyMap();