CommonPlayerSpawnInfo .java

net.minecraft.network.protocol.game.CommonPlayerSpawnInfo (record): members: dimensionType, dimension, seed, gameType, previousGameType, isDebug, isFlat.

net.minecraft.network.protocol.gamerecord51 linescommon1.6 KB

API Surface (1)

record CommonPlayerSpawnInfo(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, Optional<GameType> previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown, int seaLevel)

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Full Source

CommonPlayerSpawnInfo.java51 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import java.util.Optional;
4
import net.minecraft.core.GlobalPos;
5
import net.minecraft.core.Holder;
6
import net.minecraft.core.registries.Registries;
7
import net.minecraft.network.RegistryFriendlyByteBuf;
8
import net.minecraft.network.codec.ByteBufCodecs;
9
import net.minecraft.network.codec.StreamCodec;
10
import net.minecraft.resources.ResourceKey;
11
import net.minecraft.world.level.GameType;
12
import net.minecraft.world.level.Level;
13
import net.minecraft.world.level.dimension.DimensionType;
14
15
public record CommonPlayerSpawnInfo(
16
	Holder<DimensionType> dimensionType,
17
	ResourceKey<Level> dimension,
18
	long seed,
19
	GameType gameType,
20
	Optional<GameType> previousGameType,
21
	boolean isDebug,
22
	boolean isFlat,
23
	Optional<GlobalPos> lastDeathLocation,
24
	int portalCooldown,
25
	int seaLevel
26
) {
27
	public static final StreamCodec<RegistryFriendlyByteBuf, CommonPlayerSpawnInfo> STREAM_CODEC = StreamCodec.composite(
28
		DimensionType.STREAM_CODEC,
29
		CommonPlayerSpawnInfo::dimensionType,
30
		ResourceKey.streamCodec(Registries.DIMENSION),
31
		CommonPlayerSpawnInfo::dimension,
32
		ByteBufCodecs.LONG,
33
		CommonPlayerSpawnInfo::seed,
34
		GameType.STREAM_CODEC,
35
		CommonPlayerSpawnInfo::gameType,
36
		GameType.OPTIONAL_STREAM_CODEC,
37
		CommonPlayerSpawnInfo::previousGameType,
38
		ByteBufCodecs.BOOL,
39
		CommonPlayerSpawnInfo::isDebug,
40
		ByteBufCodecs.BOOL,
41
		CommonPlayerSpawnInfo::isFlat,
42
		GlobalPos.STREAM_CODEC.apply(ByteBufCodecs::optional),
43
		CommonPlayerSpawnInfo::lastDeathLocation,
44
		ByteBufCodecs.VAR_INT,
45
		CommonPlayerSpawnInfo::portalCooldown,
46
		ByteBufCodecs.VAR_INT,
47
		CommonPlayerSpawnInfo::seaLevel,
48
		CommonPlayerSpawnInfo::new
49
	);
50
}
51

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