124 lines
5.8 KiB
Java
124 lines
5.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.Codec
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.client;
|
|
|
|
import com.mojang.serialization.Codec;
|
|
import net.minecraft.client.CloudStatus;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.OptionInstance;
|
|
import net.minecraft.client.PrioritizeChunkUpdates;
|
|
import net.minecraft.client.gui.screens.options.OptionsSubScreen;
|
|
import net.minecraft.server.level.ParticleStatus;
|
|
import net.minecraft.util.StringRepresentable;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public enum GraphicsPreset implements StringRepresentable
|
|
{
|
|
FAST("fast", "options.graphics.fast"),
|
|
FANCY("fancy", "options.graphics.fancy"),
|
|
FABULOUS("fabulous", "options.graphics.fabulous"),
|
|
CUSTOM("custom", "options.graphics.custom");
|
|
|
|
private final String serializedName;
|
|
private final String key;
|
|
public static final Codec<GraphicsPreset> CODEC;
|
|
|
|
private GraphicsPreset(String serializedName, String key) {
|
|
this.serializedName = serializedName;
|
|
this.key = key;
|
|
}
|
|
|
|
@Override
|
|
public String getSerializedName() {
|
|
return this.serializedName;
|
|
}
|
|
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public void apply(Minecraft minecraft) {
|
|
OptionsSubScreen screen = minecraft.screen instanceof OptionsSubScreen ? (OptionsSubScreen)minecraft.screen : null;
|
|
switch (this.ordinal()) {
|
|
case 0: {
|
|
int viewDistance = 8;
|
|
this.set(screen, minecraft.options.biomeBlendRadius(), 1);
|
|
this.set(screen, minecraft.options.renderDistance(), 8);
|
|
this.set(screen, minecraft.options.prioritizeChunkUpdates(), PrioritizeChunkUpdates.NONE);
|
|
this.set(screen, minecraft.options.simulationDistance(), 6);
|
|
this.set(screen, minecraft.options.ambientOcclusion(), false);
|
|
this.set(screen, minecraft.options.cloudStatus(), CloudStatus.FAST);
|
|
this.set(screen, minecraft.options.particles(), ParticleStatus.DECREASED);
|
|
this.set(screen, minecraft.options.mipmapLevels(), 2);
|
|
this.set(screen, minecraft.options.entityShadows(), false);
|
|
this.set(screen, minecraft.options.entityDistanceScaling(), 0.75);
|
|
this.set(screen, minecraft.options.menuBackgroundBlurriness(), 2);
|
|
this.set(screen, minecraft.options.cloudRange(), 32);
|
|
this.set(screen, minecraft.options.cutoutLeaves(), true);
|
|
this.set(screen, minecraft.options.improvedTransparency(), false);
|
|
this.set(screen, minecraft.options.weatherRadius(), 5);
|
|
this.set(screen, minecraft.options.maxAnisotropyBit(), 0);
|
|
break;
|
|
}
|
|
case 1: {
|
|
int viewDistance = 16;
|
|
this.set(screen, minecraft.options.biomeBlendRadius(), 2);
|
|
this.set(screen, minecraft.options.renderDistance(), 16);
|
|
this.set(screen, minecraft.options.prioritizeChunkUpdates(), PrioritizeChunkUpdates.PLAYER_AFFECTED);
|
|
this.set(screen, minecraft.options.simulationDistance(), 12);
|
|
this.set(screen, minecraft.options.ambientOcclusion(), true);
|
|
this.set(screen, minecraft.options.cloudStatus(), CloudStatus.FANCY);
|
|
this.set(screen, minecraft.options.particles(), ParticleStatus.ALL);
|
|
this.set(screen, minecraft.options.mipmapLevels(), 4);
|
|
this.set(screen, minecraft.options.entityShadows(), true);
|
|
this.set(screen, minecraft.options.entityDistanceScaling(), 1.0);
|
|
this.set(screen, minecraft.options.menuBackgroundBlurriness(), 5);
|
|
this.set(screen, minecraft.options.cloudRange(), 64);
|
|
this.set(screen, minecraft.options.cutoutLeaves(), true);
|
|
this.set(screen, minecraft.options.improvedTransparency(), false);
|
|
this.set(screen, minecraft.options.weatherRadius(), 10);
|
|
this.set(screen, minecraft.options.maxAnisotropyBit(), 1);
|
|
break;
|
|
}
|
|
case 2: {
|
|
int viewDistance = 32;
|
|
this.set(screen, minecraft.options.biomeBlendRadius(), 2);
|
|
this.set(screen, minecraft.options.renderDistance(), 32);
|
|
this.set(screen, minecraft.options.prioritizeChunkUpdates(), PrioritizeChunkUpdates.PLAYER_AFFECTED);
|
|
this.set(screen, minecraft.options.simulationDistance(), 12);
|
|
this.set(screen, minecraft.options.ambientOcclusion(), true);
|
|
this.set(screen, minecraft.options.cloudStatus(), CloudStatus.FANCY);
|
|
this.set(screen, minecraft.options.particles(), ParticleStatus.ALL);
|
|
this.set(screen, minecraft.options.mipmapLevels(), 4);
|
|
this.set(screen, minecraft.options.entityShadows(), true);
|
|
this.set(screen, minecraft.options.entityDistanceScaling(), 1.25);
|
|
this.set(screen, minecraft.options.menuBackgroundBlurriness(), 5);
|
|
this.set(screen, minecraft.options.cloudRange(), 128);
|
|
this.set(screen, minecraft.options.cutoutLeaves(), true);
|
|
this.set(screen, minecraft.options.improvedTransparency(), true);
|
|
this.set(screen, minecraft.options.weatherRadius(), 10);
|
|
this.set(screen, minecraft.options.maxAnisotropyBit(), 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
<T> void set(@Nullable OptionsSubScreen screen, OptionInstance<T> option, T value) {
|
|
if (option.get() != value) {
|
|
option.set(value);
|
|
if (screen != null) {
|
|
screen.resetOption(option);
|
|
}
|
|
}
|
|
}
|
|
|
|
static {
|
|
CODEC = StringRepresentable.fromEnum(GraphicsPreset::values);
|
|
}
|
|
}
|
|
|