Class PoiManager
java.lang.Object
net.minecraft.world.level.chunk.storage.SectionStorage<PoiSection,PoiSection.Packed>
net.minecraft.world.entity.ai.village.poi.PoiManager
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PoiManager.DistanceTrackerprivate final it.unimi.dsi.fastutil.longs.LongSetstatic final intstatic final intFields inherited from class net.minecraft.world.level.chunk.storage.SectionStorage
levelHeightAccessor -
Constructor Summary
ConstructorsConstructorDescriptionPoiManager(RegionStorageInfo pInfo, Path pFolder, com.mojang.datafixers.DataFixer pFixerUpper, boolean pSync, RegistryAccess pRegistryAccess, ChunkIOErrorReporter pErrorReporter, LevelHeightAccessor pLevelHeightAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckConsistencyWithBlocks(SectionPos pSectionPos, LevelChunkSection pLevelChunkSection) voidensureLoadedAndValid(LevelReader pLevelReader, BlockPos pPos, int pCoordinateOffset) booleanbooleanexistsAtPosition(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) longgetCountInRange(Predicate<Holder<PoiType>> pTypePredicate, BlockPos pPos, int pDistance, PoiManager.Occupancy pStatus) intgetFreeTickets(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) booleanisVillageCenter(long pChunkPos) private static booleanmayHavePoi(LevelChunkSection pSection) protected voidonSectionLoad(long p_27145_) booleanvoidintsectionsToVillage(SectionPos pSectionPos) protected voidsetDirty(long pSectionPos) take(Predicate<Holder<PoiType>> pTypePredicate, BiPredicate<Holder<PoiType>, BlockPos> pCombinedTypePosPredicate, BlockPos pPos, int pDistance) voidtick(BooleanSupplier p_27105_) private voidupdateFromSection(LevelChunkSection pSection, SectionPos pSectionPos, BiConsumer<BlockPos, Holder<PoiType>> pPosToTypeConsumer) Methods inherited from class net.minecraft.world.level.chunk.storage.SectionStorage
close, flush, flushAll, get, getOrCreate, getOrLoad, hasWork, outsideStoredRange, prefetch, 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 pInfo, Path pFolder, com.mojang.datafixers.DataFixer pFixerUpper, boolean pSync, RegistryAccess pRegistryAccess, ChunkIOErrorReporter pErrorReporter, LevelHeightAccessor pLevelHeightAccessor)
-
-
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:
tickin classSectionStorage<PoiSection,PoiSection.Packed>
-
setDirty
protected void setDirty(long pSectionPos) - Overrides:
setDirtyin classSectionStorage<PoiSection,PoiSection.Packed>
-
onSectionLoad
protected void onSectionLoad(long p_27145_) - Overrides:
onSectionLoadin classSectionStorage<PoiSection,PoiSection.Packed>
-
checkConsistencyWithBlocks
public void checkConsistencyWithBlocks(SectionPos pSectionPos, LevelChunkSection pLevelChunkSection) -
mayHavePoi
-
updateFromSection
private void updateFromSection(LevelChunkSection pSection, SectionPos pSectionPos, BiConsumer<BlockPos, Holder<PoiType>> pPosToTypeConsumer) -
ensureLoadedAndValid
-