Class NearbyRadars

java.lang.Object
net.nullved.pmweatherapi.radar.NearbyRadars

public class NearbyRadars extends Object
Get all the radars within a given radius around a BlockPos or ChunkPos
Since:
0.14.15.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the NearbyRadars instance for the client
    void
    forRadarNearBlock(net.minecraft.core.BlockPos block, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
    Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the block
    void
    forRadarNearChunk(net.minecraft.world.level.ChunkPos chunk, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
    Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the center of the chunk
    void
    forRadarNearPlayer(net.minecraft.world.entity.player.Player player, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
    Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the Player
    get(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
    Get NearbyRadars for the given dimension
    get(net.minecraft.world.level.Level level)
    Get NearbyRadars for the given level
    Set<net.minecraft.core.BlockPos>
    radarsNearBlock(net.minecraft.core.BlockPos pos, double radius)
    Returns a Set of the BlockPos of RadarBlocks in a defined radius around the block
    Set<net.minecraft.core.BlockPos>
    radarsNearChunk(net.minecraft.world.level.ChunkPos pos, double radius)
    Returns a Set of the BlockPos of RadarBlocks in a defined radius around the center of the chunk
    Set<net.minecraft.core.BlockPos>
    radarsNearPlayer(net.minecraft.world.entity.player.Player player, double radius)
    Returns a Set of the BlockPos of RadarBlocks in a defined radius around the Player

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • client

      public static NearbyRadars client()
      Get the NearbyRadars instance for the client
      Returns:
      The client-specific NearbyRadars instance
      Since:
      0.14.15.3
    • get

      public static NearbyRadars get(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
      Get NearbyRadars for the given dimension
      Parameters:
      dim - The ResourceKey of the dimension
      Returns:
      A NearbyRadars instance
      Since:
      0.14.15.3
    • get

      public static NearbyRadars get(net.minecraft.world.level.Level level)
      Get NearbyRadars for the given level
      Parameters:
      level - The Level with the storms
      Returns:
      A NearbyRadars instance
      Since:
      0.14.15.3
    • radarsNearBlock

      public Set<net.minecraft.core.BlockPos> radarsNearBlock(net.minecraft.core.BlockPos pos, double radius)
      Returns a Set of the BlockPos of RadarBlocks in a defined radius around the block
      Parameters:
      pos - The BlockPos of the block at the center of the search area
      radius - The radius of the search area
      Returns:
      A Set of BlockPos around, but not including, the given BlockPos
      Since:
      0.14.15.1
    • radarsNearChunk

      public Set<net.minecraft.core.BlockPos> radarsNearChunk(net.minecraft.world.level.ChunkPos pos, double radius)
      Returns a Set of the BlockPos of RadarBlocks in a defined radius around the center of the chunk
      Parameters:
      pos - The ChunkPos of the chunk
      radius - The radius of the search area
      Returns:
      A Set of BlockPos
      Since:
      0.14.15.1
    • radarsNearPlayer

      public Set<net.minecraft.core.BlockPos> radarsNearPlayer(net.minecraft.world.entity.player.Player player, double radius)
      Returns a Set of the BlockPos of RadarBlocks in a defined radius around the Player
      Parameters:
      player - The Player to search around
      radius - The radius of the search area
      Returns:
      A Set of BlockPos around, but not including, the given BlockPos
      Since:
      0.14.15.4
    • forRadarNearBlock

      public void forRadarNearBlock(net.minecraft.core.BlockPos block, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
      Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the block
      Parameters:
      block - The BlockPos of the block at the center of the search area
      radius - The radius of the search area
      consumer - The Consumer to execute for each BlockPos
      Since:
      0.14.15.1
    • forRadarNearChunk

      public void forRadarNearChunk(net.minecraft.world.level.ChunkPos chunk, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
      Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the center of the chunk
      Parameters:
      chunk - The ChunkPos of the chunk at the center of the search area.
      radius - The radius of the search area
      consumer - The Consumer to execute for each BlockPos
      Since:
      0.14.15.0
    • forRadarNearPlayer

      public void forRadarNearPlayer(net.minecraft.world.entity.player.Player player, double radius, Consumer<net.minecraft.core.BlockPos> consumer)
      Executes the given Consumer for each BlockPos of a RadarBlock in a defined radius around the Player
      Parameters:
      player - The Player to search around
      radius - The radius of the search area
      consumer - The Consumer to execute for each BlockPos
      Since:
      0.14.15.4