Class PoiManager
java.lang.Object
net.minecraft.world.level.chunk.storage.SectionStorage<PoiSection>
net.minecraft.world.entity.ai.village.poi.PoiManager
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PoiManager.DistanceTracker
private final it.unimi.dsi.fastutil.longs.LongSet
static final int
static final int
Fields inherited from class net.minecraft.world.level.chunk.storage.SectionStorage
levelHeightAccessor
-
Constructor Summary
ConstructorsConstructorDescriptionPoiManager
(RegionStorageInfo p_325948_, Path p_217869_, com.mojang.datafixers.DataFixer p_217870_, boolean p_217871_, RegistryAccess p_217872_, ChunkIOErrorReporter p_352327_, LevelHeightAccessor p_217873_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
checkConsistencyWithBlocks
(SectionPos pSectionPos, LevelChunkSection pLevelChunkSection) void
ensureLoadedAndValid
(LevelReader pLevelReader, BlockPos pPos, int pCoordinateOffset) boolean
boolean
existsAtPosition
(ResourceKey<PoiType> pType, BlockPos pPos) find
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findAll
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findAllClosestFirstWithType
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findAllWithType
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findClosest
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findClosest
(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) findClosestWithType
(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) long
getCountInRange
(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) int
getFreeTickets
(BlockPos pPos) Deprecated.getInChunk
(Predicate<Holder<PoiType>> pTypePredicate, ChunkPos pPosChunk, PoiManager.Occupancy pStatus) getInRange
(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) getInSquare
(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) getRandom
(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, PoiManager.Occupancy pStatus, BlockPos pPos, int pDistance, RandomSource pRandom) (package private) boolean
isVillageCenter
(long pChunkPos) private static boolean
mayHavePoi
(LevelChunkSection pSection) protected void
onSectionLoad
(long pSectionKey) boolean
void
int
sectionsToVillage
(SectionPos pSectionPos) protected void
setDirty
(long pSectionPos) take
(Predicate<Holder<PoiType>> pTypePredicate, BiPredicate<Holder<PoiType>, BlockPos> pCombinedTypePosPredicate, BlockPos pPos, int pDistance) void
tick
(BooleanSupplier pAheadOfTime) private void
updateFromSection
(LevelChunkSection pSection, SectionPos pSectionPos, BiConsumer<BlockPos, Holder<PoiType>> pPosToTypeConsumer) Methods inherited from class net.minecraft.world.level.chunk.storage.SectionStorage
close, flush, get, getOrCreate, getOrLoad, hasWork, outsideStoredRange, remove
-
Field Details
-
MAX_VILLAGE_DISTANCE
public static final int MAX_VILLAGE_DISTANCE- See Also:
-
VILLAGE_SECTION_SIZE
public static final int VILLAGE_SECTION_SIZE- See Also:
-
distanceTracker
-
loadedChunks
private final it.unimi.dsi.fastutil.longs.LongSet loadedChunks
-
-
Constructor Details
-
PoiManager
public PoiManager(RegionStorageInfo p_325948_, Path p_217869_, com.mojang.datafixers.DataFixer p_217870_, boolean p_217871_, RegistryAccess p_217872_, ChunkIOErrorReporter p_352327_, LevelHeightAccessor p_217873_)
-
-
Method Details
-
add
-
remove
-
getCountInRange
public long getCountInRange(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) -
existsAtPosition
-
getInSquare
-
getInRange
-
getInChunk
-
findAll
-
findAllWithType
-
findAllClosestFirstWithType
-
find
-
findClosest
-
findClosestWithType
-
findClosest
-
take
-
getRandom
public Optional<BlockPos> getRandom(Predicate<Holder<PoiType>> pTypePredicate, Predicate<BlockPos> pPosPredicate, PoiManager.Occupancy pStatus, BlockPos pPos, int pDistance, RandomSource pRandom) -
release
-
exists
-
getType
-
getFreeTickets
Deprecated. -
sectionsToVillage
-
isVillageCenter
boolean isVillageCenter(long pChunkPos) -
tick
- Overrides:
tick
in classSectionStorage<PoiSection>
-
setDirty
protected void setDirty(long pSectionPos) - Overrides:
setDirty
in classSectionStorage<PoiSection>
-
onSectionLoad
protected void onSectionLoad(long pSectionKey) - Overrides:
onSectionLoad
in classSectionStorage<PoiSection>
-
checkConsistencyWithBlocks
public void checkConsistencyWithBlocks(SectionPos pSectionPos, LevelChunkSection pLevelChunkSection) -
mayHavePoi
-
updateFromSection
private void updateFromSection(LevelChunkSection pSection, SectionPos pSectionPos, BiConsumer<BlockPos, Holder<PoiType>> pPosToTypeConsumer) -
ensureLoadedAndValid
-