Class PoiSearcher

java.lang.Object
nokunami.floral_warfare.common.gardenOps.PoiSearcher

public class PoiSearcher extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    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 boolean
    getNearbyActiveGardens(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, ZenBeaconBlockEntity blockEntity)
     
    static boolean
    getNearbyActiveGardens(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 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.
    static int
    getSectionDistanceForGarden(net.minecraft.server.level.ServerLevel level, net.minecraft.core.SectionPos startSection)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public 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)
    • getAllNearby

      public 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)
    • getClosestNearby

      public 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)
    • 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)