diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java b/src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java new file mode 100644 index 00000000..388fd4f6 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java @@ -0,0 +1,38 @@ +package io.github.moulberry.notenoughupdates.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.util.ResourceLocation; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +public class NEUResourceManager implements IResourceManager { + + private IResourceManager parentResourceManager; + + public NEUResourceManager(IResourceManager parentResourceManager) { + this.parentResourceManager = parentResourceManager; + } + + @Override + public Set<String> getResourceDomains() { + return parentResourceManager.getResourceDomains(); + } + + @Override + public IResource getResource(ResourceLocation location) throws IOException { + return parentResourceManager.getResource(forceNeuRL(location)); + } + + @Override + public List<IResource> getAllResources(ResourceLocation location) throws IOException { + return parentResourceManager.getAllResources(forceNeuRL(location)); + } + + private ResourceLocation forceNeuRL(ResourceLocation location) { + return new ResourceLocation("notenoughupdates", location.getResourcePath()); + } +} |
