MusicToastDisplayState .java

net.minecraft.client.MusicToastDisplayState (enum): members: NEVER, PAUSE, PAUSE_AND_TOAST, renderInPauseScreen, renderToast, tooltip, text, name, CODEC.

net.minecraft.clientenum47 linesclient1.2 KB

Implements

API Surface (5)

Component text()
Component tooltip()
String getSerializedName()
boolean renderInPauseScreen()
boolean renderToast()

Fields & Constants (4)

CODEC
name
text
tooltip

String literals (7)

"never"
"options.musicToast.never"
"pause"
"options.musicToast.pauseMenu"
"pause_and_toast"
"options.musicToast.pauseMenuAndToast"
".tooltip"

Code Graph: Dependencies (2)

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

Full Source

MusicToastDisplayState.java47 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client;
2
3
import com.mojang.serialization.Codec;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import net.minecraft.network.chat.Component;
7
import net.minecraft.util.StringRepresentable;
8
9
@Environment(EnvType.CLIENT)
10
public enum MusicToastDisplayState implements StringRepresentable {
11
	NEVER("never", "options.musicToast.never"),
12
	PAUSE("pause", "options.musicToast.pauseMenu"),
13
	PAUSE_AND_TOAST("pause_and_toast", "options.musicToast.pauseMenuAndToast");
14
15
	public static final Codec<MusicToastDisplayState> CODEC = StringRepresentable.fromEnum(MusicToastDisplayState::values);
16
	private final String name;
17
	private final Component text;
18
	private final Component tooltip;
19
20
	MusicToastDisplayState(final String name, final String translationKey) {
21
		this.name = name;
22
		this.text = Component.translatable(translationKey);
23
		this.tooltip = Component.translatable(translationKey + ".tooltip");
24
	}
25
26
	public Component text() {
27
		return this.text;
28
	}
29
30
	public Component tooltip() {
31
		return this.tooltip;
32
	}
33
34
	@Override
35
	public String getSerializedName() {
36
		return this.name;
37
	}
38
39
	public boolean renderInPauseScreen() {
40
		return this != NEVER;
41
	}
42
43
	public boolean renderToast() {
44
		return this == PAUSE_AND_TOAST;
45
	}
46
}
47

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