SoundOptionsScreen .java

net.minecraft.client.gui.screens.options.SoundOptionsScreen (class): members: addOptions, TITLE. strings: "options.sounds.title". imports: OptionInstance.

net.minecraft.client.gui.screens.optionsclass36 linesclientextends OptionsSubScreen1.3 KB

API Surface (1)

void addOptions()

Fields & Constants (1)

TITLE

String literals (1)

"options.sounds.title"

Code Graph: Dependencies (7)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

SoundOptionsScreen.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.screens.options;
2
3
import java.util.Arrays;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import net.minecraft.client.OptionInstance;
7
import net.minecraft.client.Options;
8
import net.minecraft.client.gui.screens.Screen;
9
import net.minecraft.network.chat.Component;
10
import net.minecraft.sounds.SoundSource;
11
12
@Environment(EnvType.CLIENT)
13
public class SoundOptionsScreen extends OptionsSubScreen {
14
	private static final Component TITLE = Component.translatable("options.sounds.title");
15
16
	public SoundOptionsScreen(final Screen lastScreen, final Options options) {
17
		super(lastScreen, options, TITLE);
18
	}
19
20
	@Override
21
	protected void addOptions() {
22
		this.list.addBig(this.options.getSoundSourceOptionInstance(SoundSource.MASTER));
23
		this.list.addSmall(this.getAllSoundOptionsExceptMaster());
24
		this.list.addBig(this.options.soundDevice());
25
		this.list.addSmall(this.options.showSubtitles(), this.options.directionalAudio());
26
		this.list.addSmall(this.options.musicFrequency(), this.options.musicToast());
27
	}
28
29
	private OptionInstance<?>[] getAllSoundOptionsExceptMaster() {
30
		return Arrays.stream(SoundSource.values())
31
			.filter(s -> s != SoundSource.MASTER)
32
			.map(this.options::getSoundSourceOptionInstance)
33
			.toArray(OptionInstance[]::new);
34
	}
35
}
36

Decompiled Minecraft 26.3 source of SoundOptionsScreen (net/minecraft/client/gui/screens/options/SoundOptionsScreen.java) with Mojang official mappings, stored verbatim on the site.