ProfileKeyPair .java

net.minecraft.world.entity.player.ProfileKeyPair (record, 24 lines): members: privateKey, publicKey, refreshedAfter, dueRefresh, CODEC. imports: Crypt.

net.minecraft.world.entity.playerrecord24 linescommon894 B

API Surface (2)

record ProfileKeyPair(PrivateKey privateKey, ProfilePublicKey publicKey, Instant refreshedAfter)
boolean dueRefresh()

Fields & Constants (1)

CODEC

String literals (3)

"private_key"
"public_key"
"refreshed_after"

Code Graph: Dependencies (3)

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

Full Source

ProfileKeyPair.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity.player;
2
3
import com.mojang.serialization.Codec;
4
import com.mojang.serialization.codecs.RecordCodecBuilder;
5
import java.security.PrivateKey;
6
import java.time.Instant;
7
import net.minecraft.util.Crypt;
8
import net.minecraft.util.ExtraCodecs;
9
10
public record ProfileKeyPair(PrivateKey privateKey, ProfilePublicKey publicKey, Instant refreshedAfter) {
11
	public static final Codec<ProfileKeyPair> CODEC = RecordCodecBuilder.create(
12
		i -> i.group(
13
				Crypt.PRIVATE_KEY_CODEC.fieldOf("private_key").forGetter(ProfileKeyPair::privateKey),
14
				ProfilePublicKey.TRUSTED_CODEC.fieldOf("public_key").forGetter(ProfileKeyPair::publicKey),
15
				ExtraCodecs.INSTANT_ISO8601.fieldOf("refreshed_after").forGetter(ProfileKeyPair::refreshedAfter)
16
			)
17
			.apply(i, ProfileKeyPair::new)
18
	);
19
20
	public boolean dueRefresh() {
21
		return this.refreshedAfter.isBefore(Instant.now());
22
	}
23
}
24

Decompiled Minecraft 26.3 source of ProfileKeyPair (net/minecraft/world/entity/player/ProfileKeyPair.java) with Mojang official mappings, stored verbatim on the site.