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
Modifier and TypeClassDescription(package private) final class
static enum
-
Field Summary
Modifier 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
ConstructorDescriptionPoiManager
(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 p_281731_, LevelChunkSection p_281893_) void
ensureLoadedAndValid
(LevelReader p_27057_, BlockPos p_27058_, int p_27059_) boolean
boolean
existsAtPosition
(ResourceKey<PoiType> p_217875_, BlockPos p_217876_) find
(Predicate<Holder<PoiType>> p_27187_, Predicate<BlockPos> p_27188_, BlockPos p_27189_, int p_27190_, PoiManager.Occupancy p_27191_) findAll
(Predicate<Holder<PoiType>> p_27139_, Predicate<BlockPos> p_27140_, BlockPos p_27141_, int p_27142_, PoiManager.Occupancy p_27143_) findAllClosestFirstWithType
(Predicate<Holder<PoiType>> p_217995_, Predicate<BlockPos> p_217996_, BlockPos p_217997_, int p_217998_, PoiManager.Occupancy p_217999_) findAllWithType
(Predicate<Holder<PoiType>> p_217984_, Predicate<BlockPos> p_217985_, BlockPos p_217986_, int p_217987_, PoiManager.Occupancy p_217988_) findClosest
(Predicate<Holder<PoiType>> p_148659_, Predicate<BlockPos> p_148660_, BlockPos p_148661_, int p_148662_, PoiManager.Occupancy p_148663_) findClosest
(Predicate<Holder<PoiType>> p_27193_, BlockPos p_27194_, int p_27195_, PoiManager.Occupancy p_27196_) findClosestWithType
(Predicate<Holder<PoiType>> p_218003_, BlockPos p_218004_, int p_218005_, PoiManager.Occupancy p_218006_) long
getCountInRange
(Predicate<Holder<PoiType>> p_27122_, BlockPos p_27123_, int p_27124_, PoiManager.Occupancy p_27125_) int
getFreeTickets
(BlockPos p_148654_) Deprecated.getInChunk
(Predicate<Holder<PoiType>> p_27118_, ChunkPos p_27119_, PoiManager.Occupancy p_27120_) getInRange
(Predicate<Holder<PoiType>> p_27182_, BlockPos p_27183_, int p_27184_, PoiManager.Occupancy p_27185_) getInSquare
(Predicate<Holder<PoiType>> p_27167_, BlockPos p_27168_, int p_27169_, PoiManager.Occupancy p_27170_) getRandom
(Predicate<Holder<PoiType>> p_217952_, Predicate<BlockPos> p_217953_, PoiManager.Occupancy p_217954_, BlockPos p_217955_, int p_217956_, RandomSource p_217957_) (package private) boolean
isVillageCenter
(long p_27198_) private static boolean
mayHavePoi
(LevelChunkSection p_27061_) protected void
onSectionLoad
(long p_27145_) boolean
void
int
sectionsToVillage
(SectionPos p_27099_) protected void
setDirty
(long p_27036_) take
(Predicate<Holder<PoiType>> p_217947_, BiPredicate<Holder<PoiType>, BlockPos> p_217948_, BlockPos p_217949_, int p_217950_) void
tick
(BooleanSupplier p_27105_) private void
updateFromSection
(LevelChunkSection p_27070_, SectionPos p_27071_, BiConsumer<BlockPos, Holder<PoiType>> p_27072_) 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>> p_27122_, BlockPos p_27123_, int p_27124_, PoiManager.Occupancy p_27125_) -
existsAtPosition
-
getInSquare
-
getInRange
-
getInChunk
-
findAll
-
findAllWithType
-
findAllClosestFirstWithType
-
find
-
findClosest
-
findClosestWithType
-
findClosest
-
take
-
getRandom
public Optional<BlockPos> getRandom(Predicate<Holder<PoiType>> p_217952_, Predicate<BlockPos> p_217953_, PoiManager.Occupancy p_217954_, BlockPos p_217955_, int p_217956_, RandomSource p_217957_) -
release
-
exists
-
getType
-
getFreeTickets
Deprecated. -
sectionsToVillage
-
isVillageCenter
boolean isVillageCenter(long p_27198_) -
tick
- Overrides:
tick
in classSectionStorage<PoiSection>
-
setDirty
protected void setDirty(long p_27036_) - Overrides:
setDirty
in classSectionStorage<PoiSection>
-
onSectionLoad
protected void onSectionLoad(long p_27145_) - Overrides:
onSectionLoad
in classSectionStorage<PoiSection>
-
checkConsistencyWithBlocks
-
mayHavePoi
-
updateFromSection
private void updateFromSection(LevelChunkSection p_27070_, SectionPos p_27071_, BiConsumer<BlockPos, Holder<PoiType>> p_27072_) -
ensureLoadedAndValid
-