Update core + Config + fix underwater/blindness fog

This commit is contained in:
tom lee
2022-02-10 21:43:41 +08:00
parent a6a321ff0e
commit 84c2a687a1
4 changed files with 14 additions and 23 deletions
@@ -98,7 +98,7 @@ public class Config extends ConfigGui
@ConfigAnnotations.FileComment
public static String _lodChunkRenderDistance = IQuality.LOD_CHUNK_RENDER_DISTANCE_DESC;
@ConfigAnnotations.Entry(minValue = 16, maxValue = 8192)
@ConfigAnnotations.Entry(minValue = 16, maxValue = 2048)
public static int lodChunkRenderDistance = IQuality.LOD_CHUNK_RENDER_DISTANCE_MIN_DEFAULT_MAX.defaultValue;
@ConfigAnnotations.FileComment
@@ -154,11 +154,6 @@ public class Config extends ConfigGui
@ConfigAnnotations.Entry
public static boolean disableDirectionalCulling = IAdvancedGraphics.DISABLE_DIRECTIONAL_CULLING_DEFAULT;
@ConfigAnnotations.FileComment
public static String _alwaysDrawAtMaxQuality = IAdvancedGraphics.ALWAYS_DRAW_AT_MAD_QUALITY_DESC;
@ConfigAnnotations.Entry
public static boolean alwaysDrawAtMaxQuality = IAdvancedGraphics.ALWAYS_DRAW_AT_MAD_QUALITY_DEFAULT;
@ConfigAnnotations.FileComment
public static String _vanillaOverdraw = IAdvancedGraphics.VANILLA_OVERDRAW_DESC;
@ConfigAnnotations.Entry
@@ -268,7 +263,7 @@ public class Config extends ConfigGui
@ConfigAnnotations.FileComment
public static String _gpuUploadPerMegabyteInMilliseconds = IBuffers.GPU_UPLOAD_PER_MEGABYTE_IN_MILLISECONDS_DESC;
@ConfigAnnotations.Entry(minValue = 0, maxValue = 5000)
@ConfigAnnotations.Entry(minValue = 0, maxValue = 50)
public static int gpuUploadPerMegabyteInMilliseconds = IBuffers.GPU_UPLOAD_PER_MEGABYTE_IN_MILLISECONDS_DEFAULT.defaultValue;
@ConfigAnnotations.FileComment
@@ -262,19 +262,6 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
}
@Override
public boolean getAlwaysDrawAtMaxQuality()
{
return Config.Client.Graphics.AdvancedGraphics.alwaysDrawAtMaxQuality;
}
@Override
public void setAlwaysDrawAtMaxQuality(boolean newAlwaysDrawAtMaxQuality)
{
ConfigGui.editSingleOption.getEntry("client.graphics.advancedGraphics.alwaysDrawAtMaxQuality").value = newAlwaysDrawAtMaxQuality;
ConfigGui.editSingleOption.saveOption("client.graphics.advancedGraphics.alwaysDrawAtMaxQuality");
}
@Override
public VanillaOverdraw getVanillaOverdraw()
{
@@ -43,7 +43,11 @@ import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.CompiledChunk;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.Vec3;
@@ -306,8 +310,13 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
@Override
public boolean isFogStateSpecial() {
// return GAME_RENDERER.getMainCamera().getFluidInCamera() != FogType.NONE;
return false; // FIXME
Camera camera = GAME_RENDERER.getMainCamera();
FluidState fluidState = camera.getFluidInCamera();
Entity entity = camera.getEntity();
boolean isUnderWater = (entity instanceof LivingEntity) && ((LivingEntity)entity).hasEffect(MobEffects.BLINDNESS);
isUnderWater |= fluidState.is(FluidTags.WATER);
isUnderWater |= fluidState.is(FluidTags.LAVA);
return isUnderWater;
}
@Override
+1 -1
Submodule core updated: d8c082ba42...080d33baf1