Skip to content

Commit 863eaeb

Browse files
committed
Refactor skip allocation mixin to prevent null pointer exception
1 parent 5921d83 commit 863eaeb

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

src/main/java/net/vulkanmod/mixin/chunk/RenderBuffersM.java

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package net.vulkanmod.mixin.chunk;
2+
3+
import net.minecraft.client.renderer.SectionBufferBuilderPool;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.injection.At;
6+
import org.spongepowered.asm.mixin.injection.ModifyVariable;
7+
8+
@Mixin(SectionBufferBuilderPool.class)
9+
public class SectionBufferBuilderPoolM {
10+
11+
@ModifyVariable(method = "allocate", at = @At("STORE"), ordinal = 1)
12+
private static int skipAllocation(int value) {
13+
return 0;
14+
}
15+
}

src/main/resources/vulkanmod.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"chunk.DirectionMixin",
1616
"chunk.FrustumMixin",
1717
"chunk.LevelRendererMixin",
18-
"chunk.RenderBuffersM",
18+
"chunk.SectionBufferBuilderPoolM",
1919
"chunk.SectionRenderDispatcherM",
2020
"chunk.ViewAreaM",
2121
"chunk.VisibilitySetMixin",

0 commit comments

Comments
 (0)