forked from CaffeineMC/sodium
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: Don't distinguish block entities in profiler when using entit…
…y culling
- Loading branch information
1 parent
9c05c65
commit b2dd2ae
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...a/me/jellysquid/mods/sodium/mixin/features/entity/smooth_lighting/MixinWorldRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package me.jellysquid.mods.sodium.mixin.features.entity.smooth_lighting; | ||
|
||
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer; | ||
import net.minecraft.client.render.WorldRenderer; | ||
import net.minecraft.util.profiler.Profiler; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.Objects; | ||
|
||
@Mixin(WorldRenderer.class) | ||
public class MixinWorldRenderer { | ||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V")) | ||
void doNothing(Profiler profiler, String location) { | ||
if (!Objects.equals(location, "blockentities") || !SodiumWorldRenderer.getInstance().getUseEntityCulling()) { | ||
profiler.swap(location); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters