From 347f2b44c13e387fbb0d6a8a46b812aa98c7cbf8 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 2 Nov 2018 14:34:50 +0200 Subject: [PATCH] Fixed background ponies not loading due to different case --- .../minelittlepony/CasedResourceLocation.java | 23 +++++++++++++++++++ .../java/com/minelittlepony/PonyManager.java | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/minelittlepony/CasedResourceLocation.java diff --git a/src/main/java/com/minelittlepony/CasedResourceLocation.java b/src/main/java/com/minelittlepony/CasedResourceLocation.java new file mode 100644 index 00000000..d6915828 --- /dev/null +++ b/src/main/java/com/minelittlepony/CasedResourceLocation.java @@ -0,0 +1,23 @@ +package com.minelittlepony; + +import net.minecraft.util.ResourceLocation; + +public class CasedResourceLocation extends ResourceLocation { + protected final String casedPath; + + public CasedResourceLocation(String domain, String path) { + super(domain, path); + + casedPath = path; + } + + @Override + public String getPath() { + return casedPath; + } + + @Override + public String toString() { + return namespace + ':' + casedPath; + } +} diff --git a/src/main/java/com/minelittlepony/PonyManager.java b/src/main/java/com/minelittlepony/PonyManager.java index a2157af6..ba6e24a9 100644 --- a/src/main/java/com/minelittlepony/PonyManager.java +++ b/src/main/java/com/minelittlepony/PonyManager.java @@ -198,7 +198,7 @@ public class PonyManager implements IResourceManagerReloadListener, ISkinCacheCl } private ResourceLocation apply(String input) { - return new ResourceLocation("minelittlepony", String.format("textures/entity/pony/%s.png", input)); + return new CasedResourceLocation("minelittlepony", String.format("textures/entity/pony/%s.png", input)); } public List getPonies() {