mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
ResourceLocation Utils for doing things..
This commit is contained in:
1 parent
0b26047ea8
commit
558e1d2fb0
1 file changed
+12
@@ -0,0 +1,12 @@
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class ResourceLocationUtils {
|
||||
public static ResourceLocation pathToResourceLocation(Path path, int maxDepth) {
|
||||
return new ResourceLocation(path.getName(0).toString(), Joiner.on("/").join(path.subpath(1, Math.min(maxDepth, path.getNameCount())).iterator()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user