From 4c6441e32290db718361a4862e5baf4800f46483 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 21 Jul 2018 22:49:40 +0200 Subject: [PATCH] Removed the uneneccessary parameter. And the unneccessary lamda that caused this confusion --- .../hdskins/resources/SkinResourceManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/resources/SkinResourceManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/resources/SkinResourceManager.java index 8832ed48..58a48659 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/resources/SkinResourceManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/resources/SkinResourceManager.java @@ -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 scheduleConvertion(ResourceLocation res, ResourceLocation r) { - return CompletableFuture.supplyAsync(new ImageLoader(r), executor).whenComplete((result, error) -> { + private Future 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);