TelemetryEventInstance .java

net.minecraft.client.telemetry.TelemetryEventInstance (record, 25 lines): members: properties, export, type, CODEC. strings: "' not expected for event: '".

net.minecraft.client.telemetryrecord25 linesclient937 B

API Surface (2)

record TelemetryEventInstance(TelemetryEventType type, TelemetryPropertyMap properties)
TelemetryEvent export(final TelemetrySession session)

Fields & Constants (1)

CODEC

String literals (2)

"Property '"
"' not expected for event: '"

Code Graph: Dependencies (2)

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

Full Source

TelemetryEventInstance.java25 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.telemetry;
2
3
import com.mojang.authlib.minecraft.TelemetryEvent;
4
import com.mojang.authlib.minecraft.TelemetrySession;
5
import com.mojang.serialization.Codec;
6
import net.fabricmc.api.EnvType;
7
import net.fabricmc.api.Environment;
8
9
@Environment(EnvType.CLIENT)
10
public record TelemetryEventInstance(TelemetryEventType type, TelemetryPropertyMap properties) {
11
	public static final Codec<TelemetryEventInstance> CODEC = TelemetryEventType.CODEC.dispatchStable(TelemetryEventInstance::type, TelemetryEventType::codec);
12
13
	public TelemetryEventInstance {
14
		properties.propertySet().forEach(property -> {
15
			if (!type.contains((TelemetryProperty<?>)property)) {
16
				throw new IllegalArgumentException("Property '" + property.id() + "' not expected for event: '" + type.id() + "'");
17
			}
18
		});
19
	}
20
21
	public TelemetryEvent export(final TelemetrySession session) {
22
		return this.type.export(session, this.properties);
23
	}
24
}
25

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