Tweakeroo

Tweakeroo

2M Downloads

Free Camera not correctly rendering distant caves when underground

leumasme opened this issue ยท 2 comments

commented

https://streamable.com/0k95b
this seems to be a common problem when creating a freecam tweak, as i noticed from other mods.
I know that the public source mod wurst fixed it, might want to look at how it was done there to make it easier. https://github.com/Wurst-Imperium

commented

I think in the source preSetupTerrain() in MixinGameRenderer.java supposedly should do the job, and somehow it didn't work. Although I don't exactly know what the preSetupTerrain() does, I found out another easier way to fix it.

In MixinWorldRenderer.java, add this:

    @ModifyVariable(method = "setUpTerrain", at = @At("HEAD"), argsOnly = true)
    public boolean setUpTerrain_modifyBoolean(boolean boolean_1) {
        return boolean_1 || FeatureToggle.TWEAK_FREE_CAMERA.getBooleanValue();
    }

then it should work.

Modifying isSpectator() in MixinClientPlayerEntity also works, but you can see only a spectator head left at your player location. So I don't prefer this method.

    @Override
    public boolean isSpectator()
    {
        return super.isSpectator() || FeatureToggle.TWEAK_FREE_CAMERA.getBooleanValue();
    }
commented

This issue should be be fixed by the Free Camera changes I did between 2019-12-24 - 2019-12-26, which are in the latest 1.12 builds, but not yet in any of the other builds.