StructurePlacement .java

net.minecraft.world.level.levelgen.structure.placement.StructurePlacement (interface): members: getLocatePos, applyAdditionalChunkRestrictions, codec.

net.minecraft.world.level.levelgen.structure.placementinterface30 linescommon1.0 KB

API Surface (0)

No public/protected methods detected (fields or constants only).

Fields & Constants (1)

CODEC

Code Graph: Dependencies (5)

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

Full Source

StructurePlacement.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.structure.placement;
2
3
import com.mojang.serialization.Codec;
4
import com.mojang.serialization.MapCodec;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.core.Vec3i;
7
import net.minecraft.core.registries.BuiltInRegistries;
8
import net.minecraft.world.level.ChunkPos;
9
import net.minecraft.world.level.chunk.ChunkGeneratorStructureState;
10
11
public interface StructurePlacement {
12
	Codec<StructurePlacement> CODEC = BuiltInRegistries.STRUCTURE_PLACEMENT.byNameCodec().dispatch(StructurePlacement::codec, c -> c);
13
14
	boolean isStructureChunk(ChunkGeneratorStructureState state, int sourceX, int sourceZ);
15
16
	default boolean applyAdditionalChunkRestrictions(final int sourceX, final int sourceZ, final long levelSeed) {
17
		return true;
18
	}
19
20
	default BlockPos getLocatePos(final ChunkPos chunkPos) {
21
		return new BlockPos(chunkPos.getMinBlockX(), 0, chunkPos.getMinBlockZ()).offset(this.locateOffset());
22
	}
23
24
	default Vec3i locateOffset() {
25
		return Vec3i.ZERO;
26
	}
27
28
	MapCodec<? extends StructurePlacement> codec();
29
}
30

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