Removed the uneneccessary parameter. And the unneccessary lamda that caused this confusion

This commit is contained in:
Sollace 2018-07-21 22:49:40 +02:00
parent bbff6ceaab
commit 4c6441e322

View file

@ -102,12 +102,14 @@ public class SkinResourceManager implements IResourceManagerReloadListener {
*/
private void loadSkinResource(@Nullable ResourceLocation res) {
if (res != null) {
inProgress.computeIfAbsent(res, r -> scheduleConvertion(res, r));
if (!inProgress.containsKey(res)) {
inProgress.put(res, scheduleConvertion(res));
}
}
}
private Future<ResourceLocation> scheduleConvertion(ResourceLocation res, ResourceLocation r) {
return CompletableFuture.supplyAsync(new ImageLoader(r), executor).whenComplete((result, error) -> {
private Future<ResourceLocation> scheduleConvertion(ResourceLocation res) {
return CompletableFuture.supplyAsync(new ImageLoader(res), executor).whenComplete((result, error) -> {
if (result == null) {
result = res;
LogManager.getLogger().warn("Errored while processing {}. Using original.", res, error);