diff --git a/src/main/java/com/minelittlepony/client/MineLittlePony.java b/src/main/java/com/minelittlepony/client/MineLittlePony.java index 90adeb11..d34de43d 100644 --- a/src/main/java/com/minelittlepony/client/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/client/MineLittlePony.java @@ -39,7 +39,7 @@ public class MineLittlePony implements ClientModInitializer { private static MineLittlePony instance; - public static final Logger logger = LogManager.getLogger("MineLittlePony"); + public static final Logger LOGGER = LogManager.getLogger("MineLittlePony"); private PonyManagerImpl ponyManager; private VariatedTextureSupplier variatedTextures; diff --git a/src/main/java/com/minelittlepony/client/PonyDataLoader.java b/src/main/java/com/minelittlepony/client/PonyDataLoader.java index e8737017..6c28e039 100644 --- a/src/main/java/com/minelittlepony/client/PonyDataLoader.java +++ b/src/main/java/com/minelittlepony/client/PonyDataLoader.java @@ -46,7 +46,7 @@ public class PonyDataLoader { try { return res.getMetadata().decode(SERIALIZER); } catch (IOException e) { - MineLittlePony.logger.warn("Unable to read {} metadata", identifier, e); + MineLittlePony.LOGGER.warn("Unable to read {} metadata", identifier, e); } return Optional.empty(); }).map(PonyDataLoader::loaded).orElseGet(() -> { @@ -54,7 +54,7 @@ public class PonyDataLoader { NativeUtil.parseImage(identifier, image -> { callback.accept(new PonyData(image, noSkin)); }, e -> { - MineLittlePony.logger.fatal("Unable to read {} metadata", identifier, e); + MineLittlePony.LOGGER.fatal("Unable to read {} metadata", identifier, e); callback.accept(PonyData.NULL); }); }); diff --git a/src/main/java/com/minelittlepony/client/PonyManagerImpl.java b/src/main/java/com/minelittlepony/client/PonyManagerImpl.java index de03197c..4b68eecd 100644 --- a/src/main/java/com/minelittlepony/client/PonyManagerImpl.java +++ b/src/main/java/com/minelittlepony/client/PonyManagerImpl.java @@ -34,16 +34,16 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe .build(CacheLoader.from(key -> new Pony(key.texture(), PonyDataLoader.parse(key.texture(), key.defaulted())))); private final WeakHashMap playerPonies = new WeakHashMap<>(); - record Key(Identifier texture, @Nullable UUID uuid, boolean defaulted) {} + record Key(Identifier texture, boolean defaulted) {} public PonyManagerImpl(PonyConfig config) { this.config = config; Instance.instance = this; } - private Pony loadPony(Identifier resource, @Nullable UUID uuid, boolean defaulted) { + private Pony loadPony(Identifier resource, boolean defaulted) { try { - return poniesCache.get(new Key(resource, uuid, defaulted)); + return poniesCache.get(new Key(resource, defaulted)); } catch (ExecutionException e) { return new Pony(resource, PonyDataLoader.NULL); } @@ -89,10 +89,10 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe @Override public Pony getPony(@Nullable Identifier resource, @Nullable UUID uuid) { if (resource == null) { - return uuid == null ? loadPony(DefaultSkinHelper.getTexture(), uuid, true) : getBackgroundPony(uuid); + return uuid == null ? loadPony(DefaultSkinHelper.getTexture(), true) : getBackgroundPony(uuid); } - Pony pony = loadPony(resource, uuid, false); + Pony pony = loadPony(resource, false); if (uuid != null && PonyConfig.getInstance().ponyLevel.get() == PonyLevel.PONIES && pony.metadata().race().isHuman()) { return getBackgroundPony(uuid); @@ -103,9 +103,9 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe @Override public Pony getBackgroundPony(@Nullable UUID uuid) { if (config.ponyLevel.get() == PonyLevel.PONIES) { - return loadPony(MineLittlePony.getInstance().getVariatedTextures().get(VariatedTextureSupplier.BACKGROUND_PONIES_POOL, uuid).orElse(DefaultSkinHelper.getSkinTextures(uuid).texture()), uuid, true); + return loadPony(MineLittlePony.getInstance().getVariatedTextures().get(VariatedTextureSupplier.BACKGROUND_PONIES_POOL, uuid).orElse(DefaultSkinHelper.getSkinTextures(uuid).texture()), true); } - return loadPony(DefaultSkinHelper.getSkinTextures(uuid).texture(), uuid, true); + return loadPony(DefaultSkinHelper.getSkinTextures(uuid).texture(), true); } @Nullable @@ -128,7 +128,7 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe } public void clearCache() { - MineLittlePony.logger.info("Turned {} cached ponies into cupcakes.", poniesCache.size()); + MineLittlePony.LOGGER.info("Turned {} cached ponies into cupcakes.", poniesCache.size()); poniesCache.invalidateAll(); } diff --git a/src/main/java/com/minelittlepony/client/VariatedTextureSupplier.java b/src/main/java/com/minelittlepony/client/VariatedTextureSupplier.java index 17446972..e3e5f578 100644 --- a/src/main/java/com/minelittlepony/client/VariatedTextureSupplier.java +++ b/src/main/java/com/minelittlepony/client/VariatedTextureSupplier.java @@ -75,7 +75,7 @@ public class VariatedTextureSupplier implements SimpleSynchronousResourceReloadL public void reloadAll(ResourceManager resourceManager) { textures.clear(); textures.addAll(resourceManager.findResources(id.getPath(), path -> path.getPath().endsWith(".png")).keySet()); - MineLittlePony.logger.info("Detected {} ponies installed at {}.", textures.size(), id); + MineLittlePony.LOGGER.info("Detected {} ponies installed at {}.", textures.size(), id); } static boolean isUser(UUID uuid) { diff --git a/src/main/java/com/minelittlepony/client/compat/hdskins/GuiSkinsMineLP.java b/src/main/java/com/minelittlepony/client/compat/hdskins/GuiSkinsMineLP.java index 00b1c6fc..0079cd9d 100644 --- a/src/main/java/com/minelittlepony/client/compat/hdskins/GuiSkinsMineLP.java +++ b/src/main/java/com/minelittlepony/client/compat/hdskins/GuiSkinsMineLP.java @@ -26,13 +26,13 @@ class GuiSkinsMineLP extends GuiSkins { public GuiSkinsMineLP(Screen parent, SkinServerList servers) { super(parent, servers); chooser.addSkinChangedEventListener(type -> { - MineLittlePony.logger.debug("Invalidating old local skin, checking updated local skin"); + MineLittlePony.LOGGER.debug("Invalidating old local skin, checking updated local skin"); if (type == SkinType.SKIN) { MineLittlePony.getInstance().getManager().removePony(previewer.getLocal().getSkins().get(SkinType.SKIN).getId()); } }); uploader.addSkinLoadedEventListener((type, location, profileTexture) -> { - MineLittlePony.logger.debug("Invalidating old remote skin, checking updated remote skin"); + MineLittlePony.LOGGER.debug("Invalidating old remote skin, checking updated remote skin"); if (type == SkinType.SKIN) { MineLittlePony.getInstance().getManager().removePony(location); }