Skip to content

Commit 27f3251

Browse files
Fix chunk culling not being fully disabled in Freecam
1 parent 59fe660 commit 27f3251

3 files changed

Lines changed: 38 additions & 35 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.mixin;
9+
10+
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.injection.At;
12+
import org.spongepowered.asm.mixin.injection.Redirect;
13+
14+
import net.minecraft.client.renderer.SectionOcclusionGraph;
15+
import net.minecraft.client.renderer.chunk.SectionMesh;
16+
import net.minecraft.core.Direction;
17+
import net.wurstclient.event.EventManager;
18+
import net.wurstclient.events.VisGraphListener.VisGraphEvent;
19+
20+
@Mixin(SectionOcclusionGraph.class)
21+
public class SectionOcclusionGraphMixin
22+
{
23+
@Redirect(at = @At(value = "INVOKE",
24+
target = "Lnet/minecraft/client/renderer/chunk/SectionMesh;facesCanSeeEachother(Lnet/minecraft/core/Direction;Lnet/minecraft/core/Direction;)Z"),
25+
method = "runUpdates")
26+
private boolean onFacesCanSeeEachother(SectionMesh mesh, Direction from,
27+
Direction to)
28+
{
29+
VisGraphEvent event = new VisGraphEvent();
30+
EventManager.fire(event);
31+
32+
if(event.isCancelled())
33+
return true;
34+
35+
return mesh.facesCanSeeEachother(from, to);
36+
}
37+
}

src/main/java/net/wurstclient/mixin/VisGraphMixin.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/resources/wurst.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
"PowderSnowBlockMixin",
5151
"RenderTickCounterDynamicMixin",
5252
"ScreenMixin",
53+
"SectionOcclusionGraphMixin",
5354
"ShulkerBoxScreenMixin",
5455
"SimpleOptionMixin",
5556
"StatsScreenMixin",
5657
"StatusEffectInstanceMixin",
5758
"TelemetryManagerMixin",
5859
"TextVisitFactoryMixin",
5960
"TitleScreenMixin",
60-
"VisGraphMixin",
6161
"WorldEnvironmentAttributeAccessMixin",
6262
"WorldMixin",
6363
"WorldRendererMixin",

0 commit comments

Comments
 (0)