diff --git a/gradle.properties b/gradle.properties index b692dd2aa4..1b09f08236 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,9 +9,9 @@ loom.platform = forge forge_version=47.1.84 # Mod Properties - mod_version = 1.6.13 + mod_version = 1.6.15 maven_group = net.coderbot archives_base_name = oculus # Dependencies - embeddium_version=0.2.14-git.dbe9f77+mc1.20.1 + embeddium_version=0.3.0-git.a736e41+mc1.20.1 diff --git a/src/main/java/net/coderbot/iris/gui/OldImageButton.java b/src/main/java/net/coderbot/iris/gui/OldImageButton.java index f95ae5cf88..77207abc44 100644 --- a/src/main/java/net/coderbot/iris/gui/OldImageButton.java +++ b/src/main/java/net/coderbot/iris/gui/OldImageButton.java @@ -1,14 +1,14 @@ package net.coderbot.iris.gui; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -@Environment(EnvType.CLIENT) +@OnlyIn(Dist.CLIENT) public class OldImageButton extends Button { protected final ResourceLocation resourceLocation; protected final int xTexStart; diff --git a/src/main/java/net/coderbot/iris/mixin/MixinOptions_Entrypoint.java b/src/main/java/net/coderbot/iris/mixin/MixinOptions_Entrypoint.java index e375340ed0..f052f82dc4 100644 --- a/src/main/java/net/coderbot/iris/mixin/MixinOptions_Entrypoint.java +++ b/src/main/java/net/coderbot/iris/mixin/MixinOptions_Entrypoint.java @@ -1,13 +1,8 @@ package net.coderbot.iris.mixin; import net.coderbot.iris.Iris; -import net.minecraft.client.KeyMapping; import net.minecraft.client.Options; -import org.apache.commons.lang3.ArrayUtils; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -25,6 +20,6 @@ public class MixinOptions_Entrypoint { } iris$initialized = true; - new Iris().onEarlyInitialize(); + Iris.onEarlyInitialize(); } } diff --git a/src/main/java/net/coderbot/iris/pipeline/newshader/ExtendedShader.java b/src/main/java/net/coderbot/iris/pipeline/newshader/ExtendedShader.java index f034e35145..79f6b0faae 100644 --- a/src/main/java/net/coderbot/iris/pipeline/newshader/ExtendedShader.java +++ b/src/main/java/net/coderbot/iris/pipeline/newshader/ExtendedShader.java @@ -267,7 +267,7 @@ public String applyImport(boolean bl, String string) { }); factory.getResource(new ResourceLocation(name.getNamespace(), name.getPath() + "_tessControl.tcs")).ifPresent(tessControl -> { try { - this.tessControl = Program.compileShader(IrisProgramTypes.TESS_CONTROL, name, tessControl.open(), tessControl.sourcePackId(), new GlslPreprocessor() { + this.tessControl = Program.compileShader(IrisProgramTypes.TESS_CONTROL, name.getPath(), tessControl.open(), tessControl.sourcePackId(), new GlslPreprocessor() { @Nullable @Override public String applyImport(boolean bl, String string) { @@ -280,7 +280,7 @@ public String applyImport(boolean bl, String string) { }); factory.getResource(new ResourceLocation(name.getNamespace(), name.getPath() + "_tessEval.tes")).ifPresent(tessEval -> { try { - this.tessEval = Program.compileShader(IrisProgramTypes.TESS_EVAL, name, tessEval.open(), tessEval.sourcePackId(), new GlslPreprocessor() { + this.tessEval = Program.compileShader(IrisProgramTypes.TESS_EVAL, name.getPath(), tessEval.open(), tessEval.sourcePackId(), new GlslPreprocessor() { @Nullable @Override public String applyImport(boolean bl, String string) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 6b9c63e9b0..d384479367 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -30,6 +30,6 @@ side = "BOTH" [[dependencies.oculus]] modId = "embeddium" mandatory = false -versionRange = "[0.2.14,)" +versionRange = "[0.3.0,)" ordering = "NONE" side = "CLIENT" \ No newline at end of file diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/EntityVertex.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/EntityVertex.java index b1d133b6b7..581ddda7cf 100644 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/EntityVertex.java +++ b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/entity_xhfp/EntityVertex.java @@ -131,15 +131,21 @@ public static void writeQuadVertices(VertexBufferWriter writer, PoseStack.Pose m // The packed normal vector var n = quad.getForgeNormal(i); - if((n & 0xFFFFFF) == 0) { - n = quad.getNormal(); + float nx, ny, nz; + + if((n & 0xFFFFFF) == 0) { // TODO review + var n0 = quad.getLightFace().step(); + + nx = n0.x; + ny = n0.y; + nz = n0.z; + } else { + // The normal vector + nx = NormI8.unpackX(n); + ny = NormI8.unpackY(n); + nz = NormI8.unpackZ(n); } - // The normal vector - float nx = NormI8.unpackX(n); - float ny = NormI8.unpackY(n); - float nz = NormI8.unpackZ(n); - // The transformed normal vector nxt = MatrixHelper.transformNormalX(matNormal, nx, ny, nz); nyt = MatrixHelper.transformNormalY(matNormal, nx, ny, nz); diff --git a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinCube.java b/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinCube.java deleted file mode 100644 index e62a113b8d..0000000000 --- a/src/sodiumCompatibility/java/net/coderbot/iris/compat/sodium/mixin/fast_render/MixinCube.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.coderbot.iris.compat.sodium.mixin.fast_render; - -import me.jellysquid.mods.sodium.client.model.ModelCuboidAccessor; -import me.jellysquid.mods.sodium.client.render.immediate.model.ModelCuboid; -import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.core.Direction; -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -import java.util.Set; - -@Mixin(ModelPart.Cube.class) -public class MixinCube implements ModelCuboidAccessor { - private ModelCuboid sodium$cuboid; - - @Mutable - @Shadow - @Final - private float minX; - - @Redirect(method = "", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/model/geom/ModelPart$Cube;minX:F", ordinal = 0)) - private void onInit(ModelPart.Cube instance, float value, int u, int v, float x, float y, float z, float sizeX, float sizeY, float sizeZ, float extraX, float extraY, float extraZ, boolean mirror, float textureWidth, float textureHeight, Set renderDirections) { - this.sodium$cuboid = new ModelCuboid(u, v, x, y, z, sizeX, sizeY, sizeZ, extraX, extraY, extraZ, mirror, textureWidth, textureHeight, renderDirections); - - this.minX = value; - } - - @Override - public ModelCuboid sodium$copy() { - return this.sodium$cuboid; - } -}