mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 20:32:14 +00:00
Use vanilla field to count number of chunk updates
Fixes D-Tools compat
This commit is contained in:
1 parent
22d28abce6
commit
996b3df9cb
5 files changed
+2
-24
No files matched your search
@@ -25,11 +25,6 @@ public class MixinMinecraft {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method="runGameLoop", at=@At(value="FIELD", target="Lnet/minecraft/client/renderer/WorldRenderer;chunksUpdated:I", ordinal=0))
|
||||
private int sodium$chunksUpdated() {
|
||||
return ((IRenderGlobalExt)this.renderGlobal).getChunksSubmitted();
|
||||
}
|
||||
|
||||
@Redirect(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z"))
|
||||
private boolean sodium$overrideFancyGrass(GameSettings gameSettings) {
|
||||
return SodiumClientMod.options().quality.grassQuality.isFancy();
|
||||
|
||||
@@ -60,11 +60,6 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
this.renderer.scheduleTerrainUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChunksSubmitted() {
|
||||
return this.renderer.getChunksSubmitted();
|
||||
}
|
||||
|
||||
@Inject(method="<init>", at=@At("RETURN"))
|
||||
private void sodium$initRenderer(Minecraft mc, CallbackInfo ci) {
|
||||
this.renderer = SodiumWorldRenderer.create(mc);
|
||||
|
||||
@@ -2,6 +2,5 @@ package com.gtnewhorizons.angelica.mixins.interfaces;
|
||||
|
||||
public interface IRenderGlobalExt {
|
||||
void scheduleTerrainUpdate();
|
||||
int getChunksSubmitted();
|
||||
|
||||
}
|
||||
@@ -124,10 +124,6 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
public int getChunksSubmitted() {
|
||||
return this.chunkRenderManager != null ? this.chunkRenderManager.getAndResetSubmitted() : 0;
|
||||
}
|
||||
|
||||
private void loadWorld(WorldClient world) {
|
||||
this.world = world;
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import me.jellysquid.mods.sodium.common.util.IdTable;
|
||||
import me.jellysquid.mods.sodium.common.util.collections.FutureDequeDrain;
|
||||
import net.coderbot.iris.shadows.ShadowRenderingState;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -97,7 +98,6 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
|
||||
@Getter
|
||||
private int submitted;
|
||||
private int totalSubmitted;
|
||||
|
||||
private final boolean translucencySorting;
|
||||
|
||||
@@ -580,7 +580,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
sortedAnything = true;
|
||||
submitted++;
|
||||
}
|
||||
totalSubmitted += submitted;
|
||||
WorldRenderer.chunksUpdated += submitted;
|
||||
|
||||
this.dirty |= submitted > 0;
|
||||
|
||||
@@ -596,13 +596,6 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
|
||||
}
|
||||
}
|
||||
|
||||
public int getAndResetSubmitted() {
|
||||
// Return how many chunks were submitted since the last call to this method
|
||||
final int submitted = totalSubmitted;
|
||||
totalSubmitted = 0;
|
||||
return submitted;
|
||||
}
|
||||
|
||||
public void markDirty() {
|
||||
this.dirty = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user