Class StructurePlacement
java.lang.Object
net.minecraft.world.level.levelgen.structure.placement.StructurePlacement
- Direct Known Subclasses:
ConcentricRingsStructurePlacement, RandomSpreadStructurePlacement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDeprecated.static interfacestatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<StructurePlacement> private final Optional<StructurePlacement.ExclusionZone> private final floatprivate final StructurePlacement.FrequencyReductionMethodprivate static final intprivate final Vec3iprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStructurePlacement(Vec3i locateOffset, StructurePlacement.FrequencyReductionMethod frequencyReductionMethod, float frequency, int salt, Optional<StructurePlacement.ExclusionZone> exclusionZone) -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyAdditionalChunkRestrictions(int sourceX, int sourceZ, long levelSeed) booleanapplyInteractionsWithOtherStructures(ChunkGeneratorStructureState state, int sourceX, int sourceZ) protected Optional<StructurePlacement.ExclusionZone> protected floatgetLocatePos(ChunkPos chunkPos) protected abstract booleanisPlacementChunk(ChunkGeneratorStructureState state, int sourceX, int sourceZ) booleanisStructureChunk(ChunkGeneratorStructureState state, int sourceX, int sourceZ) private static booleanlegacyArbitrarySaltProbabilityReducer(long seed, int salt, int sourceX, int sourceZ, float probability) private static booleanlegacyPillagerOutpostReducer(long seed, int salt, int sourceX, int sourceZ, float probability) private static booleanlegacyProbabilityReducerWithDouble(long seed, int salt, int sourceX, int sourceZ, float probability) protected Vec3iprotected static <S extends StructurePlacement>
com.mojang.datafixers.Products.P5<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<S>, Vec3i, StructurePlacement.FrequencyReductionMethod, Float, Integer, Optional<StructurePlacement.ExclusionZone>> placementCodec(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<S> i) private static booleanprobabilityReducer(long seed, int salt, int sourceX, int sourceZ, float probability) protected intsalt()abstract StructurePlacementType<?> type()
-
Field Details
-
CODEC
-
HIGHLY_ARBITRARY_RANDOM_SALT
private static final int HIGHLY_ARBITRARY_RANDOM_SALT- See Also:
-
locateOffset
-
frequencyReductionMethod
-
frequency
private final float frequency -
salt
private final int salt -
exclusionZone
-
-
Constructor Details
-
StructurePlacement
protected StructurePlacement(Vec3i locateOffset, StructurePlacement.FrequencyReductionMethod frequencyReductionMethod, float frequency, int salt, Optional<StructurePlacement.ExclusionZone> exclusionZone)
-
-
Method Details
-
placementCodec
protected static <S extends StructurePlacement> com.mojang.datafixers.Products.P5<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<S>, Vec3i, StructurePlacement.FrequencyReductionMethod, Float, Integer, Optional<StructurePlacement.ExclusionZone>> placementCodec(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<S> i) -
locateOffset
-
frequencyReductionMethod
-
frequency
protected float frequency() -
salt
protected int salt() -
exclusionZone
-
isStructureChunk
-
applyAdditionalChunkRestrictions
public boolean applyAdditionalChunkRestrictions(int sourceX, int sourceZ, long levelSeed) -
applyInteractionsWithOtherStructures
public boolean applyInteractionsWithOtherStructures(ChunkGeneratorStructureState state, int sourceX, int sourceZ) -
isPlacementChunk
protected abstract boolean isPlacementChunk(ChunkGeneratorStructureState state, int sourceX, int sourceZ) -
getLocatePos
-
type
-
probabilityReducer
private static boolean probabilityReducer(long seed, int salt, int sourceX, int sourceZ, float probability) -
legacyProbabilityReducerWithDouble
private static boolean legacyProbabilityReducerWithDouble(long seed, int salt, int sourceX, int sourceZ, float probability) -
legacyArbitrarySaltProbabilityReducer
private static boolean legacyArbitrarySaltProbabilityReducer(long seed, int salt, int sourceX, int sourceZ, float probability) -
legacyPillagerOutpostReducer
private static boolean legacyPillagerOutpostReducer(long seed, int salt, int sourceX, int sourceZ, float probability)
-