Another small fix & optimisation
This commit is contained in:
parent
47655f9a01
commit
3de67d42b3
1 changed files with 3 additions and 9 deletions
|
@ -29,7 +29,7 @@ public class SimpleReloadableResourceManagerMixin {
|
||||||
@Shadow
|
@Shadow
|
||||||
private Map<String, FallbackResourceManager> namespacedPacks;
|
private Map<String, FallbackResourceManager> namespacedPacks;
|
||||||
|
|
||||||
private Resource bclib_alphaEmissionMaterial;
|
private ResourceLocation bclib_alphaEmissionMaterial = BCLib.makeID("materialmaps/block/alpha_emission.json");
|
||||||
|
|
||||||
@Inject(method = "getResource", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "getResource", at = @At("HEAD"), cancellable = true)
|
||||||
private void bclib_getResource(ResourceLocation resourceLocation, CallbackInfoReturnable<Resource> info) throws IOException {
|
private void bclib_getResource(ResourceLocation resourceLocation, CallbackInfoReturnable<Resource> info) throws IOException {
|
||||||
|
@ -51,14 +51,8 @@ public class SimpleReloadableResourceManagerMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceManager resourceManager = this.namespacedPacks.get(resourceLocation.getNamespace());
|
ResourceManager resourceManager = this.namespacedPacks.get(resourceLocation.getNamespace());
|
||||||
if (resourceManager != null) {
|
if (resourceManager != null && !resourceManager.hasResource(resourceLocation)) {
|
||||||
Resource resource = resourceManager.getResource(resourceLocation);
|
info.setReturnValue(resourceManager.getResource(bclib_alphaEmissionMaterial));
|
||||||
if (resource != null) {
|
|
||||||
info.setReturnValue(resource);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resourceLocation = BCLib.makeID("materialmaps/block/alpha_emission.json");
|
|
||||||
info.setReturnValue(resourceManager.getResource(resourceLocation));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue