Class PMWUtils

java.lang.Object
net.nullved.pmweatherapi.util.PMWUtils

public class PMWUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isCornerAdjacent(net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b)
    Checks if two BlockPos are corner-adjacent
    static boolean
    isRadarAdjacent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim, net.minecraft.core.BlockPos pos)
    Determines if a radar is next to the given BlockPos
    static boolean
    isRadarAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Determines if a radar is next to the given BlockPos
    static boolean
    isRadarCornerAdjacent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim, net.minecraft.core.BlockPos pos)
    Determines if a radar is within 1 block, including diagonally, to the given BlockPos
    static boolean
    isRadarCornerAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Determines if a radar is within 1 block, including diagonally, to the given BlockPos.
    static <D extends StorageData>
    Set<D>
    storageCornerAdjacent(IStorage<D> storage, net.minecraft.core.BlockPos pos)
    Gets all BlockPos in a IStorage that are corner-adjacent to the base BlockPos
    static Set<net.minecraft.core.BlockPos>
    testAround(net.minecraft.core.BlockPos pos, Function<net.minecraft.core.BlockPos,Boolean> test)
    Performs a Function for each BlockPos around a BlockPos

    Methods inherited from class java.lang.Object

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

    • PMWUtils

      public PMWUtils()
  • Method Details

    • isCornerAdjacent

      public static boolean isCornerAdjacent(net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b)
      Checks if two BlockPos are corner-adjacent
      Parameters:
      a - A BlockPos
      b - Another BlockPos
      Returns:
      true if they are corner-adjacent
    • testAround

      public static Set<net.minecraft.core.BlockPos> testAround(net.minecraft.core.BlockPos pos, Function<net.minecraft.core.BlockPos,Boolean> test)
      Performs a Function for each BlockPos around a BlockPos
      Parameters:
      pos - The base BlockPos
      test - The test
      Returns:
      A Set of BlockPos that passed the test
    • storageCornerAdjacent

      public static <D extends StorageData> Set<D> storageCornerAdjacent(IStorage<D> storage, net.minecraft.core.BlockPos pos)
      Gets all BlockPos in a IStorage that are corner-adjacent to the base BlockPos
      Parameters:
      storage - The IStorage to check in
      pos - The base BlockPos
      Returns:
      A Set of BlockPos that are in the IStorage around the base BlockPos
      Since:
      0.15.3.3
    • isRadarAdjacent

      public static boolean isRadarAdjacent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim, net.minecraft.core.BlockPos pos)
      Determines if a radar is next to the given BlockPos
      Parameters:
      dim - The dimension to search in
      pos - The BlockPos to look by
      Returns:
      true if there is a radar adjacent to this block, false otherwise
      Since:
      0.14.16.2
    • isRadarAdjacent

      public static boolean isRadarAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Determines if a radar is next to the given BlockPos
      Parameters:
      level - The Level to search in
      pos - The BlockPos to look by
      Returns:
      true if there is a radar adjacent to this block, false otherwise
      Since:
      0.14.16.2
    • isRadarCornerAdjacent

      public static boolean isRadarCornerAdjacent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim, net.minecraft.core.BlockPos pos)
      Determines if a radar is within 1 block, including diagonally, to the given BlockPos
      Parameters:
      dim - The dimension to search in
      pos - The BlockPos to look by
      Returns:
      true if there is a radar adjacent to this block, false otherwise
      Since:
      0.15.3.3
    • isRadarCornerAdjacent

      public static boolean isRadarCornerAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Determines if a radar is within 1 block, including diagonally, to the given BlockPos.
      Parameters:
      level - The Level to search in
      pos - The BlockPos to look by
      Returns:
      true if there is a radar adjacent to this block, false otherwise
      Since:
      0.15.3.3