Guard against mods that don't support concurrency on resource packs

Should fix #22
This commit is contained in:
embeddedt 2023-02-19 20:12:49 -05:00
parent 74a727d335
commit 1f1bf4a442
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -54,7 +54,10 @@ public abstract class ModelBakeryMixin {
ResourceLocation blockStateJSON = new ResourceLocation(blockLocation.getNamespace(), "blockstates/" + blockLocation.getPath() + ".json");
List<Resource> blockStates;
try {
blockStates = this.resourceManager.getResources(blockStateJSON);
/* Some mods' custom resource pack implementations don't seem to like concurrency here */
synchronized(this.resourceManager) {
blockStates = this.resourceManager.getResources(blockStateJSON);
}
} catch(IOException e) {
ModernFix.LOGGER.warn("Exception loading blockstate definition: {}: {}", blockLocation, e);
return;