diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-01-07 12:57:35 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-01-07 12:57:35 +0800 |
| commit | cfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6 (patch) | |
| tree | 37195b6df62d8281e236e0fb87e5d9edbd60f625 /src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java | |
| parent | 9ae63509ab33c4d3f0ee19bc618ef4e4c654ef46 (diff) | |
| download | notenoughupdates-cfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6.tar.gz notenoughupdates-cfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6.tar.bz2 notenoughupdates-cfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6.zip | |
PRE4
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()); + } +} |
