public record MapDecoration(Holder<MapDecorationType> type, byte x, byte y, byte rot, Optional<Component> name) {
13
public static final StreamCodec<RegistryFriendlyByteBuf, MapDecoration> STREAM_CODEC = StreamCodec.composite(
14
MapDecorationType.STREAM_CODEC,
15
MapDecoration::type,
16
ByteBufCodecs.BYTE,
17
MapDecoration::x,
18
ByteBufCodecs.BYTE,
19
MapDecoration::y,
20
ByteBufCodecs.BYTE,
21
MapDecoration::rot,
22
ComponentSerialization.OPTIONAL_STREAM_CODEC,
23
MapDecoration::name,
24
MapDecoration::new
25
);
26
27
public MapDecoration {
28
rot = (byte)(rot & 15);
29
}
30
31
public Identifier getSpriteLocation() {
32
return this.type.value().assetId();
33
}
34
35
public boolean renderOnFrame() {
36
return this.type.value().showOnItemFrame();
37
}
38
}
39
Decompiled Minecraft 26.3 source of MapDecoration (net/minecraft/world/level/saveddata/maps/MapDecoration.java) with Mojang official mappings, stored verbatim on the site.