Package net.nullved.pmweatherapi.util
Class PMWUtils
java.lang.Object
net.nullved.pmweatherapi.util.PMWUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCornerAdjacent(net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) Checks if twoBlockPosare corner-adjacentstatic booleanisRadarAdjacent(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim, net.minecraft.core.BlockPos pos) Determines if a radar is next to the givenBlockPosstatic booleanisRadarAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Determines if a radar is next to the givenBlockPosstatic booleanisRadarCornerAdjacent(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 givenBlockPosstatic booleanisRadarCornerAdjacent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Determines if a radar is within 1 block, including diagonally, to the givenBlockPos.static <D extends StorageData>
Set<D> storageCornerAdjacent(IStorage<D> storage, net.minecraft.core.BlockPos pos) static Set<net.minecraft.core.BlockPos> testAround(net.minecraft.core.BlockPos pos, Function<net.minecraft.core.BlockPos, Boolean> test)
-
Constructor Details
-
PMWUtils
public PMWUtils()
-
-
Method Details
-
isCornerAdjacent
public static boolean isCornerAdjacent(net.minecraft.core.BlockPos a, net.minecraft.core.BlockPos b) Checks if twoBlockPosare corner-adjacent- Parameters:
a- ABlockPosb- AnotherBlockPos- Returns:
trueif 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) - Parameters:
pos- The baseBlockPostest- The test- Returns:
- A
SetofBlockPosthat passed the test
-
storageCornerAdjacent
public static <D extends StorageData> Set<D> storageCornerAdjacent(IStorage<D> storage, net.minecraft.core.BlockPos pos) -
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 givenBlockPos- Parameters:
dim- The dimension to search inpos- TheBlockPosto look by- Returns:
trueif there is a radar adjacent to this block,falseotherwise- 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 givenBlockPos- Parameters:
level- TheLevelto search inpos- TheBlockPosto look by- Returns:
trueif there is a radar adjacent to this block,falseotherwise- 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 givenBlockPos- Parameters:
dim- The dimension to search inpos- TheBlockPosto look by- Returns:
trueif there is a radar adjacent to this block,falseotherwise- 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 givenBlockPos.- Parameters:
level- TheLevelto search inpos- TheBlockPosto look by- Returns:
trueif there is a radar adjacent to this block,falseotherwise- Since:
- 0.15.3.3
-