EmptyPoolElement .java

net.minecraft.world.level.levelgen.structure.pools.EmptyPoolElement (class): members: getShuffledJigsawBlocks, liquidSettings, getBoundingBox, chunkBB.

net.minecraft.world.level.levelgen.structure.poolsclass70 linescommonextends StructurePoolElement2.3 KB

API Surface (6)

Vec3i getSize(final StructureTemplateManager structureTemplateManager, final Rotation rotation)
List<StructureTemplate.JigsawBlockInfo> getShuffledJigsawBlocks(final StructureTemplateManager structureTemplateManager, final BlockPos position, final Rotation rotation, final RandomSource random)
BoundingBox getBoundingBox(final StructureTemplateManager structureTemplateManager, final BlockPos position, final Rotation rotation)
boolean place(final StructureTemplateManager structureTemplateManager, final WorldGenLevel level, final StructureManager structureManager, final ChunkGenerator generator, final BlockPos position, final BlockPos referencePos, final Rotation rotation, final BoundingBox chunkBB, final RandomSource random, final LiquidSettings liquidSettings, final boolean keepJigsaws)
StructurePoolElementType<?> getType()
String toString()

Fields & Constants (12)

CODEC
INSTANCE
rotation
structureTemplateManager
level
structureManager
generator
position
referencePos
chunkBB
random
liquidSettings

String literals (1)

"Empty"

Full Source

EmptyPoolElement.java70 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.structure.pools;
2
3
import com.mojang.serialization.MapCodec;
4
import java.util.Collections;
5
import java.util.List;
6
import net.minecraft.core.BlockPos;
7
import net.minecraft.core.Vec3i;
8
import net.minecraft.util.RandomSource;
9
import net.minecraft.world.level.StructureManager;
10
import net.minecraft.world.level.WorldGenLevel;
11
import net.minecraft.world.level.block.Rotation;
12
import net.minecraft.world.level.chunk.ChunkGenerator;
13
import net.minecraft.world.level.levelgen.structure.BoundingBox;
14
import net.minecraft.world.level.levelgen.structure.templatesystem.LiquidSettings;
15
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
16
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
17
18
public class EmptyPoolElement extends StructurePoolElement {
19
	public static final MapCodec<EmptyPoolElement> CODEC = MapCodec.unit(() -> EmptyPoolElement.INSTANCE);
20
	public static final EmptyPoolElement INSTANCE = new EmptyPoolElement();
21
22
	private EmptyPoolElement() {
23
		super(StructureTemplatePool.Projection.TERRAIN_MATCHING);
24
	}
25
26
	@Override
27
	public Vec3i getSize(final StructureTemplateManager structureTemplateManager, final Rotation rotation) {
28
		return Vec3i.ZERO;
29
	}
30
31
	@Override
32
	public List<StructureTemplate.JigsawBlockInfo> getShuffledJigsawBlocks(
33
		final StructureTemplateManager structureTemplateManager, final BlockPos position, final Rotation rotation, final RandomSource random
34
	) {
35
		return Collections.emptyList();
36
	}
37
38
	@Override
39
	public BoundingBox getBoundingBox(final StructureTemplateManager structureTemplateManager, final BlockPos position, final Rotation rotation) {
40
		throw new IllegalStateException("Invalid call to EmptyPoolElement.getBoundingBox, filter me!");
41
	}
42
43
	@Override
44
	public boolean place(
45
		final StructureTemplateManager structureTemplateManager,
46
		final WorldGenLevel level,
47
		final StructureManager structureManager,
48
		final ChunkGenerator generator,
49
		final BlockPos position,
50
		final BlockPos referencePos,
51
		final Rotation rotation,
52
		final BoundingBox chunkBB,
53
		final RandomSource random,
54
		final LiquidSettings liquidSettings,
55
		final boolean keepJigsaws
56
	) {
57
		return true;
58
	}
59
60
	@Override
61
	public StructurePoolElementType<?> getType() {
62
		return StructurePoolElementType.EMPTY;
63
	}
64
65
	@Override
66
	public String toString() {
67
		return "Empty";
68
	}
69
}
70

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