[Changes] Simplified Method to find POIs in a region
This commit is contained in:
parent
0d21df3b5e
commit
2f8ae6b418
1 changed files with 14 additions and 0 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue