parent
26915c6af4
commit
0a8fbf9114
|
|
@ -78,7 +78,15 @@ public abstract class ModelBakeryMixin {
|
||||||
ModernFix.LOGGER.warn("Preloading JSONs in parallel...");
|
ModernFix.LOGGER.warn("Preloading JSONs in parallel...");
|
||||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||||
useModelCache = false;
|
useModelCache = false;
|
||||||
deserializedModelCache = Minecraft.getInstance().getResourceManager().getAllResourceLocations("models", p -> p.endsWith(".json"))
|
deserializedModelCache = Minecraft.getInstance().getResourceManager().getAllResourceLocations("models", p -> {
|
||||||
|
if(!p.endsWith(".json"))
|
||||||
|
return false;
|
||||||
|
for(int i = 0; i < p.length(); i++) {
|
||||||
|
if(!ResourceLocation.validatePathChar(p.charAt(i)))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
.parallelStream()
|
.parallelStream()
|
||||||
.map(location -> new ResourceLocation(location.getNamespace(), location.getPath().substring(7, location.getPath().length() - 5)))
|
.map(location -> new ResourceLocation(location.getNamespace(), location.getPath().substring(7, location.getPath().length() - 5)))
|
||||||
.map(location -> Pair.of(location, this.loadModelSafely(location)))
|
.map(location -> Pair.of(location, this.loadModelSafely(location)))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user