mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-10 14:27:08 +01:00
26 lines
739 B
Java
26 lines
739 B
Java
|
package com.simibubi.create.foundation;
|
||
|
|
||
|
import java.nio.file.Path;
|
||
|
|
||
|
import net.minecraftforge.forgespi.locating.IModFile;
|
||
|
import net.minecraftforge.resource.PathResourcePack;
|
||
|
|
||
|
public class ModFilePackResources extends PathResourcePack {
|
||
|
protected final IModFile modFile;
|
||
|
protected final String sourcePath;
|
||
|
|
||
|
public ModFilePackResources(String name, IModFile modFile, String sourcePath) {
|
||
|
super(name, modFile.findResource(sourcePath));
|
||
|
this.modFile = modFile;
|
||
|
this.sourcePath = sourcePath;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected Path resolve(String... paths) {
|
||
|
String[] allPaths = new String[paths.length + 1];
|
||
|
allPaths[0] = sourcePath;
|
||
|
System.arraycopy(paths, 0, allPaths, 1, paths.length);
|
||
|
return modFile.findResource(allPaths);
|
||
|
}
|
||
|
}
|