LocalChatSession .java

net.minecraft.network.chat.LocalChatSession (record, 20 lines): members: sessionId, keyPair, createMessageEncoder, asRemote, create. imports: Signer.

net.minecraft.network.chatrecord20 linescommon686 B

API Surface (4)

record LocalChatSession(UUID sessionId, ProfileKeyPair keyPair)
LocalChatSession create(final ProfileKeyPair keyPair)
SignedMessageChain.Encoder createMessageEncoder(final UUID profileId)
RemoteChatSession asRemote()

String literals (1)

"SHA256withRSA"

Code Graph: Dependencies (4)

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

Full Source

LocalChatSession.java20 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.chat;
2
3
import java.util.UUID;
4
import net.minecraft.util.Signer;
5
import net.minecraft.world.entity.player.ProfileKeyPair;
6
7
public record LocalChatSession(UUID sessionId, ProfileKeyPair keyPair) {
8
	public static LocalChatSession create(final ProfileKeyPair keyPair) {
9
		return new LocalChatSession(UUID.randomUUID(), keyPair);
10
	}
11
12
	public SignedMessageChain.Encoder createMessageEncoder(final UUID profileId) {
13
		return new SignedMessageChain(profileId, this.sessionId).encoder(Signer.from(this.keyPair.privateKey(), "SHA256withRSA"));
14
	}
15
16
	public RemoteChatSession asRemote() {
17
		return new RemoteChatSession(this.sessionId, this.keyPair.publicKey());
18
	}
19
}
20

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