Class BlockPos

java.lang.Object
net.minecraft.util.math.Vec3i
net.minecraft.util.math.BlockPos
All Implemented Interfaces:
Comparable<Vec3i>
Direct Known Subclasses:
BlockPos.Mutable

@Immutable
public class BlockPos
extends Vec3i
Represents the position of a block in a three-dimensional volume.

The position is integer-valued.

A block position may be mutable; hence, when using block positions obtained from other places as map keys, etc., you should call toImmutable() to obtain an immutable block position.

Mappings:
Namespace Name
official fx
intermediary net/minecraft/class_2338
named net/minecraft/util/math/BlockPos
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<BlockPos> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a:Lcom/mojang/serialization/Codec;
      intermediary field_25064 Lnet/minecraft/class_2338;field_25064:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/util/math/BlockPos;CODEC:Lcom/mojang/serialization/Codec;
    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official f Lfx;f:Lorg/apache/logging/log4j/Logger;
      intermediary field_18789 Lnet/minecraft/class_2338;field_18789:Lorg/apache/logging/log4j/Logger;
      named LOGGER Lnet/minecraft/util/math/BlockPos;LOGGER:Lorg/apache/logging/log4j/Logger;
    • ORIGIN

      public static final BlockPos ORIGIN
      The block position which x, y, and z values are all zero.
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b:Lfx;
      intermediary field_10980 Lnet/minecraft/class_2338;field_10980:Lnet/minecraft/class_2338;
      named ORIGIN Lnet/minecraft/util/math/BlockPos;ORIGIN:Lnet/minecraft/util/math/BlockPos;
    • SIZE_BITS_X

      private static final int SIZE_BITS_X
      Mappings:
      Namespace Name Mixin selector
      official g Lfx;g:I
      intermediary field_10978 Lnet/minecraft/class_2338;field_10978:I
      named SIZE_BITS_X Lnet/minecraft/util/math/BlockPos;SIZE_BITS_X:I
    • SIZE_BITS_Z

      private static final int SIZE_BITS_Z
      Mappings:
      Namespace Name Mixin selector
      official h Lfx;h:I
      intermediary field_10977 Lnet/minecraft/class_2338;field_10977:I
      named SIZE_BITS_Z Lnet/minecraft/util/math/BlockPos;SIZE_BITS_Z:I
    • SIZE_BITS_Y

      public static final int SIZE_BITS_Y
      Mappings:
      Namespace Name Mixin selector
      official c Lfx;c:I
      intermediary field_10975 Lnet/minecraft/class_2338;field_10975:I
      named SIZE_BITS_Y Lnet/minecraft/util/math/BlockPos;SIZE_BITS_Y:I
    • BITS_X

      private static final long BITS_X
      Mappings:
      Namespace Name Mixin selector
      official i Lfx;i:J
      intermediary field_10976 Lnet/minecraft/class_2338;field_10976:J
      named BITS_X Lnet/minecraft/util/math/BlockPos;BITS_X:J
    • BITS_Y

      private static final long BITS_Y
      Mappings:
      Namespace Name Mixin selector
      official j Lfx;j:J
      intermediary field_10974 Lnet/minecraft/class_2338;field_10974:J
      named BITS_Y Lnet/minecraft/util/math/BlockPos;BITS_Y:J
    • BITS_Z

      private static final long BITS_Z
      Mappings:
      Namespace Name Mixin selector
      official k Lfx;k:J
      intermediary field_10973 Lnet/minecraft/class_2338;field_10973:J
      named BITS_Z Lnet/minecraft/util/math/BlockPos;BITS_Z:J
    • BIT_SHIFT_Z

      private static final int BIT_SHIFT_Z
      Mappings:
      Namespace Name Mixin selector
      official l Lfx;l:I
      intermediary field_10983 Lnet/minecraft/class_2338;field_10983:I
      named BIT_SHIFT_Z Lnet/minecraft/util/math/BlockPos;BIT_SHIFT_Z:I
    • BIT_SHIFT_X

      private static final int BIT_SHIFT_X
      Mappings:
      Namespace Name Mixin selector
      official m Lfx;m:I
      intermediary field_10981 Lnet/minecraft/class_2338;field_10981:I
      named BIT_SHIFT_X Lnet/minecraft/util/math/BlockPos;BIT_SHIFT_X:I
  • Constructor Details

    • BlockPos

      public BlockPos​(int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lgs;<init>(III)V
      intermediary <init> Lnet/minecraft/class_2382;<init>(III)V
      named <init> Lnet/minecraft/util/math/Vec3i;<init>(III)V
    • BlockPos

      public BlockPos​(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lgs;<init>(DDD)V
      intermediary <init> Lnet/minecraft/class_2382;<init>(DDD)V
      named <init> Lnet/minecraft/util/math/Vec3i;<init>(DDD)V
    • BlockPos

      public BlockPos​(Vec3d pos)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lfx;<init>(Ldiu;)V
      intermediary <init> Lnet/minecraft/class_2338;<init>(Lnet/minecraft/class_243;)V
      named <init> Lnet/minecraft/util/math/BlockPos;<init>(Lnet/minecraft/util/math/Vec3d;)V
    • BlockPos

      public BlockPos​(Position pos)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lfx;<init>(Lgk;)V
      intermediary <init> Lnet/minecraft/class_2338;<init>(Lnet/minecraft/class_2374;)V
      named <init> Lnet/minecraft/util/math/BlockPos;<init>(Lnet/minecraft/util/math/Position;)V
    • BlockPos

      public BlockPos​(Vec3i pos)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lfx;<init>(Lgs;)V
      intermediary <init> Lnet/minecraft/class_2338;<init>(Lnet/minecraft/class_2382;)V
      named <init> Lnet/minecraft/util/math/BlockPos;<init>(Lnet/minecraft/util/math/Vec3i;)V
  • Method Details

    • offset

      public static long offset​(long value, Direction direction)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(JLgc;)J
      intermediary method_10060 Lnet/minecraft/class_2338;method_10060(JLnet/minecraft/class_2350;)J
      named offset Lnet/minecraft/util/math/BlockPos;offset(JLnet/minecraft/util/math/Direction;)J
    • add

      public static long add​(long value, int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(JIII)J
      intermediary method_10096 Lnet/minecraft/class_2338;method_10096(JIII)J
      named add Lnet/minecraft/util/math/BlockPos;add(JIII)J
    • unpackLongX

      public static int unpackLongX​(long packedPos)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(J)I
      intermediary method_10061 Lnet/minecraft/class_2338;method_10061(J)I
      named unpackLongX Lnet/minecraft/util/math/BlockPos;unpackLongX(J)I
    • unpackLongY

      public static int unpackLongY​(long packedPos)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(J)I
      intermediary method_10071 Lnet/minecraft/class_2338;method_10071(J)I
      named unpackLongY Lnet/minecraft/util/math/BlockPos;unpackLongY(J)I
    • unpackLongZ

      public static int unpackLongZ​(long packedPos)
      Mappings:
      Namespace Name Mixin selector
      official c Lfx;c(J)I
      intermediary method_10083 Lnet/minecraft/class_2338;method_10083(J)I
      named unpackLongZ Lnet/minecraft/util/math/BlockPos;unpackLongZ(J)I
    • fromLong

      public static BlockPos fromLong​(long packedPos)
      Mappings:
      Namespace Name Mixin selector
      official d Lfx;d(J)Lfx;
      intermediary method_10092 Lnet/minecraft/class_2338;method_10092(J)Lnet/minecraft/class_2338;
      named fromLong Lnet/minecraft/util/math/BlockPos;fromLong(J)Lnet/minecraft/util/math/BlockPos;
    • asLong

      public long asLong()
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a()J
      intermediary method_10063 Lnet/minecraft/class_2338;method_10063()J
      named asLong Lnet/minecraft/util/math/BlockPos;asLong()J
    • asLong

      public static long asLong​(int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(III)J
      intermediary method_10064 Lnet/minecraft/class_2338;method_10064(III)J
      named asLong Lnet/minecraft/util/math/BlockPos;asLong(III)J
    • removeChunkSectionLocalY

      public static long removeChunkSectionLocalY​(long y)
      Mappings:
      Namespace Name Mixin selector
      official e Lfx;e(J)J
      intermediary method_10091 Lnet/minecraft/class_2338;method_10091(J)J
      named removeChunkSectionLocalY Lnet/minecraft/util/math/BlockPos;removeChunkSectionLocalY(J)J
    • add

      public BlockPos add​(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(DDD)Lfx;
      intermediary method_10080 Lnet/minecraft/class_2338;method_10080(DDD)Lnet/minecraft/class_2338;
      named add Lnet/minecraft/util/math/BlockPos;add(DDD)Lnet/minecraft/util/math/BlockPos;
    • add

      public BlockPos add​(int x, int y, int z)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(III)Lfx;
      intermediary method_10069 Lnet/minecraft/class_2338;method_10069(III)Lnet/minecraft/class_2338;
      named add Lnet/minecraft/util/math/BlockPos;add(III)Lnet/minecraft/util/math/BlockPos;
    • add

      public BlockPos add​(Vec3i pos)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lgs;)Lfx;
      intermediary method_10081 Lnet/minecraft/class_2338;method_10081(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2338;
      named add Lnet/minecraft/util/math/BlockPos;add(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockPos;
    • subtract

      public BlockPos subtract​(Vec3i pos)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(Lgs;)Lfx;
      intermediary method_10059 Lnet/minecraft/class_2338;method_10059(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2338;
      named subtract Lnet/minecraft/util/math/BlockPos;subtract(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockPos;
    • up

      public BlockPos up()
      Overrides:
      up in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b()Lfx;
      intermediary method_10084 Lnet/minecraft/class_2338;method_10084()Lnet/minecraft/class_2338;
      named up Lnet/minecraft/util/math/BlockPos;up()Lnet/minecraft/util/math/BlockPos;
    • up

      public BlockPos up​(int distance)
      Overrides:
      up in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(I)Lfx;
      intermediary method_10086 Lnet/minecraft/class_2338;method_10086(I)Lnet/minecraft/class_2338;
      named up Lnet/minecraft/util/math/BlockPos;up(I)Lnet/minecraft/util/math/BlockPos;
    • down

      public BlockPos down()
      Overrides:
      down in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official c Lfx;c()Lfx;
      intermediary method_10074 Lnet/minecraft/class_2338;method_10074()Lnet/minecraft/class_2338;
      named down Lnet/minecraft/util/math/BlockPos;down()Lnet/minecraft/util/math/BlockPos;
    • down

      public BlockPos down​(int int2)
      Overrides:
      down in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official c Lfx;c(I)Lfx;
      intermediary method_10087 Lnet/minecraft/class_2338;method_10087(I)Lnet/minecraft/class_2338;
      named down Lnet/minecraft/util/math/BlockPos;down(I)Lnet/minecraft/util/math/BlockPos;
    • north

      public BlockPos north()
      Mappings:
      Namespace Name Mixin selector
      official d Lfx;d()Lfx;
      intermediary method_10095 Lnet/minecraft/class_2338;method_10095()Lnet/minecraft/class_2338;
      named north Lnet/minecraft/util/math/BlockPos;north()Lnet/minecraft/util/math/BlockPos;
    • north

      public BlockPos north​(int distance)
      Mappings:
      Namespace Name Mixin selector
      official d Lfx;d(I)Lfx;
      intermediary method_10076 Lnet/minecraft/class_2338;method_10076(I)Lnet/minecraft/class_2338;
      named north Lnet/minecraft/util/math/BlockPos;north(I)Lnet/minecraft/util/math/BlockPos;
    • south

      public BlockPos south()
      Mappings:
      Namespace Name Mixin selector
      official e Lfx;e()Lfx;
      intermediary method_10072 Lnet/minecraft/class_2338;method_10072()Lnet/minecraft/class_2338;
      named south Lnet/minecraft/util/math/BlockPos;south()Lnet/minecraft/util/math/BlockPos;
    • south

      public BlockPos south​(int distance)
      Mappings:
      Namespace Name Mixin selector
      official e Lfx;e(I)Lfx;
      intermediary method_10077 Lnet/minecraft/class_2338;method_10077(I)Lnet/minecraft/class_2338;
      named south Lnet/minecraft/util/math/BlockPos;south(I)Lnet/minecraft/util/math/BlockPos;
    • west

      public BlockPos west()
      Mappings:
      Namespace Name Mixin selector
      official f Lfx;f()Lfx;
      intermediary method_10067 Lnet/minecraft/class_2338;method_10067()Lnet/minecraft/class_2338;
      named west Lnet/minecraft/util/math/BlockPos;west()Lnet/minecraft/util/math/BlockPos;
    • west

      public BlockPos west​(int distance)
      Mappings:
      Namespace Name Mixin selector
      official f Lfx;f(I)Lfx;
      intermediary method_10088 Lnet/minecraft/class_2338;method_10088(I)Lnet/minecraft/class_2338;
      named west Lnet/minecraft/util/math/BlockPos;west(I)Lnet/minecraft/util/math/BlockPos;
    • east

      public BlockPos east()
      Mappings:
      Namespace Name Mixin selector
      official g Lfx;g()Lfx;
      intermediary method_10078 Lnet/minecraft/class_2338;method_10078()Lnet/minecraft/class_2338;
      named east Lnet/minecraft/util/math/BlockPos;east()Lnet/minecraft/util/math/BlockPos;
    • east

      public BlockPos east​(int distance)
      Mappings:
      Namespace Name Mixin selector
      official g Lfx;g(I)Lfx;
      intermediary method_10089 Lnet/minecraft/class_2338;method_10089(I)Lnet/minecraft/class_2338;
      named east Lnet/minecraft/util/math/BlockPos;east(I)Lnet/minecraft/util/math/BlockPos;
    • offset

      public BlockPos offset​(Direction direction)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lgc;)Lfx;
      intermediary method_10093 Lnet/minecraft/class_2338;method_10093(Lnet/minecraft/class_2350;)Lnet/minecraft/class_2338;
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/BlockPos;
    • offset

      public BlockPos offset​(Direction direction, int int2)
      Overrides:
      offset in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lgc;I)Lfx;
      intermediary method_10079 Lnet/minecraft/class_2338;method_10079(Lnet/minecraft/class_2350;I)Lnet/minecraft/class_2338;
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction;I)Lnet/minecraft/util/math/BlockPos;
    • offset

      public BlockPos offset​(Direction.Axis axis, int distance)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lgc$a;I)Lfx;
      intermediary method_30513 Lnet/minecraft/class_2338;method_30513(Lnet/minecraft/class_2350$class_2351;I)Lnet/minecraft/class_2338;
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction$Axis;I)Lnet/minecraft/util/math/BlockPos;
    • rotate

      public BlockPos rotate​(BlockRotation rotation)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lccm;)Lfx;
      intermediary method_10070 Lnet/minecraft/class_2338;method_10070(Lnet/minecraft/class_2470;)Lnet/minecraft/class_2338;
      named rotate Lnet/minecraft/util/math/BlockPos;rotate(Lnet/minecraft/util/BlockRotation;)Lnet/minecraft/util/math/BlockPos;
    • crossProduct

      public BlockPos crossProduct​(Vec3i pos)
      Overrides:
      crossProduct in class Vec3i
      Mappings:
      Namespace Name Mixin selector
      official c Lfx;c(Lgs;)Lfx;
      intermediary method_10075 Lnet/minecraft/class_2338;method_10075(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2338;
      named crossProduct Lnet/minecraft/util/math/BlockPos;crossProduct(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockPos;
    • withY

      public BlockPos withY​(int y)
      Mappings:
      Namespace Name Mixin selector
      official h Lfx;h(I)Lfx;
      intermediary method_33096 Lnet/minecraft/class_2338;method_33096(I)Lnet/minecraft/class_2338;
      named withY Lnet/minecraft/util/math/BlockPos;withY(I)Lnet/minecraft/util/math/BlockPos;
    • toImmutable

      public BlockPos toImmutable()
      Returns an immutable block position with the same x, y, and z as this position.

      This method should be called when a block position is used as map keys as to prevent side effects of mutations of mutable block positions.

      Mappings:
      Namespace Name Mixin selector
      official h Lfx;h()Lfx;
      intermediary method_10062 Lnet/minecraft/class_2338;method_10062()Lnet/minecraft/class_2338;
      named toImmutable Lnet/minecraft/util/math/BlockPos;toImmutable()Lnet/minecraft/util/math/BlockPos;
    • mutableCopy

      public BlockPos.Mutable mutableCopy()
      Returns a mutable copy of this block position.

      If this block position is a mutable one, mutation to this block position won't affect the returned position.

      Mappings:
      Namespace Name Mixin selector
      official i Lfx;i()Lfx$a;
      intermediary method_25503 Lnet/minecraft/class_2338;method_25503()Lnet/minecraft/class_2338$class_2339;
      named mutableCopy Lnet/minecraft/util/math/BlockPos;mutableCopy()Lnet/minecraft/util/math/BlockPos$Mutable;
    • iterateRandomly

      public static Iterable<BlockPos> iterateRandomly​(Random random, int count, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
      Iterates through count random block positions in the given area.

      The iterator yields positions in no specific order. The same position may be returned multiple times by the iterator.

      Parameters:
      random - the Random object used to compute new positions
      count - the number of positions to iterate
      minX - the minimum x value for returned positions
      minY - the minimum y value for returned positions
      minZ - the minimum z value for returned positions
      maxX - the maximum x value for returned positions
      maxY - the maximum y value for returned positions
      maxZ - the maximum z value for returned positions
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Ljava/util/Random;IIIIIII)Ljava/lang/Iterable;
      intermediary method_27156 Lnet/minecraft/class_2338;method_27156(Ljava/util/Random;IIIIIII)Ljava/lang/Iterable;
      named iterateRandomly Lnet/minecraft/util/math/BlockPos;iterateRandomly(Ljava/util/Random;IIIIIII)Ljava/lang/Iterable;
    • iterateOutwards

      public static Iterable<BlockPos> iterateOutwards​(BlockPos center, int xRange, int yRange, int zRange)
      Iterates block positions around the center. The iteration order is mainly based on the manhattan distance of the position from the center.

      For the same manhattan distance, the positions are iterated by y offset, from negative to positive. For the same y offset, the positions are iterated by x offset, from negative to positive. For the two positions with the same x and y offsets and the same manhattan distance, the one with a positive z offset is visited first before the one with a negative z offset.

      Parameters:
      center - the center of iteration
      xRange - the maximum x difference from the center
      yRange - the maximum y difference from the center
      zRange - the maximum z difference from the center
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lfx;III)Ljava/lang/Iterable;
      intermediary method_25996 Lnet/minecraft/class_2338;method_25996(Lnet/minecraft/class_2338;III)Ljava/lang/Iterable;
      named iterateOutwards Lnet/minecraft/util/math/BlockPos;iterateOutwards(Lnet/minecraft/util/math/BlockPos;III)Ljava/lang/Iterable;
    • findClosest

      public static Optional<BlockPos> findClosest​(BlockPos pos, int horizontalRange, int verticalRange, Predicate<BlockPos> condition)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lfx;IILjava/util/function/Predicate;)Ljava/util/Optional;
      intermediary method_25997 Lnet/minecraft/class_2338;method_25997(Lnet/minecraft/class_2338;IILjava/util/function/Predicate;)Ljava/util/Optional;
      named findClosest Lnet/minecraft/util/math/BlockPos;findClosest(Lnet/minecraft/util/math/BlockPos;IILjava/util/function/Predicate;)Ljava/util/Optional;
    • streamOutwards

      public static Stream<BlockPos> streamOutwards​(BlockPos center, int maxX, int maxY, int maxZ)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(Lfx;III)Ljava/util/stream/Stream;
      intermediary method_25998 Lnet/minecraft/class_2338;method_25998(Lnet/minecraft/class_2338;III)Ljava/util/stream/Stream;
      named streamOutwards Lnet/minecraft/util/math/BlockPos;streamOutwards(Lnet/minecraft/util/math/BlockPos;III)Ljava/util/stream/Stream;
    • iterate

      public static Iterable<BlockPos> iterate​(BlockPos start, BlockPos end)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lfx;Lfx;)Ljava/lang/Iterable;
      intermediary method_10097 Lnet/minecraft/class_2338;method_10097(Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Ljava/lang/Iterable;
      named iterate Lnet/minecraft/util/math/BlockPos;iterate(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Ljava/lang/Iterable;
    • stream

      public static Stream<BlockPos> stream​(BlockPos start, BlockPos end)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(Lfx;Lfx;)Ljava/util/stream/Stream;
      intermediary method_20437 Lnet/minecraft/class_2338;method_20437(Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Ljava/util/stream/Stream;
      named stream Lnet/minecraft/util/math/BlockPos;stream(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Ljava/util/stream/Stream;
    • stream

      public static Stream<BlockPos> stream​(BlockBox box)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lcwn;)Ljava/util/stream/Stream;
      intermediary method_23627 Lnet/minecraft/class_2338;method_23627(Lnet/minecraft/class_3341;)Ljava/util/stream/Stream;
      named stream Lnet/minecraft/util/math/BlockPos;stream(Lnet/minecraft/util/math/BlockBox;)Ljava/util/stream/Stream;
    • stream

      public static Stream<BlockPos> stream​(Box box)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Ldip;)Ljava/util/stream/Stream;
      intermediary method_29715 Lnet/minecraft/class_2338;method_29715(Lnet/minecraft/class_238;)Ljava/util/stream/Stream;
      named stream Lnet/minecraft/util/math/BlockPos;stream(Lnet/minecraft/util/math/Box;)Ljava/util/stream/Stream;
    • stream

      public static Stream<BlockPos> stream​(int startX, int startY, int startZ, int endX, int endY, int endZ)
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(IIIIII)Ljava/util/stream/Stream;
      intermediary method_17962 Lnet/minecraft/class_2338;method_17962(IIIIII)Ljava/util/stream/Stream;
      named stream Lnet/minecraft/util/math/BlockPos;stream(IIIIII)Ljava/util/stream/Stream;
    • iterate

      public static Iterable<BlockPos> iterate​(int startX, int startY, int startZ, int endX, int endY, int endZ)
      Mappings:
      Namespace Name Mixin selector
      official b Lfx;b(IIIIII)Ljava/lang/Iterable;
      intermediary method_10094 Lnet/minecraft/class_2338;method_10094(IIIIII)Ljava/lang/Iterable;
      named iterate Lnet/minecraft/util/math/BlockPos;iterate(IIIIII)Ljava/lang/Iterable;
    • iterateInSquare

      public static Iterable<BlockPos.Mutable> iterateInSquare​(BlockPos center, int radius, Direction firstDirection, Direction secondDirection)
      Iterates block positions around the center in a square of (2 * radius + 1) by (2 * radius + 1). The blocks are iterated in a (square) spiral around the center.

      The first block returned is the center, then the iterator moves a block towards the first direction, followed by moving along the second direction.

      Parameters:
      center - the center of iteration
      radius - the maximum chebychev distance
      firstDirection - the direction the iterator moves first
      secondDirection - the direction the iterator moves after the first
      Throws:
      IllegalStateException - when the 2 directions lie on the same axis
      Mappings:
      Namespace Name Mixin selector
      official a Lfx;a(Lfx;ILgc;Lgc;)Ljava/lang/Iterable;
      intermediary method_30512 Lnet/minecraft/class_2338;method_30512(Lnet/minecraft/class_2338;ILnet/minecraft/class_2350;Lnet/minecraft/class_2350;)Ljava/lang/Iterable;
      named iterateInSquare Lnet/minecraft/util/math/BlockPos;iterateInSquare(Lnet/minecraft/util/math/BlockPos;ILnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/Direction;)Ljava/lang/Iterable;