PlainTextRenderable .java

net.minecraft.client.gui.font.PlainTextRenderable (interface, 71 lines): members: DEFUAULT_ASCENT, renderSprite, ascent, shadowOffset, shadowColor, bottom.

net.minecraft.client.gui.fontinterface71 linesclientextends TextRenderable.Styled1.5 KB

API Surface (0)

No public/protected methods detected (fields or constants only).

Fields & Constants (3)

DEFAULT_WIDTH
DEFAULT_HEIGHT
DEFUAULT_ASCENT

Code Graph: Dependencies (2)

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

Full Source

PlainTextRenderable.java71 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.font;
2
3
import com.mojang.blaze3d.vertex.VertexConsumer;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import org.joml.Matrix4fc;
7
8
@Environment(EnvType.CLIENT)
9
public interface PlainTextRenderable extends TextRenderable.Styled {
10
	float DEFAULT_WIDTH = 8.0F;
11
	float DEFAULT_HEIGHT = 8.0F;
12
	float DEFUAULT_ASCENT = 8.0F;
13
14
	@Override
15
	default void render(final Matrix4fc pose, final VertexConsumer buffer, final int packedLightCoords, final boolean flat) {
16
		float frontDepth = 0.0F;
17
		if (this.shadowColor() != 0) {
18
			this.renderSprite(pose, buffer, packedLightCoords, this.shadowOffset(), this.shadowOffset(), 0.0F, this.shadowColor());
19
			if (!flat) {
20
				frontDepth += 0.03F;
21
			}
22
		}
23
24
		this.renderSprite(pose, buffer, packedLightCoords, 0.0F, 0.0F, frontDepth, this.color());
25
	}
26
27
	void renderSprite(Matrix4fc pose, VertexConsumer buffer, int packedLightCoords, float offsetX, float offsetY, float z, int color);
28
29
	float x();
30
31
	float y();
32
33
	int color();
34
35
	int shadowColor();
36
37
	float shadowOffset();
38
39
	default float width() {
40
		return 8.0F;
41
	}
42
43
	default float height() {
44
		return 8.0F;
45
	}
46
47
	default float ascent() {
48
		return 8.0F;
49
	}
50
51
	@Override
52
	default float left() {
53
		return this.x();
54
	}
55
56
	@Override
57
	default float right() {
58
		return this.left() + this.width();
59
	}
60
61
	@Override
62
	default float top() {
63
		return this.y() + 7.0F - this.ascent();
64
	}
65
66
	@Override
67
	default float bottom() {
68
		return this.activeTop() + this.height();
69
	}
70
}
71

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