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 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 pInfo, Path pFolder, com.mojang.datafixers.DataFixer pFixerUpper, boolean pSync, RegistryAccess pRegistryAccess, ChunkIOErrorReporter pErrorReporter, LevelHeightAccessor pLevelHeightAccessor) -
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 p_27145_) 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 p_27105_) 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, 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:
tick
in classSectionStorage<PoiSection,
PoiSection.Packed>
-
setDirty
protected void setDirty(long pSectionPos) - Overrides:
setDirty
in classSectionStorage<PoiSection,
PoiSection.Packed>
-
onSectionLoad
protected void onSectionLoad(long p_27145_) - Overrides:
onSectionLoad
in 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
-