Merge remote-tracking branch 'origin/1.20-recode' into 1.20-recode

This commit is contained in:
FlorianMichael 2023-06-03 17:17:44 +02:00
commit 250108451c
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -18,7 +18,7 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.sodium;
import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings;
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2BooleanOpenHashMap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
@ -28,10 +28,10 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(targets = "me.jellysquid.mods.sodium.client.render.chunk.ChunkTracker", remap = false)
public abstract class MixinChunkTracker {
@Redirect(method = "recalculateChunks", at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/longs/Long2IntOpenHashMap;get(J)I"))
private int modifyRenderCondition(Long2IntOpenHashMap instance, long k) {
@Redirect(method = "recalculateChunks", at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/longs/Long2BooleanOpenHashMap;get(J)Z"))
private boolean modifyRenderCondition(Long2BooleanOpenHashMap instance, long k) {
if (VisualSettings.INSTANCE.fixSodiumChunkRendering.getValue()) {
return instance.getOrDefault(k, -1);
return instance.getOrDefault(k, false);
}
return instance.get(k);