Package net.minecraft.village
Class PointOfInterestManager
- java.lang.Object
-
- net.minecraft.world.chunk.storage.RegionSectionCache<PointOfInterestData>
-
- net.minecraft.village.PointOfInterestManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PointOfInterestManager extends RegionSectionCache<PointOfInterestData>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
PointOfInterestManager.DistanceGraph
static class
PointOfInterestManager.Status
-
Field Summary
Fields Modifier and Type Field Description private PointOfInterestManager.DistanceGraph
distanceTracker
private it.unimi.dsi.fastutil.longs.LongSet
loadedChunks
-
Constructor Summary
Constructors Constructor Description PointOfInterestManager(java.io.File p_i231554_1_, com.mojang.datafixers.DataFixer p_i231554_2_, boolean p_i231554_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BlockPos p_219135_1_, PointOfInterestType p_219135_2_)
void
checkConsistencyWithBlocks(ChunkPos p_219139_1_, ChunkSection p_219139_2_)
void
ensureLoadedAndValid(IWorldReader p_226347_1_, BlockPos p_226347_2_, int p_226347_3_)
boolean
exists(BlockPos p_219138_1_, java.util.function.Predicate<PointOfInterestType> p_219138_2_)
boolean
existsAtPosition(PointOfInterestType p_234135_1_, BlockPos p_234135_2_)
java.util.Optional<BlockPos>
find(java.util.function.Predicate<PointOfInterestType> p_219127_1_, java.util.function.Predicate<BlockPos> p_219127_2_, BlockPos p_219127_3_, int p_219127_4_, PointOfInterestManager.Status p_219127_5_)
java.util.stream.Stream<BlockPos>
findAll(java.util.function.Predicate<PointOfInterestType> p_225399_1_, java.util.function.Predicate<BlockPos> p_225399_2_, BlockPos p_225399_3_, int p_225399_4_, PointOfInterestManager.Status p_225399_5_)
java.util.stream.Stream<BlockPos>
findAllClosestFirst(java.util.function.Predicate<PointOfInterestType> p_242324_1_, java.util.function.Predicate<BlockPos> p_242324_2_, BlockPos p_242324_3_, int p_242324_4_, PointOfInterestManager.Status p_242324_5_)
java.util.Optional<BlockPos>
findClosest(java.util.function.Predicate<PointOfInterestType> p_234148_1_, BlockPos p_234148_2_, int p_234148_3_, PointOfInterestManager.Status p_234148_4_)
long
getCountInRange(java.util.function.Predicate<PointOfInterestType> p_219145_1_, BlockPos p_219145_2_, int p_219145_3_, PointOfInterestManager.Status p_219145_4_)
java.util.stream.Stream<PointOfInterest>
getInChunk(java.util.function.Predicate<PointOfInterestType> p_219137_1_, ChunkPos p_219137_2_, PointOfInterestManager.Status p_219137_3_)
java.util.stream.Stream<PointOfInterest>
getInRange(java.util.function.Predicate<PointOfInterestType> p_219146_1_, BlockPos p_219146_2_, int p_219146_3_, PointOfInterestManager.Status p_219146_4_)
java.util.stream.Stream<PointOfInterest>
getInSquare(java.util.function.Predicate<PointOfInterestType> p_226353_1_, BlockPos p_226353_2_, int p_226353_3_, PointOfInterestManager.Status p_226353_4_)
java.util.Optional<BlockPos>
getRandom(java.util.function.Predicate<PointOfInterestType> p_219163_1_, java.util.function.Predicate<BlockPos> p_219163_2_, PointOfInterestManager.Status p_219163_3_, BlockPos p_219163_4_, int p_219163_5_, java.util.Random p_219163_6_)
java.util.Optional<PointOfInterestType>
getType(BlockPos p_219148_1_)
private boolean
isVillageCenter(long p_219154_1_)
private static boolean
mayHavePoi(ChunkSection p_219151_0_)
protected void
onSectionLoad(long p_219111_1_)
boolean
release(BlockPos p_219142_1_)
void
remove(BlockPos p_219140_1_)
int
sectionsToVillage(SectionPos p_219150_1_)
protected void
setDirty(long p_219116_1_)
java.util.Optional<BlockPos>
take(java.util.function.Predicate<PointOfInterestType> p_219157_1_, java.util.function.Predicate<BlockPos> p_219157_2_, BlockPos p_219157_3_, int p_219157_4_)
void
tick(java.util.function.BooleanSupplier p_219115_1_)
private void
updateFromSection(ChunkSection p_219132_1_, SectionPos p_219132_2_, java.util.function.BiConsumer<BlockPos,PointOfInterestType> p_219132_3_)
-
Methods inherited from class net.minecraft.world.chunk.storage.RegionSectionCache
close, flush, get, getOrCreate, getOrLoad, outsideStoredRange
-
-
-
-
Field Detail
-
distanceTracker
private final PointOfInterestManager.DistanceGraph distanceTracker
-
loadedChunks
private final it.unimi.dsi.fastutil.longs.LongSet loadedChunks
-
-
Method Detail
-
add
public void add(BlockPos p_219135_1_, PointOfInterestType p_219135_2_)
-
remove
public void remove(BlockPos p_219140_1_)
-
getCountInRange
public long getCountInRange(java.util.function.Predicate<PointOfInterestType> p_219145_1_, BlockPos p_219145_2_, int p_219145_3_, PointOfInterestManager.Status p_219145_4_)
-
existsAtPosition
public boolean existsAtPosition(PointOfInterestType p_234135_1_, BlockPos p_234135_2_)
-
getInSquare
public java.util.stream.Stream<PointOfInterest> getInSquare(java.util.function.Predicate<PointOfInterestType> p_226353_1_, BlockPos p_226353_2_, int p_226353_3_, PointOfInterestManager.Status p_226353_4_)
-
getInRange
public java.util.stream.Stream<PointOfInterest> getInRange(java.util.function.Predicate<PointOfInterestType> p_219146_1_, BlockPos p_219146_2_, int p_219146_3_, PointOfInterestManager.Status p_219146_4_)
-
getInChunk
public java.util.stream.Stream<PointOfInterest> getInChunk(java.util.function.Predicate<PointOfInterestType> p_219137_1_, ChunkPos p_219137_2_, PointOfInterestManager.Status p_219137_3_)
-
findAll
public java.util.stream.Stream<BlockPos> findAll(java.util.function.Predicate<PointOfInterestType> p_225399_1_, java.util.function.Predicate<BlockPos> p_225399_2_, BlockPos p_225399_3_, int p_225399_4_, PointOfInterestManager.Status p_225399_5_)
-
findAllClosestFirst
public java.util.stream.Stream<BlockPos> findAllClosestFirst(java.util.function.Predicate<PointOfInterestType> p_242324_1_, java.util.function.Predicate<BlockPos> p_242324_2_, BlockPos p_242324_3_, int p_242324_4_, PointOfInterestManager.Status p_242324_5_)
-
find
public java.util.Optional<BlockPos> find(java.util.function.Predicate<PointOfInterestType> p_219127_1_, java.util.function.Predicate<BlockPos> p_219127_2_, BlockPos p_219127_3_, int p_219127_4_, PointOfInterestManager.Status p_219127_5_)
-
findClosest
public java.util.Optional<BlockPos> findClosest(java.util.function.Predicate<PointOfInterestType> p_234148_1_, BlockPos p_234148_2_, int p_234148_3_, PointOfInterestManager.Status p_234148_4_)
-
take
public java.util.Optional<BlockPos> take(java.util.function.Predicate<PointOfInterestType> p_219157_1_, java.util.function.Predicate<BlockPos> p_219157_2_, BlockPos p_219157_3_, int p_219157_4_)
-
getRandom
public java.util.Optional<BlockPos> getRandom(java.util.function.Predicate<PointOfInterestType> p_219163_1_, java.util.function.Predicate<BlockPos> p_219163_2_, PointOfInterestManager.Status p_219163_3_, BlockPos p_219163_4_, int p_219163_5_, java.util.Random p_219163_6_)
-
release
public boolean release(BlockPos p_219142_1_)
-
exists
public boolean exists(BlockPos p_219138_1_, java.util.function.Predicate<PointOfInterestType> p_219138_2_)
-
getType
public java.util.Optional<PointOfInterestType> getType(BlockPos p_219148_1_)
-
sectionsToVillage
public int sectionsToVillage(SectionPos p_219150_1_)
-
isVillageCenter
private boolean isVillageCenter(long p_219154_1_)
-
tick
public void tick(java.util.function.BooleanSupplier p_219115_1_)
- Overrides:
tick
in classRegionSectionCache<PointOfInterestData>
-
setDirty
protected void setDirty(long p_219116_1_)
- Overrides:
setDirty
in classRegionSectionCache<PointOfInterestData>
-
onSectionLoad
protected void onSectionLoad(long p_219111_1_)
- Overrides:
onSectionLoad
in classRegionSectionCache<PointOfInterestData>
-
checkConsistencyWithBlocks
public void checkConsistencyWithBlocks(ChunkPos p_219139_1_, ChunkSection p_219139_2_)
-
mayHavePoi
private static boolean mayHavePoi(ChunkSection p_219151_0_)
-
updateFromSection
private void updateFromSection(ChunkSection p_219132_1_, SectionPos p_219132_2_, java.util.function.BiConsumer<BlockPos,PointOfInterestType> p_219132_3_)
-
ensureLoadedAndValid
public void ensureLoadedAndValid(IWorldReader p_226347_1_, BlockPos p_226347_2_, int p_226347_3_)
-
-