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 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 info, Path folder, com.mojang.datafixers.DataFixer fixerUpper, boolean sync, RegistryAccess registryAccess, ChunkIOErrorReporter errorReporter, LevelHeightAccessor levelHeightAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckConsistencyWithBlocks(SectionPos sectionPos, LevelChunkSection levelChunkSection) voidensureLoadedAndValid(LevelReader levelReader, BlockPos pos, int coordinateOffset) booleanbooleanexistsAtPosition(ResourceKey<PoiType> type, BlockPos pos) find(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findAll(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findAllClosestFirstWithType(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findAllWithType(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findClosest(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findClosest(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) findClosestWithType(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) longgetCountInRange(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) intgetFreeTickets(BlockPos pos) Deprecated.getInChunk(Predicate<Holder<PoiType>> typePredicate, ChunkPos posChunk, PoiManager.Occupancy status) getInRange(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) getInSquare(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) getRandom(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, PoiManager.Occupancy status, BlockPos pos, int distance, RandomSource random) (package private) booleanisVillageCenter(long chunkPos) private static booleanmayHavePoi(LevelChunkSection section) protected voidonSectionLoad(long sectionKey) booleanvoidintsectionsToVillage(SectionPos sectionPos) protected voidsetDirty(long sectionPos) take(Predicate<Holder<PoiType>> typePredicate, BiPredicate<Holder<PoiType>, BlockPos> combinedTypePosPredicate, BlockPos pos, int distance) voidtick(BooleanSupplier aheadOfTime) private voidupdateFromSection(LevelChunkSection section, SectionPos sectionPos, BiConsumer<BlockPos, Holder<PoiType>> posToTypeConsumer) 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 info, Path folder, com.mojang.datafixers.DataFixer fixerUpper, boolean sync, RegistryAccess registryAccess, ChunkIOErrorReporter errorReporter, LevelHeightAccessor levelHeightAccessor)
-
-
Method Details
-
add
-
remove
-
getCountInRange
public long getCountInRange(Predicate<Holder<PoiType>> typePredicate, BlockPos pos, int distance, PoiManager.Occupancy status) -
existsAtPosition
-
getInSquare
-
getInRange
-
getInChunk
-
findAll
-
findAllWithType
-
findAllClosestFirstWithType
-
find
-
findClosest
-
findClosestWithType
-
findClosest
-
take
-
getRandom
public Optional<BlockPos> getRandom(Predicate<Holder<PoiType>> typePredicate, Predicate<BlockPos> posPredicate, PoiManager.Occupancy status, BlockPos pos, int distance, RandomSource random) -
release
-
exists
-
getType
-
getFreeTickets
Deprecated. -
sectionsToVillage
-
isVillageCenter
boolean isVillageCenter(long chunkPos) -
tick
- Overrides:
tickin classSectionStorage<PoiSection>
-
setDirty
protected void setDirty(long sectionPos) - Overrides:
setDirtyin classSectionStorage<PoiSection>
-
onSectionLoad
protected void onSectionLoad(long sectionKey) - Overrides:
onSectionLoadin classSectionStorage<PoiSection>
-
checkConsistencyWithBlocks
-
mayHavePoi
-
updateFromSection
private void updateFromSection(LevelChunkSection section, SectionPos sectionPos, BiConsumer<BlockPos, Holder<PoiType>> posToTypeConsumer) -
ensureLoadedAndValid
-