Skip to content

Commit

Permalink
update to sodium 0.6.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wide-Cat committed Sep 15, 2024
1 parent b4afa0b commit 0ee66e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ archives_base_name=meteor-client
baritone_version=1.21

# Sodium (https://github.com/CaffeineMC/sodium-fabric)
sodium_version=mc1.21-0.6.0-beta.1-fabric
sodium_version=mc1.21-0.6.0-beta.2-fabric

# Lithium (https://github.com/CaffeineMC/lithium-fabric)
lithium_version=mc1.21.1-0.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
package meteordevelopment.meteorclient.mixin.sodium;

import meteordevelopment.meteorclient.utils.render.MeshVertexConsumerProvider;
import net.caffeinemc.mods.sodium.api.vertex.attributes.CommonVertexAttribute;
import net.caffeinemc.mods.sodium.api.vertex.buffer.VertexBufferWriter;
import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatDescription;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormatElement;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(value = MeshVertexConsumerProvider.MeshVertexConsumer.class, remap = false)
public abstract class MeshVertexConsumerMixin implements VertexConsumer, VertexBufferWriter {
@Override
public void push(MemoryStack stack, long ptr, int count, VertexFormatDescription format) {
int positionOffset = format.getElementOffset(CommonVertexAttribute.POSITION);
public void push(MemoryStack stack, long ptr, int count, VertexFormat format) {
int positionOffset = format.getOffset(VertexFormatElement.POSITION);

if (positionOffset == -1) return;

for (int i = 0; i < count; i++) {
long positionPtr = ptr + (long) format.stride() * i + positionOffset;
long positionPtr = ptr + (long) format.getVertexSizeByte() * i + positionOffset;

float x = MemoryUtil.memGetFloat(positionPtr);
float y = MemoryUtil.memGetFloat(positionPtr + 4);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"feather": "*",
"origins": "*",
"wurst": "*",
"sodium": "<0.6.0-beta",
"sodium": "<0.6.0-beta.2",
"morechathistory": "*"
}
}

0 comments on commit 0ee66e8

Please sign in to comment.