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 record
Deprecated.static interface
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<StructurePlacement> private final Optional
<StructurePlacement.ExclusionZone> private final float
private final StructurePlacement.FrequencyReductionMethod
private static final int
private final Vec3i
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StructurePlacement
(Vec3i pLocateOffset, StructurePlacement.FrequencyReductionMethod pFrequencyReductionMethod, float pFrequency, int pSalt, Optional<StructurePlacement.ExclusionZone> pExclusionZone) -
Method Summary
Modifier and TypeMethodDescriptionboolean
applyAdditionalChunkRestrictions
(int pRegionX, int pRegionZ, long pLevelSeed) boolean
applyInteractionsWithOtherStructures
(ChunkGeneratorStructureState pStructureState, int pX, int pZ) protected Optional
<StructurePlacement.ExclusionZone> protected float
getLocatePos
(ChunkPos pChunkPos) protected abstract boolean
isPlacementChunk
(ChunkGeneratorStructureState pStructureState, int pX, int pZ) boolean
isStructureChunk
(ChunkGeneratorStructureState pStructureState, int pX, int pZ) private static boolean
legacyArbitrarySaltProbabilityReducer
(long pLevelSeed, int pSalt, int pRegionX, int pRegionZ, float pProbability) private static boolean
legacyPillagerOutpostReducer
(long pLevelSeed, int pSalt, int pRegionX, int pRegionZ, float pProbability) private static boolean
legacyProbabilityReducerWithDouble
(long pBaseSeed, int pSalt, int pChunkX, int pChunkZ, float pProbability) protected Vec3i
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> p_227042_) private static boolean
probabilityReducer
(long pLevelSeed, int pRegionX, int pRegionZ, int pSalt, float pProbability) protected int
salt()
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 pLocateOffset, StructurePlacement.FrequencyReductionMethod pFrequencyReductionMethod, float pFrequency, int pSalt, Optional<StructurePlacement.ExclusionZone> pExclusionZone)
-
-
Method Details
-
placementCodec
protected static <S extends StructurePlacement> com.mojang.datafixers.Products.P5<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<S>,Vec3i, placementCodecStructurePlacement.FrequencyReductionMethod, Float, Integer, Optional<StructurePlacement.ExclusionZone>> (com.mojang.serialization.codecs.RecordCodecBuilder.Instance<S> p_227042_) -
locateOffset
-
frequencyReductionMethod
-
frequency
protected float frequency() -
salt
protected int salt() -
exclusionZone
-
isStructureChunk
-
applyAdditionalChunkRestrictions
public boolean applyAdditionalChunkRestrictions(int pRegionX, int pRegionZ, long pLevelSeed) -
applyInteractionsWithOtherStructures
public boolean applyInteractionsWithOtherStructures(ChunkGeneratorStructureState pStructureState, int pX, int pZ) -
isPlacementChunk
protected abstract boolean isPlacementChunk(ChunkGeneratorStructureState pStructureState, int pX, int pZ) -
getLocatePos
-
type
-
probabilityReducer
private static boolean probabilityReducer(long pLevelSeed, int pRegionX, int pRegionZ, int pSalt, float pProbability) -
legacyProbabilityReducerWithDouble
private static boolean legacyProbabilityReducerWithDouble(long pBaseSeed, int pSalt, int pChunkX, int pChunkZ, float pProbability) -
legacyArbitrarySaltProbabilityReducer
private static boolean legacyArbitrarySaltProbabilityReducer(long pLevelSeed, int pSalt, int pRegionX, int pRegionZ, float pProbability) -
legacyPillagerOutpostReducer
private static boolean legacyPillagerOutpostReducer(long pLevelSeed, int pSalt, int pRegionX, int pRegionZ, float pProbability)
-