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

@Unmodifiable 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
named net/minecraft/util/math/BlockPos
intermediary net/minecraft/class_2338
official iz
  • Field Details

    • CODEC

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

      public static final PacketCodec<ByteBuf,BlockPos> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/util/math/BlockPos;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_48404 Lnet/minecraft/class_2338;field_48404:Lnet/minecraft/class_9139;
      official b Liz;b:Lzn;
    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/util/math/BlockPos;LOGGER:Lorg/slf4j/Logger;
      intermediary field_18789 Lnet/minecraft/class_2338;field_18789:Lorg/slf4j/Logger;
      official e Liz;e:Lorg/slf4j/Logger;
    • ORIGIN

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

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

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

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

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

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

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

      private static final int field_33083
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_33083 Lnet/minecraft/util/math/BlockPos;field_33083:I
      intermediary field_33083 Lnet/minecraft/class_2338;field_33083:I
      official m Liz;m:I
    • BIT_SHIFT_Z

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

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

    • BlockPos

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

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

    • offset

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

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

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

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

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

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

      public static BlockPos ofFloored(double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      named ofFloored Lnet/minecraft/util/math/BlockPos;ofFloored(DDD)Lnet/minecraft/util/math/BlockPos;
      intermediary method_49637 Lnet/minecraft/class_2338;method_49637(DDD)Lnet/minecraft/class_2338;
      official a Liz;a(DDD)Liz;
    • ofFloored

      public static BlockPos ofFloored(Position pos)
      Mappings:
      Namespace Name Mixin selector
      named ofFloored Lnet/minecraft/util/math/BlockPos;ofFloored(Lnet/minecraft/util/math/Position;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_49638 Lnet/minecraft/class_2338;method_49638(Lnet/minecraft/class_2374;)Lnet/minecraft/class_2338;
      official a Liz;a(Ljs;)Liz;
    • min

      public static BlockPos min(BlockPos a, BlockPos b)
      Mappings:
      Namespace Name Mixin selector
      named min Lnet/minecraft/util/math/BlockPos;min(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_58249 Lnet/minecraft/class_2338;method_58249(Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2338;
      official a Liz;a(Liz;Liz;)Liz;
    • max

      public static BlockPos max(BlockPos a, BlockPos b)
      Mappings:
      Namespace Name Mixin selector
      named max Lnet/minecraft/util/math/BlockPos;max(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_58250 Lnet/minecraft/class_2338;method_58250(Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2338;
      official b Liz;b(Liz;Liz;)Liz;
    • asLong

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

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

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

      public BlockPos add(int int2, int int3, int int4)
      Description copied from class: Vec3i
      Returns another Vec3i whose coordinates have the parameter x, y, and z added to the coordinates of this vector.

      This method always returns an immutable object.

      Overrides:
      add in class Vec3i
      Returns:
      another Vec3i whose coordinates have the parameter x, y, and z added to the coordinates of this vector
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/BlockPos;add(III)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10069 Lnet/minecraft/class_2338;method_10069(III)Lnet/minecraft/class_2338;
      official b Liz;b(III)Liz;
    • toCenterPos

      public Vec3d toCenterPos()
      Returns the center of this block position.
      Returns:
      the center of this block position
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named toCenterPos Lnet/minecraft/util/math/BlockPos;toCenterPos()Lnet/minecraft/util/math/Vec3d;
      intermediary method_46558 Lnet/minecraft/class_2338;method_46558()Lnet/minecraft/class_243;
      official b Liz;b()Levs;
    • add

      public BlockPos add(Vec3i vec3i)
      Description copied from class: Vec3i
      Returns another Vec3i whose coordinates have the coordinates of vec added to the coordinates of this vector.

      This method always returns an immutable object.

      Overrides:
      add in class Vec3i
      Returns:
      another Vec3i whose coordinates have the coordinates of vec added to the coordinates of this vector
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/BlockPos;add(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10081 Lnet/minecraft/class_2338;method_10081(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2338;
      official a Liz;a(Lkd;)Liz;
    • subtract

      public BlockPos subtract(Vec3i vec3i)
      Description copied from class: Vec3i
      Returns another Vec3i whose coordinates have the coordinates of vec subtracted from the coordinates of this vector.

      This method always returns an immutable object.

      Overrides:
      subtract in class Vec3i
      Returns:
      another Vec3i whose coordinates have the coordinates of vec subtracted from the coordinates of this vector
      Mappings:
      Namespace Name Mixin selector
      named subtract Lnet/minecraft/util/math/BlockPos;subtract(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10059 Lnet/minecraft/class_2338;method_10059(Lnet/minecraft/class_2382;)Lnet/minecraft/class_2338;
      official b Liz;b(Lkd;)Liz;
    • multiply

      public BlockPos multiply(int int2)
      Description copied from class: Vec3i
      Returns a vector with all components multiplied by scale.
      Overrides:
      multiply in class Vec3i
      Returns:
      a vector with all components multiplied by scale
      Mappings:
      Namespace Name Mixin selector
      named multiply Lnet/minecraft/util/math/BlockPos;multiply(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_35830 Lnet/minecraft/class_2338;method_35830(I)Lnet/minecraft/class_2338;
      official a Liz;a(I)Liz;
    • up

      public BlockPos up()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the upward direction.
      Overrides:
      up in class Vec3i
      Returns:
      a vector which is offset by 1 in the upward direction
      Mappings:
      Namespace Name Mixin selector
      named up Lnet/minecraft/util/math/BlockPos;up()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10084 Lnet/minecraft/class_2338;method_10084()Lnet/minecraft/class_2338;
      official c Liz;c()Liz;
    • up

      public BlockPos up(int distance)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the upward direction.
      Overrides:
      up in class Vec3i
      Returns:
      a vector which is offset by distance in the upward direction
      Mappings:
      Namespace Name Mixin selector
      named up Lnet/minecraft/util/math/BlockPos;up(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10086 Lnet/minecraft/class_2338;method_10086(I)Lnet/minecraft/class_2338;
      official b Liz;b(I)Liz;
    • down

      public BlockPos down()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the downward direction.
      Overrides:
      down in class Vec3i
      Returns:
      a vector which is offset by 1 in the downward direction
      Mappings:
      Namespace Name Mixin selector
      named down Lnet/minecraft/util/math/BlockPos;down()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10074 Lnet/minecraft/class_2338;method_10074()Lnet/minecraft/class_2338;
      official d Liz;d()Liz;
    • down

      public BlockPos down(int int2)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the downward direction.
      Overrides:
      down in class Vec3i
      Returns:
      a vector which is offset by distance in the downward direction
      Mappings:
      Namespace Name Mixin selector
      named down Lnet/minecraft/util/math/BlockPos;down(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10087 Lnet/minecraft/class_2338;method_10087(I)Lnet/minecraft/class_2338;
      official c Liz;c(I)Liz;
    • north

      public BlockPos north()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the northward direction.
      Overrides:
      north in class Vec3i
      Returns:
      a vector which is offset by 1 in the northward direction
      Mappings:
      Namespace Name Mixin selector
      named north Lnet/minecraft/util/math/BlockPos;north()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10095 Lnet/minecraft/class_2338;method_10095()Lnet/minecraft/class_2338;
      official e Liz;e()Liz;
    • north

      public BlockPos north(int distance)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the northward direction.
      Overrides:
      north in class Vec3i
      Returns:
      a vector which is offset by distance in the northward direction
      Mappings:
      Namespace Name Mixin selector
      named north Lnet/minecraft/util/math/BlockPos;north(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10076 Lnet/minecraft/class_2338;method_10076(I)Lnet/minecraft/class_2338;
      official d Liz;d(I)Liz;
    • south

      public BlockPos south()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the southward direction.
      Overrides:
      south in class Vec3i
      Returns:
      a vector which is offset by 1 in the southward direction
      Mappings:
      Namespace Name Mixin selector
      named south Lnet/minecraft/util/math/BlockPos;south()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10072 Lnet/minecraft/class_2338;method_10072()Lnet/minecraft/class_2338;
      official f Liz;f()Liz;
    • south

      public BlockPos south(int distance)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the southward direction.
      Overrides:
      south in class Vec3i
      Returns:
      a vector which is offset by distance in the southward direction
      Mappings:
      Namespace Name Mixin selector
      named south Lnet/minecraft/util/math/BlockPos;south(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10077 Lnet/minecraft/class_2338;method_10077(I)Lnet/minecraft/class_2338;
      official e Liz;e(I)Liz;
    • west

      public BlockPos west()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the westward direction.
      Overrides:
      west in class Vec3i
      Returns:
      a vector which is offset by 1 in the westward direction
      Mappings:
      Namespace Name Mixin selector
      named west Lnet/minecraft/util/math/BlockPos;west()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10067 Lnet/minecraft/class_2338;method_10067()Lnet/minecraft/class_2338;
      official g Liz;g()Liz;
    • west

      public BlockPos west(int distance)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the westward direction.
      Overrides:
      west in class Vec3i
      Returns:
      a vector which is offset by distance in the westward direction
      Mappings:
      Namespace Name Mixin selector
      named west Lnet/minecraft/util/math/BlockPos;west(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10088 Lnet/minecraft/class_2338;method_10088(I)Lnet/minecraft/class_2338;
      official f Liz;f(I)Liz;
    • east

      public BlockPos east()
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in the eastward direction.
      Overrides:
      east in class Vec3i
      Returns:
      a vector which is offset by 1 in the eastward direction
      Mappings:
      Namespace Name Mixin selector
      named east Lnet/minecraft/util/math/BlockPos;east()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10078 Lnet/minecraft/class_2338;method_10078()Lnet/minecraft/class_2338;
      official h Liz;h()Liz;
    • east

      public BlockPos east(int distance)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in the eastward direction.
      Overrides:
      east in class Vec3i
      Returns:
      a vector which is offset by distance in the eastward direction
      Mappings:
      Namespace Name Mixin selector
      named east Lnet/minecraft/util/math/BlockPos;east(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10089 Lnet/minecraft/class_2338;method_10089(I)Lnet/minecraft/class_2338;
      official g Liz;g(I)Liz;
    • offset

      public BlockPos offset(Direction direction)
      Description copied from class: Vec3i
      Returns a vector which is offset by 1 in direction direction.
      Overrides:
      offset in class Vec3i
      Returns:
      a vector which is offset by 1 in direction direction
      Mappings:
      Namespace Name Mixin selector
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10093 Lnet/minecraft/class_2338;method_10093(Lnet/minecraft/class_2350;)Lnet/minecraft/class_2338;
      official a Liz;a(Lje;)Liz;
    • offset

      public BlockPos offset(Direction direction, int int2)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance in direction direction.
      Overrides:
      offset in class Vec3i
      Returns:
      a vector which is offset by distance in direction direction
      Mappings:
      Namespace Name Mixin selector
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction;I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_10079 Lnet/minecraft/class_2338;method_10079(Lnet/minecraft/class_2350;I)Lnet/minecraft/class_2338;
      official a Liz;a(Lje;I)Liz;
    • offset

      public BlockPos offset(Direction.Axis axis, int int2)
      Description copied from class: Vec3i
      Returns a vector which is offset by distance on axis axis.
      Overrides:
      offset in class Vec3i
      Returns:
      a vector which is offset by distance on axis axis
      Mappings:
      Namespace Name Mixin selector
      named offset Lnet/minecraft/util/math/BlockPos;offset(Lnet/minecraft/util/math/Direction$Axis;I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_30513 Lnet/minecraft/class_2338;method_30513(Lnet/minecraft/class_2350$class_2351;I)Lnet/minecraft/class_2338;
      official a Liz;a(Lje$a;I)Liz;
    • rotate

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

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

      public BlockPos withY(int y)
      Mappings:
      Namespace Name Mixin selector
      named withY Lnet/minecraft/util/math/BlockPos;withY(I)Lnet/minecraft/util/math/BlockPos;
      intermediary method_33096 Lnet/minecraft/class_2338;method_33096(I)Lnet/minecraft/class_2338;
      official h Liz;h(I)Liz;
    • 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
      named toImmutable Lnet/minecraft/util/math/BlockPos;toImmutable()Lnet/minecraft/util/math/BlockPos;
      intermediary method_10062 Lnet/minecraft/class_2338;method_10062()Lnet/minecraft/class_2338;
      official i Liz;i()Liz;
    • 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
      named mutableCopy Lnet/minecraft/util/math/BlockPos;mutableCopy()Lnet/minecraft/util/math/BlockPos$Mutable;
      intermediary method_25503 Lnet/minecraft/class_2338;method_25503()Lnet/minecraft/class_2338$class_2339;
      official j Liz;j()Liz$a;
    • iterateRandomly

      public static Iterable<BlockPos> iterateRandomly(Random random, int count, BlockPos around, int range)
      Iterates through count random block positions in a given range around the given position.

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

      Parameters:
      count - the number of positions to iterate
      around - the BlockPos to iterate around
      range - the maximum distance from the given pos in any axis
      Mappings:
      Namespace Name Mixin selector
      named iterateRandomly Lnet/minecraft/util/math/BlockPos;iterateRandomly(Lnet/minecraft/util/math/random/Random;ILnet/minecraft/util/math/BlockPos;I)Ljava/lang/Iterable;
      intermediary method_34848 Lnet/minecraft/class_2338;method_34848(Lnet/minecraft/class_5819;ILnet/minecraft/class_2338;I)Ljava/lang/Iterable;
      official a Liz;a(Lazh;ILiz;I)Ljava/lang/Iterable;
    • streamSouthEastSquare

      @Deprecated public static Stream<BlockPos> streamSouthEastSquare(BlockPos pos)
      Deprecated.
      Mappings:
      Namespace Name Mixin selector
      named streamSouthEastSquare Lnet/minecraft/util/math/BlockPos;streamSouthEastSquare(Lnet/minecraft/util/math/BlockPos;)Ljava/util/stream/Stream;
      intermediary method_51686 Lnet/minecraft/class_2338;method_51686(Lnet/minecraft/class_2338;)Ljava/util/stream/Stream;
      official a Liz;a(Liz;)Ljava/util/stream/Stream;
    • 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:
      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
      named iterateRandomly Lnet/minecraft/util/math/BlockPos;iterateRandomly(Lnet/minecraft/util/math/random/Random;IIIIIII)Ljava/lang/Iterable;
      intermediary method_27156 Lnet/minecraft/class_2338;method_27156(Lnet/minecraft/class_5819;IIIIIII)Ljava/lang/Iterable;
      official a Liz;a(Lazh;IIIIIII)Ljava/lang/Iterable;
    • iterateOutwards

      public static Iterable<BlockPos> iterateOutwards(BlockPos center, int rangeX, int rangeY, int rangeZ)
      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
      rangeX - the maximum x difference from the center
      rangeY - the maximum y difference from the center
      rangeZ - the maximum z difference from the center
      Mappings:
      Namespace Name Mixin selector
      named iterateOutwards Lnet/minecraft/util/math/BlockPos;iterateOutwards(Lnet/minecraft/util/math/BlockPos;III)Ljava/lang/Iterable;
      intermediary method_25996 Lnet/minecraft/class_2338;method_25996(Lnet/minecraft/class_2338;III)Ljava/lang/Iterable;
      official a Liz;a(Liz;III)Ljava/lang/Iterable;
    • findClosest

      public static Optional<BlockPos> findClosest(BlockPos pos, int horizontalRange, int verticalRange, Predicate<BlockPos> condition)
      Mappings:
      Namespace Name Mixin selector
      named findClosest Lnet/minecraft/util/math/BlockPos;findClosest(Lnet/minecraft/util/math/BlockPos;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;
      official a Liz;a(Liz;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
      named streamOutwards Lnet/minecraft/util/math/BlockPos;streamOutwards(Lnet/minecraft/util/math/BlockPos;III)Ljava/util/stream/Stream;
      intermediary method_25998 Lnet/minecraft/class_2338;method_25998(Lnet/minecraft/class_2338;III)Ljava/util/stream/Stream;
      official b Liz;b(Liz;III)Ljava/util/stream/Stream;
    • iterate

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

      public static Stream<BlockPos> stream(BlockPos start, BlockPos end)
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/util/math/BlockPos;stream(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)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;
      official d Liz;d(Liz;Liz;)Ljava/util/stream/Stream;
    • stream

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

      public static Stream<BlockPos> stream(Box box)
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/util/math/BlockPos;stream(Lnet/minecraft/util/math/Box;)Ljava/util/stream/Stream;
      intermediary method_29715 Lnet/minecraft/class_2338;method_29715(Lnet/minecraft/class_238;)Ljava/util/stream/Stream;
      official a Liz;a(Levn;)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
      named stream Lnet/minecraft/util/math/BlockPos;stream(IIIIII)Ljava/util/stream/Stream;
      intermediary method_17962 Lnet/minecraft/class_2338;method_17962(IIIIII)Ljava/util/stream/Stream;
      official a Liz;a(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
      named iterate Lnet/minecraft/util/math/BlockPos;iterate(IIIIII)Ljava/lang/Iterable;
      intermediary method_10094 Lnet/minecraft/class_2338;method_10094(IIIIII)Ljava/lang/Iterable;
      official b Liz;b(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
      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;
      intermediary method_30512 Lnet/minecraft/class_2338;method_30512(Lnet/minecraft/class_2338;ILnet/minecraft/class_2350;Lnet/minecraft/class_2350;)Ljava/lang/Iterable;
      official a Liz;a(Liz;ILje;Lje;)Ljava/lang/Iterable;
    • iterateRecursively

      public static int iterateRecursively(BlockPos pos, int maxDepth, int maxIterations, BiConsumer<BlockPos,Consumer<BlockPos>> nextQueuer, Predicate<BlockPos> callback)
      Iterates from pos recursively, like in a fill tool in a raster image editor. callback is called once (and only once) for each position it finds. When this returns true and the depth/iteration limit is not reached yet, nextQueuer queues the next (usually neighboring) positions to iterate, with the depth incremented by one.
      Parameters:
      pos - the starting position
      maxDepth - the maximum depth of iteration
      maxIterations - the maximum number of total iterations
      nextQueuer - a function that enqueues the next positions
      Returns:
      the total number of iterations
      Mappings:
      Namespace Name Mixin selector
      named iterateRecursively Lnet/minecraft/util/math/BlockPos;iterateRecursively(Lnet/minecraft/util/math/BlockPos;IILjava/util/function/BiConsumer;Ljava/util/function/Predicate;)I
      intermediary method_49925 Lnet/minecraft/class_2338;method_49925(Lnet/minecraft/class_2338;IILjava/util/function/BiConsumer;Ljava/util/function/Predicate;)I
      official a Liz;a(Liz;IILjava/util/function/BiConsumer;Ljava/util/function/Predicate;)I