Common Shaders #14

Merged
embeddedt merged 4 commits from mitchej123/celeritas:forge170-shaders into stonecutter 2025-07-02 19:39:08 -04:00
5 changed files with 15 additions and 13 deletions
Showing only changes of commit 23c1b5846f - Show all commits

No files matched your search

@@ -1,4 +0,0 @@
package net.irisshaders.iris.shadows;
public class ShadowCompositeRenderer extends CommonShadowCompositeRenderer {
}
@@ -17,6 +17,6 @@ public interface MixinDumpable extends MCDumpable {
@Override
default void dumpContents(MCResourceLocation resourceLocation, Path path) throws IOException {
this.dumpContents((ResourceLocation) resourceLocation, path);
this.dumpContents((ResourceLocation) (Object)resourceLocation, path);
}
}
@@ -47,7 +47,7 @@ public class PBRAtlasTexture extends AbstractTexture implements PBRDumpable {
public PBRAtlasTexture(TextureAtlas atlasTexture, PBRType type) {
this.atlasTexture = atlasTexture;
this.type = type;
id = (MCResourceLocation)ResourceLocationUtil.make(atlasTexture.location().getNamespace(), atlasTexture.location().getPath().replace(".png", "") + type.getSuffix() + ".png");
id = (MCResourceLocation)(Object)ResourceLocationUtil.make(atlasTexture.location().getNamespace(), atlasTexture.location().getPath().replace(".png", "") + type.getSuffix() + ".png");
}
public static void syncAnimation(SpriteContents.Ticker source, SpriteContents.Ticker target) {
@@ -90,7 +90,7 @@ public class AtlasPBRLoader implements PBRTextureLoader<TextureAtlas> {
@Nullable
protected PBRTextureAtlasSprite createPBRSprite(TextureAtlasSprite sprite, MCResourceManager resourceManager, TextureAtlas atlas, int atlasWidth, int atlasHeight, int mipLevel, PBRType pbrType) {
MCResourceLocation spriteName = (MCResourceLocation)sprite.contents().name();
MCResourceLocation spriteName = (MCResourceLocation)(Object)sprite.contents().name();
MCResourceLocation pbrImageLocation = getPBRImageLocation(spriteName, pbrType);
Optional<MCResource> optionalResource = resourceManager.getResource(pbrImageLocation);
@@ -175,9 +175,9 @@ public class AtlasPBRLoader implements PBRTextureLoader<TextureAtlas> {
String path = pbrType.appendSuffix(spriteName.getPath());
// Temporary fix for CIT Resewn. CIT Resewn has sprites that are not in the textures/ folder, so a custom check must be used here to avoid that assumption.
if (path.startsWith("optifine/cit/")) {
return (MCResourceLocation) ResourceLocationUtil.make(spriteName.getNamespace(), path + ".png");
return (MCResourceLocation)(Object) ResourceLocationUtil.make(spriteName.getNamespace(), path + ".png");
}
return (MCResourceLocation) ResourceLocationUtil.make(spriteName.getNamespace(), "textures/" + path + ".png");
return (MCResourceLocation)(Object) ResourceLocationUtil.make(spriteName.getNamespace(), "textures/" + path + ".png");
}
protected static class PBRSpriteContents extends SpriteContents implements CustomMipmapGenerator.Provider {
@@ -42,7 +42,13 @@ import net.minecraft.world.level.GameType;
import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.material.FogType;
import net.minecraft.world.phys.Vec3;
import org.embeddedt.embeddium.compat.mc.*;
import org.embeddedt.embeddium.compat.mc.MCAbstractTexture;
import org.embeddedt.embeddium.compat.mc.MCDynamicTexture;
import org.embeddedt.embeddium.compat.mc.MCNativeImage;
import org.embeddedt.embeddium.compat.mc.MCResourceLocation;
import org.embeddedt.embeddium.compat.mc.MCResourceManager;
import org.embeddedt.embeddium.compat.mc.MCTextureManager;
import org.embeddedt.embeddium.compat.mc.MinecraftVersionShimService;
import net.minecraft.client.Minecraft;
import org.embeddedt.embeddium.impl.loader.common.EarlyLoaderServices;
import org.joml.*;
@@ -602,7 +608,7 @@ public class MinecraftModernVersionShimImpl implements MinecraftVersionShimServi
public MCResourceLocation makeResourceLocation(String namespace, String path) {
//? if >=1.21
/*return (IResourceLocation)(Object) ResourceLocation.fromNamespaceAndPath(namespace, path);*/
/*return (MCResourceLocation)(Object) ResourceLocation.fromNamespaceAndPath(namespace, path);*/
//? if <1.21
return (MCResourceLocation)(Object) new ResourceLocation(namespace, path);
}
@@ -610,9 +616,9 @@ public class MinecraftModernVersionShimImpl implements MinecraftVersionShimServi
public MCResourceLocation makeResourceLocation(String str) {
//? if >=1.21 {
/*if(str.contains(":")) {
return (IResourceLocation)(Object) ResourceLocation.parse(str);
return (MCResourceLocation)(Object) ResourceLocation.parse(str);
} else {
return (IResourceLocation)(Object) ResourceLocation.withDefaultNamespace(str);
return (MCResourceLocation)(Object) ResourceLocation.withDefaultNamespace(str);
}
*///?} else
return (MCResourceLocation)(Object)new ResourceLocation(str);