AppendStatic .java

net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity.AppendStatic (class, 29 lines): members: tag, apply, getType, CODEC.

net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentityclass29 linescommon966 B

Implements

API Surface (2)

CompoundTag apply(final RandomSource random, final @Nullable CompoundTag existingTag)
RuleBlockEntityModifierType<?> getType()

Fields & Constants (2)

CODEC
tag

Code Graph: Dependencies (4)

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

Full Source

AppendStatic.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity;
2
3
import com.mojang.serialization.MapCodec;
4
import com.mojang.serialization.codecs.RecordCodecBuilder;
5
import net.minecraft.nbt.CompoundTag;
6
import net.minecraft.util.RandomSource;
7
import org.jspecify.annotations.Nullable;
8
9
public class AppendStatic implements RuleBlockEntityModifier {
10
	public static final MapCodec<AppendStatic> CODEC = RecordCodecBuilder.mapCodec(
11
		i -> i.group(CompoundTag.CODEC.fieldOf("data").forGetter(r -> r.tag)).apply(i, AppendStatic::new)
12
	);
13
	private final CompoundTag tag;
14
15
	public AppendStatic(final CompoundTag tag) {
16
		this.tag = tag;
17
	}
18
19
	@Override
20
	public CompoundTag apply(final RandomSource random, final @Nullable CompoundTag existingTag) {
21
		return existingTag == null ? this.tag.copy() : existingTag.merge(this.tag);
22
	}
23
24
	@Override
25
	public RuleBlockEntityModifierType<?> getType() {
26
		return RuleBlockEntityModifierType.APPEND_STATIC;
27
	}
28
}
29

Decompiled Minecraft 26.3 source of AppendStatic (net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/AppendStatic.java) with Mojang official mappings, stored verbatim on the site.