Class PoiSearcher
java.lang.Object
nokunami.floral_warfare.common.gardenOps.PoiSearcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stream<net.minecraft.core.BlockPos>getAllNearby(net.minecraft.server.level.ServerLevel level, Predicate<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> poiPredicate, net.minecraft.core.SectionPos startSection) static Stream<net.minecraft.core.BlockPos>getAllNearby(net.minecraft.server.level.ServerLevel level, Predicate<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> poiPredicate, net.minecraft.core.SectionPos startSection, int distance) static Optional<net.minecraft.core.BlockPos>getClosestNearby(net.minecraft.server.level.ServerLevel level, Predicate<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> poiPredicate, net.minecraft.core.SectionPos startSection) static Optional<net.minecraft.core.BlockPos>getFoundPos(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection) static booleangetNearbyActiveGardens(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, ZenBeaconBlockEntity blockEntity) static booleangetNearbyActiveGardens(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection, ZenBeaconBlockEntity blockEntity) static Optional<net.minecraft.core.BlockPos>getNearbyBeacon(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection) static intgetSectionDistance(net.minecraft.server.level.ServerLevel level, Predicate<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> poiPredicate, net.minecraft.core.SectionPos startSection) Finds the nearest POI matching the predicate and returns the distance in sections.static intgetSectionDistanceForGarden(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection)
-
Constructor Details
-
PoiSearcher
public PoiSearcher()
-
-
Method Details
-
getSectionDistance
public static int getSectionDistance(net.minecraft.server.level.ServerLevel level, Predicate<net.minecraft.core.Holder<net.minecraft.world.entity.ai.village.poi.PoiType>> poiPredicate, net.minecraft.core.SectionPos startSection) Finds the nearest POI matching the predicate and returns the distance in sections. * @param level The ServerLevel- Parameters:
poiPredicate- The filter (e.g., type -> type.is(PoiTypes.HOME))startSection- The SectionPos to start the search from- Returns:
- The distance in sections as an int, or -1 if not found.
-
getFoundPos
public static Optional<net.minecraft.core.BlockPos> getFoundPos(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection) -
getAllNearby
-
getAllNearby
-
getClosestNearby
-
getSectionDistanceForGarden
public static int getSectionDistanceForGarden(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection) -
getNearbyActiveGardens
public static boolean getNearbyActiveGardens(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, ZenBeaconBlockEntity blockEntity) -
getNearbyActiveGardens
public static boolean getNearbyActiveGardens(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection, ZenBeaconBlockEntity blockEntity) -
getNearbyBeacon
public static Optional<net.minecraft.core.BlockPos> getNearbyBeacon(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection)
-