diff --git a/src/main/java/net/vulkanmod/mixin/chunk/LevelRendererMixin.java b/src/main/java/net/vulkanmod/mixin/chunk/LevelRendererMixin.java index 1b9c00f98..394213f7b 100644 --- a/src/main/java/net/vulkanmod/mixin/chunk/LevelRendererMixin.java +++ b/src/main/java/net/vulkanmod/mixin/chunk/LevelRendererMixin.java @@ -46,7 +46,7 @@ private void setLevel(ClientLevel clientLevel, CallbackInfo ci) { } @Inject(method = "allChanged", at = @At("RETURN")) - private void allChanged(CallbackInfo ci) { + private void onAllChanged(CallbackInfo ci) { this.worldRenderer.allChanged(); } diff --git a/src/main/java/net/vulkanmod/mixin/chunk/SectionRenderDispatcherM.java b/src/main/java/net/vulkanmod/mixin/chunk/SectionRenderDispatcherM.java new file mode 100644 index 000000000..9dbdab773 --- /dev/null +++ b/src/main/java/net/vulkanmod/mixin/chunk/SectionRenderDispatcherM.java @@ -0,0 +1,14 @@ +package net.vulkanmod.mixin.chunk; + +import net.minecraft.client.renderer.chunk.SectionRenderDispatcher; +import net.minecraft.util.thread.ProcessorMailbox; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(SectionRenderDispatcher.class) +public class SectionRenderDispatcherM { + + @Redirect(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/thread/ProcessorMailbox;tell(Ljava/lang/Object;)V")) + private void redirectTask(ProcessorMailbox instance, Object object) {} +} diff --git a/src/main/java/net/vulkanmod/mixin/chunk/ViewAreaM.java b/src/main/java/net/vulkanmod/mixin/chunk/ViewAreaM.java new file mode 100644 index 000000000..57e46ae74 --- /dev/null +++ b/src/main/java/net/vulkanmod/mixin/chunk/ViewAreaM.java @@ -0,0 +1,22 @@ +package net.vulkanmod.mixin.chunk; + +import net.minecraft.client.renderer.ViewArea; +import net.minecraft.client.renderer.chunk.SectionRenderDispatcher; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ViewArea.class) +public class ViewAreaM { + + @Shadow public SectionRenderDispatcher.RenderSection[] sections; + + @Inject(method = "createSections", at = @At("HEAD"), cancellable = true) + private void skipAllocation(SectionRenderDispatcher sectionRenderDispatcher, CallbackInfo ci) { + this.sections = new SectionRenderDispatcher.RenderSection[0]; + + ci.cancel(); + } +} diff --git a/src/main/resources/vulkanmod.mixins.json b/src/main/resources/vulkanmod.mixins.json index e5c8d7423..40f082703 100644 --- a/src/main/resources/vulkanmod.mixins.json +++ b/src/main/resources/vulkanmod.mixins.json @@ -10,13 +10,15 @@ "window.WindowMixin", "window.WindowAccessor", + "chunk.ClientPacketListenerM", + "chunk.ClientChunkCacheM", "chunk.DirectionMixin", "chunk.FrustumMixin", "chunk.LevelRendererMixin", "chunk.RenderBuffersM", + "chunk.SectionRenderDispatcherM", + "chunk.ViewAreaM", "chunk.VisibilitySetMixin", - "chunk.ClientPacketListenerM", - "chunk.ClientChunkCacheM", "compatibility.EffectInstanceM", "compatibility.ProgramM",