[Changes] Simplified Method to find POIs in a region

This commit is contained in:
Frank 2022-12-11 11:58:07 +01:00
parent 0d21df3b5e
commit 2f8ae6b418

View file

@ -56,6 +56,20 @@ public class BCLPoiType {
return findPoiAround(key, level, center, wideSearch, worldBorder); return findPoiAround(key, level, center, wideSearch, worldBorder);
} }
public Optional<BlockPos> findClosest(
ServerLevel level,
BlockPos center,
int radius
) {
return level.getPoiManager().findClosest(
holder -> holder.is(this.key),
(pos) -> true,
center,
radius,
PoiManager.Occupancy.ANY
);
}
public Optional<BlockPos> findPoiAround( public Optional<BlockPos> findPoiAround(
ServerLevel level, ServerLevel level,
BlockPos center, BlockPos center,