RealmsButton .java

net.minecraft.client.gui.components.RealmsButton (class, 30 lines): extends Button. members: SPRITES, extractContents. strings: "widget/realms_button".

net.minecraft.client.gui.componentsclass30 linesclientextends Button1.3 KB

API Surface (1)

void extractContents(final GuiGraphicsExtractor graphics, final int mouseX, final int mouseY, final float a)

Fields & Constants (1)

SPRITES

String literals (3)

"widget/realms_button"
"widget/realms_button_disabled"
"widget/realms_button_highlighted"

Code Graph: Dependencies (7)

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

Full Source

RealmsButton.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.components;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.client.gui.GuiGraphicsExtractor;
6
import net.minecraft.client.renderer.RenderPipelines;
7
import net.minecraft.network.chat.Component;
8
import net.minecraft.resources.Identifier;
9
import net.minecraft.util.ARGB;
10
11
@Environment(EnvType.CLIENT)
12
public class RealmsButton extends Button {
13
	private static final WidgetSprites SPRITES = new WidgetSprites(
14
		Identifier.withDefaultNamespace("widget/realms_button"),
15
		Identifier.withDefaultNamespace("widget/realms_button_disabled"),
16
		Identifier.withDefaultNamespace("widget/realms_button_highlighted")
17
	);
18
19
	public RealmsButton(final int x, final int y, final int width, final int height, final Component message, final Button.OnPress onPress) {
20
		super(x, y, width, height, message, onPress, DEFAULT_NARRATION);
21
	}
22
23
	@Override
24
	protected void extractContents(final GuiGraphicsExtractor graphics, final int mouseX, final int mouseY, final float a) {
25
		Identifier sprite = SPRITES.get(this.active, this.isHoveredOrFocused());
26
		graphics.blitSprite(RenderPipelines.GUI_TEXTURED, sprite, this.getX(), this.getY(), this.getWidth(), this.getHeight(), ARGB.white(this.alpha));
27
		this.extractDefaultLabel(graphics.textRendererForWidget(this, GuiGraphicsExtractor.HoveredTextEffects.NONE));
28
	}
29
}
30

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