diff --git a/src/main/java/me/jellysquid/mods/sodium/mixin/core/pipeline/MixinBufferBuilder.java b/src/main/java/me/jellysquid/mods/sodium/mixin/core/pipeline/MixinBufferBuilder.java index 0621e92325..4deed0445d 100644 --- a/src/main/java/me/jellysquid/mods/sodium/mixin/core/pipeline/MixinBufferBuilder.java +++ b/src/main/java/me/jellysquid/mods/sodium/mixin/core/pipeline/MixinBufferBuilder.java @@ -54,12 +54,8 @@ public boolean ensureBufferCapacity(int bytes) { LOGGER.debug("Needed to grow BufferBuilder buffer: Old size {} bytes, new size {} bytes.", this.buffer.capacity(), newSize); - this.buffer.position(0); - - ByteBuffer byteBuffer = GlAllocationUtils.allocateByteBuffer(newSize); - byteBuffer.put(this.buffer); + ByteBuffer byteBuffer = GlAllocationUtils.resizeByteBuffer(this.buffer, newSize); byteBuffer.rewind(); - this.buffer = byteBuffer; return true;