Create/src/main/java/com/simibubi/create/foundation/ModFilePackResources.java
PepperCode1 82be76d893 JEI building, Gradle building
- Refactor JEI category building
- Fix placard item requirement not checking NBT
- Use AddPackFindersEvent instead of ShippedResourcePacks
- Remove unused config values
- Provide separate resource and data formats in pack.mcmeta
- Compress all images
- Update to latest Flywheel
- Disable jarJar inclusion of Flywheel
- Use ${file.jarVersion} instead of ${version}
- Add workaround for SpongePowered/MixinGradle#38
2022-07-16 01:58:43 -07:00

25 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);
}
}