mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Allow mods to specify shader import namespace (#9021)
This commit is contained in:
1 parent
6d233ac75c
commit
82026d11a4
8 files changed
+156
No files matched your search
@@ -17,6 +17,7 @@ import com.mojang.datafixers.util.Either;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.FileUtil;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.KeyMapping;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -1155,4 +1156,12 @@ public class ForgeHooksClient
|
||||
Mth.log2(Math.max(1, height))
|
||||
);
|
||||
}
|
||||
|
||||
public static ResourceLocation getShaderImportLocation(String basePath, boolean isRelative, String importPath)
|
||||
{
|
||||
final var loc = new ResourceLocation(importPath);
|
||||
final var normalised = FileUtil.normalizeResourcePath(
|
||||
(isRelative ? basePath : "shaders/include/") + loc.getPath());
|
||||
return new ResourceLocation(loc.getNamespace(), normalised);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user