ComponentContents .java

net.minecraft.network.chat.ComponentContents (interface, 22 lines): members: visit, resolve, codec. imports: CommandSyntaxException.

net.minecraft.network.chatinterface22 linescommon680 B

API Surface (0)

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

Code Graph: Dependencies (4)

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

Full Source

ComponentContents.java22 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.chat;
2
3
import com.mojang.brigadier.exceptions.CommandSyntaxException;
4
import com.mojang.serialization.MapCodec;
5
import java.util.Optional;
6
7
public interface ComponentContents {
8
	default <T> Optional<T> visit(final FormattedText.StyledContentConsumer<T> output, final Style currentStyle) {
9
		return Optional.empty();
10
	}
11
12
	default <T> Optional<T> visit(final FormattedText.ContentConsumer<T> output) {
13
		return Optional.empty();
14
	}
15
16
	default MutableComponent resolve(final ResolutionContext context, final int recursionDepth) throws CommandSyntaxException {
17
		return MutableComponent.create(this);
18
	}
19
20
	MapCodec<? extends ComponentContents> codec();
21
}
22

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