fix sodium compat
This commit is contained in:
parent
7aefd13755
commit
a9ce715750
|
@ -66,7 +66,7 @@ dependencies {
|
|||
modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
||||
include "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
||||
|
||||
modCompileOnly("maven.modrinth:sodium:${project.sodium_version}")
|
||||
modImplementation("maven.modrinth:sodium:${project.sodium_version}")
|
||||
}
|
||||
|
||||
loom {
|
||||
|
|
|
@ -31,6 +31,7 @@ public class SodiumPortalFluidRenderHandler implements VertexEater {
|
|||
private int i;
|
||||
private ChunkModelBuilder chunkModelBuilder;
|
||||
private Material material;
|
||||
private Vector3f rotBuffer = new Vector3f();
|
||||
|
||||
public SodiumPortalFluidRenderHandler() {
|
||||
}
|
||||
|
@ -62,17 +63,18 @@ public class SodiumPortalFluidRenderHandler implements VertexEater {
|
|||
|
||||
@Override
|
||||
public void drawQuad(Vector3f offset, Quaternionf rot, Direction direction) {
|
||||
writeQuad(chunkModelBuilder, material, offset, quad, ModelQuadFacing.fromDirection(direction), false);
|
||||
writeQuad(chunkModelBuilder, material, offset, quad, rot, ModelQuadFacing.fromDirection(direction), false);
|
||||
}
|
||||
|
||||
private void writeQuad(ChunkModelBuilder builder, Material material, Vector3f offset, ModelQuadView quad, ModelQuadFacing facing, boolean flip) {
|
||||
private void writeQuad(ChunkModelBuilder builder, Material material, Vector3f offset, ModelQuadView quad, Quaternionf rot, ModelQuadFacing facing, boolean flip) {
|
||||
var vertices = this.vertices;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
var out = vertices[flip ? 3 - i : i];
|
||||
out.x = offset.x + quad.getX(i);
|
||||
out.y = offset.y + quad.getY(i);
|
||||
out.z = offset.z + quad.getZ(i);
|
||||
rot.transform(quad.getX(i), quad.getY(i), quad.getZ(i), rotBuffer);
|
||||
out.x = offset.x + rotBuffer.x;
|
||||
out.y = offset.y + rotBuffer.y;
|
||||
out.z = offset.z + rotBuffer.z;
|
||||
out.color = 0xFFFFFFFF;
|
||||
out.u = quad.getTexU(i);
|
||||
out.v = quad.getTexV(i);
|
||||
|
@ -90,5 +92,4 @@ public class SodiumPortalFluidRenderHandler implements VertexEater {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user