Disable vanilla perfect frames

This commit is contained in:
Moulberry committed 2024-11-15 10:44:47 +08:00
1 parent a3c36e27b3
commit 6de945a4d2
1 file changed
+28 -31
@@ -169,9 +169,6 @@ public abstract class MixinLevelRenderer {
} }
} }
@Unique
private Biome.Precipitation forcePrecipitation = null;
@WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Options;getCloudsType()Lnet/minecraft/client/CloudStatus;"), require = 0) @WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Options;getCloudsType()Lnet/minecraft/client/CloudStatus;"), require = 0)
public CloudStatus renderLevel_getCloudsType(Options instance, Operation<CloudStatus> original) { public CloudStatus renderLevel_getCloudsType(Options instance, Operation<CloudStatus> original) {
EditorState editorState = EditorStateManager.getCurrent(); EditorState editorState = EditorStateManager.getCurrent();
@@ -198,33 +195,33 @@ public abstract class MixinLevelRenderer {
} }
} }
@WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;setupRender(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/culling/Frustum;ZZ)V"), require = 0) // @WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LevelRenderer;setupRender(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/culling/Frustum;ZZ)V"), require = 0)
public void setupRender(LevelRenderer instance, Camera camera, Frustum frustum, boolean capturedFrustum, boolean isSpectator, Operation<Void> original) { // public void setupRender(LevelRenderer instance, Camera camera, Frustum frustum, boolean capturedFrustum, boolean isSpectator, Operation<Void> original) {
if (PerfectFrames.isEnabled()) { // if (PerfectFrames.isEnabled()) {
boolean doCompile = true; // boolean doCompile = true;
while (doCompile) { // while (doCompile) {
doCompile = false; // doCompile = false;
//
int before = this.visibleSections.size(); // int before = this.visibleSections.size();
original.call(instance, camera, frustum, capturedFrustum, isSpectator); // original.call(instance, camera, frustum, capturedFrustum, isSpectator);
if (this.visibleSections.size() != before) { // if (this.visibleSections.size() != before) {
doCompile = true; // doCompile = true;
} // }
//
RenderRegionCache renderRegionCache = new RenderRegionCache(); // RenderRegionCache renderRegionCache = new RenderRegionCache();
for (SectionRenderDispatcher.RenderSection renderSection : this.visibleSections) { // for (SectionRenderDispatcher.RenderSection renderSection : this.visibleSections) {
if (renderSection.isDirty()) { // if (renderSection.isDirty()) {
this.sectionRenderDispatcher.rebuildSectionSync(renderSection, renderRegionCache); // this.sectionRenderDispatcher.rebuildSectionSync(renderSection, renderRegionCache);
renderSection.setNotDirty(); // renderSection.setNotDirty();
doCompile = true; // doCompile = true;
} // }
} // }
//
this.sectionRenderDispatcher.uploadAllPendingUploads(); // this.sectionRenderDispatcher.uploadAllPendingUploads();
} // }
} else { // } else {
original.call(instance, camera, frustum, capturedFrustum, isSpectator); // original.call(instance, camera, frustum, capturedFrustum, isSpectator);
} // }
} // }
} }