CreativeMD / LittleTiles

GNU Lesser General Public License v3.0
159 stars 52 forks source link

[1.20.1] Crash with Oculus 1.7.0 #968

Closed PolishTorch closed 1 month ago

PolishTorch commented 2 months ago

The crash happened on Forge 47.1.3

List of mods:

  1. CreativeCore 2.11.27
  2. Embeddium 0.3.14
  3. LittleTiles pre-103
  4. Oculus 1.7.0

Steps to replicate:

  1. Run Minecraft with the aforementioned mods
  2. Go to options > video settings > shader packs
  3. Enable shaders and select any shader of your choice (i tested Complementary Unbound 5.1.1 and MakeUp Ultra Fast 8.9d)
  4. Create or open any world
  5. Crash with this message - "The game crashed whilst unexpected error Error: java.lang.NoClassDefFoundError: net/coderbot/iris/compat sodium/impl/vertex_format/IrisChunkMeshAttributes"

Here's the crash report: crash-2024-04-29_14.45.26-client.txt

VOLKOUL commented 2 months ago

Same here! (I made an Oculus report thinking it was it, relevant logs and crash reports can be found there: https://github.com/Asek3/Oculus/issues/610)

CreativeMD commented 1 month ago

Please use the version prior. I will try to fix the incompatibility soon.

nico1972weimar commented 1 month ago

Same here. ATM9 Log https://mclo.gs/LbgFK6s

guskikalola commented 1 month ago

I believe they only changed the import path.

https://github.com/CreativeMD/LittleTiles/blob/5dba4af44a2ee769f84878c135ebf2052775fbe0/src/main/java/team/creative/littletiles/client/mod/oculus/OculusSodiumInteractor.java#L6

Change from coderbot to irisshaders, can't test it now but by inspecting the oculus.1.20.1-1.7.0.jar file that seems to be it.

EDIT: Just tested it, it worked with a little change in the method setMaterialId, adding the new lightValue parameter to the function. I assigned it the default value, which is 0. The following links are related to this lightValue parameter.

https://github.com/IrisShaders/Iris/blob/245d5fb66f2add0811266178b368768c0adf922a/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/impl/block_context/ChunkBuildBuffersExt.java#L8

https://github.com/IrisShaders/Iris/blob/245d5fb66f2add0811266178b368768c0adf922a/src/sodiumCompatibility/java/net/irisshaders/iris/compat/sodium/impl/block_context/BlockContextHolder.java#L23

diff --git a/build.gradle b/build.gradle
index 0ced7832..ea5aa308 100644
--- a/build.gradle
+++ b/build.gradle
@@ -85,7 +85,7 @@ minecraft {
 }

 dependencies {
-    implementation fg.deobf("curse.maven:oculus-581495:5108615")
+    implementation fg.deobf("curse.maven:oculus-581495:5299671")
     implementation fg.deobf("org.embeddedt:embeddium-1.20.1:0.3.9-git.f603a93+mc1.20.1")

     minecraft "net.minecraftforge:forge:${project.property 'minecraft_version'}-${project.property 'forge_version'}"
diff --git a/src/main/java/team/creative/littletiles/client/mod/oculus/OculusInteractor.java b/src/main/java/team/creative/littletiles/client/mod/oculus/OculusInteractor.java
index 750c7e5e..db7a87e1 100644
--- a/src/main/java/team/creative/littletiles/client/mod/oculus/OculusInteractor.java
+++ b/src/main/java/team/creative/littletiles/client/mod/oculus/OculusInteractor.java
@@ -1,9 +1,9 @@
 package team.creative.littletiles.client.mod.oculus;

 import me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuildBuffers;
-import net.coderbot.iris.compat.sodium.impl.block_context.ChunkBuildBuffersExt;
-import net.coderbot.iris.compat.sodium.impl.shader_overrides.ShaderChunkRendererExt;
-import net.coderbot.iris.vertices.ExtendedDataHelper;
+import net.irisshaders.iris.compat.sodium.impl.block_context.ChunkBuildBuffersExt;
+import net.irisshaders.iris.compat.sodium.impl.shader_overrides.ShaderChunkRendererExt;
+import net.irisshaders.iris.vertices.ExtendedDataHelper;
 import net.irisshaders.iris.api.v0.IrisApi;
 import net.minecraft.core.BlockPos;
 import net.minecraft.world.level.block.state.BlockState;
@@ -29,7 +29,7 @@ public class OculusInteractor {

     public static void setMaterialId(ChunkBuildBuffers buffers, BlockState state) {
         if (buffers instanceof ChunkBuildBuffersExt ext)
-            ext.iris$setMaterialId(state, ExtendedDataHelper.BLOCK_RENDER_TYPE);
+            ext.iris$setMaterialId(state, ExtendedDataHelper.BLOCK_RENDER_TYPE, (byte) 0);
     }

     public static void resetBlockContext(ChunkBuildBuffers buffers) {
diff --git a/src/main/java/team/creative/littletiles/client/mod/oculus/OculusSodiumInteractor.java b/src/main/java/team/creative/littletiles/client/mod/oculus/OculusSodiumInteractor.java
index b034378c..af6679fc 100644
--- a/src/main/java/team/creative/littletiles/client/mod/oculus/OculusSodiumInteractor.java
+++ b/src/main/java/team/creative/littletiles/client/mod/oculus/OculusSodiumInteractor.java
@@ -3,7 +3,7 @@ package team.creative.littletiles.client.mod.oculus;
 import me.jellysquid.mods.sodium.client.gl.attribute.GlVertexAttributeBinding;
 import me.jellysquid.mods.sodium.client.gl.attribute.GlVertexFormat;
 import me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkMeshAttribute;
-import net.coderbot.iris.compat.sodium.impl.vertex_format.IrisChunkMeshAttributes;
+import net.irisshaders.iris.compat.sodium.impl.vertex_format.IrisChunkMeshAttributes;

 public class OculusSodiumInteractor {

diff --git a/src/main/java/team/creative/littletiles/mixin/oculus/XHFPTerrainVertexMixin.java b/src/main/java/team/creative/littletiles/mixin/oculus/XHFPTerrainVertexMixin.java
index 607dc584..7e572828 100644
--- a/src/main/java/team/creative/littletiles/mixin/oculus/XHFPTerrainVertexMixin.java
+++ b/src/main/java/team/creative/littletiles/mixin/oculus/XHFPTerrainVertexMixin.java
@@ -5,8 +5,8 @@ import org.spongepowered.asm.mixin.Unique;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Redirect;

-import net.coderbot.iris.compat.sodium.impl.vertex_format.terrain_xhfp.XHFPTerrainVertex;
-import net.coderbot.iris.vertices.ExtendedDataHelper;
+import net.irisshaders.iris.compat.sodium.impl.vertex_format.terrain_xhfp.XHFPTerrainVertex;
+import net.irisshaders.iris.vertices.ExtendedDataHelper;
 import team.creative.creativecore.common.util.math.vec.Vec3d;

 @Mixin(XHFPTerrainVertex.class)
@@ -15,7 +15,7 @@ public class XHFPTerrainVertexMixin {
     @Unique
     public Vec3d center;

-    @Redirect(remap = false, at = @At(value = "INVOKE", target = "Lnet/coderbot/iris/vertices/ExtendedDataHelper;computeMidBlock(FFFIII)I"),
+    @Redirect(remap = false, at = @At(value = "INVOKE", target = "Lnet/irisshaders/iris/vertices/ExtendedDataHelper;computeMidBlock(FFFIII)I"),
             method = "write(JLme/jellysquid/mods/sodium/client/render/chunk/terrain/material/Material;Lme/jellysquid/mods/sodium/client/render/chunk/vertex/format/ChunkVertexEncoder$Vertex;I)J")
     public int computeMidBlock(float x, float y, float z, int localPosX, int localPosY, int localPosZ) {
         if (center != null)
Magi1053 commented 1 month ago

Can this please be fixed? I need to update to Iris 1.7 and this mod is blocking it.

CreativeMD commented 1 month ago

Sorry, for not responding earlier. I was quite busy. A new version is out which fixes this issue. Thanks for everybody who tried to solve it!