Skip to content

Commit

Permalink
Remove broken reflection in ChunkBufferSorter. (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
nshepperd authored Dec 16, 2024
1 parent debfcdf commit 9fe7e80
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.jellysquid.mods.sodium.client.model.vertex.type.ChunkVertexType;
import me.jellysquid.mods.sodium.client.render.chunk.format.hfp.HFPModelVertexType;
import me.jellysquid.mods.sodium.client.render.chunk.format.sfp.SFPModelVertexType;
import net.coderbot.iris.sodium.vertex_format.terrain_xhfp.XHFPModelVertexType;

import java.nio.Buffer;
import java.nio.ByteBuffer;
Expand All @@ -14,22 +15,10 @@

public class ChunkBufferSorter {

private static final Class<?> OCULUS_VERTEX_TYPE;

static {
Class<?> clz;
try {
clz = Class.forName("net.coderbot.iris.compat.sodium.impl.vertex_format.terrain_xhfp.XHFPModelVertexType");
} catch(Throwable e) {
clz = null;
}
OCULUS_VERTEX_TYPE = clz;
}

public static void sortStandardFormat(ChunkVertexType vertexType, ByteBuffer buffer, int bufferLen, float x, float y, float z) {
boolean isCompact;

if(vertexType.getClass() == HFPModelVertexType.class || vertexType.getClass() == OCULUS_VERTEX_TYPE) {
if(vertexType.getClass() == HFPModelVertexType.class || vertexType.getClass() == XHFPModelVertexType.class) {
isCompact = true;
} else if(vertexType.getClass() == SFPModelVertexType.class) {
isCompact = false;
Expand Down

0 comments on commit 9fe7e80

Please sign in to comment.