Package api.world
Class ImmutableBlockPos
java.lang.Object
api.util.Vec3i
api.world.ImmutableBlockPos
- All Implemented Interfaces:
Comparable<Vec3i>
- Direct Known Subclasses:
ImmutableBlockPos.VanillaMutableBlockPos
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImmutableBlockPosThe BlockPos with all coordinates 0Fields inherited from class api.util.Vec3i
NULL_VECTOR -
Constructor Summary
ConstructorsConstructorDescriptionImmutableBlockPos(double x, double y, double z) ImmutableBlockPos(int x, int y, int z) ImmutableBlockPos(Vec3i source) ImmutableBlockPos(Entity source) ImmutableBlockPos(Vec3 source) -
Method Summary
Modifier and TypeMethodDescriptionadd(double x, double y, double z) Add the given coordinates to the coordinates of this BlockPosIadd(int x, int y, int z) Add the given coordinates to the coordinates of this BlockPosIAdd the given Vector to this BlockPosIcrossProduct(Vec3i vec) Calculate the cross product of this and the given Vectordown()Offset this BlockPosI 1 block downdown(int n) Offset this BlockPosI n blocks downeast()Offset this BlockPosI 1 block in eastern directioneast(int n) Offset this BlockPosI n blocks in eastern directionstatic ImmutableBlockPosfromLong(long serialized) Create a BlockPosI from a serialized long value (created by toLong)static Iterable<ImmutableBlockPos>getAllInBox(ImmutableBlockPos from, ImmutableBlockPos to) north()Offset this BlockPosI 1 block in northern directionnorth(int n) Offset this BlockPosI n blocks in northern directionoffset(EnumFacing facing) Offset this BlockPosI 1 block in the given directionoffset(EnumFacing facing, int n) Offsets this BlockPosI n blocks in the given directionsouth()Offset this BlockPosI 1 block in southern directionsouth(int n) Offset this BlockPosI n blocks in southern directionSubtract the given Vector from this BlockPosIlongtoLong()Serialize this BlockPosI into a long valuetoString()up()Offset this BlockPosI 1 block upup(int n) Offset this BlockPosI n blocks upwest()Offset this BlockPosI 1 block in western directionwest(int n) Offset this BlockPosI n blocks in western directionMethods inherited from class api.util.Vec3i
compareTo, distanceSq, distanceSq, distanceSqToCenter, equals, getX, getY, getZ, hashCode
-
Field Details
-
ORIGIN
The BlockPos with all coordinates 0
-
-
Constructor Details
-
ImmutableBlockPos
public ImmutableBlockPos(int x, int y, int z) -
ImmutableBlockPos
public ImmutableBlockPos(double x, double y, double z) -
ImmutableBlockPos
-
ImmutableBlockPos
-
ImmutableBlockPos
-
-
Method Details
-
add
Add the given coordinates to the coordinates of this BlockPosI -
add
Add the given coordinates to the coordinates of this BlockPosI -
add
Add the given Vector to this BlockPosI -
subtract
Subtract the given Vector from this BlockPosI -
up
Offset this BlockPosI 1 block up -
up
Offset this BlockPosI n blocks up -
down
Offset this BlockPosI 1 block down -
down
Offset this BlockPosI n blocks down -
north
Offset this BlockPosI 1 block in northern direction -
north
Offset this BlockPosI n blocks in northern direction -
south
Offset this BlockPosI 1 block in southern direction -
south
Offset this BlockPosI n blocks in southern direction -
west
Offset this BlockPosI 1 block in western direction -
west
Offset this BlockPosI n blocks in western direction -
east
Offset this BlockPosI 1 block in eastern direction -
east
Offset this BlockPosI n blocks in eastern direction -
offset
Offset this BlockPosI 1 block in the given direction -
offset
Offsets this BlockPosI n blocks in the given direction -
crossProduct
Calculate the cross product of this and the given Vector- Overrides:
crossProductin classVec3i
-
toLong
public long toLong()Serialize this BlockPosI into a long value -
fromLong
Create a BlockPosI from a serialized long value (created by toLong) -
getAllInBox
-
getAllInBoxMutable
public static Iterable<ImmutableBlockPos.VanillaMutableBlockPos> getAllInBoxMutable(ImmutableBlockPos from, ImmutableBlockPos to) -
toString
-