Map and document the Box class (#2304)

* Map and document the Box class

* method_35580 -> contract

* Add javadoc links

* Update mappings/net/minecraft/util/math/Box.mapping
This commit is contained in:
enbrain 2021-04-10 22:05:02 +09:00 committed by GitHub
parent 9668c58132
commit 0992c71424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 70 additions and 5 deletions

View File

@ -1,11 +1,20 @@
CLASS net/minecraft/class_238 net/minecraft/util/math/Box
COMMENT An immutable box with double-valued coordinates. The box is axis-aligned
COMMENT and the coordinates are minimum inclusive and maximum exclusive.
COMMENT
COMMENT <p>This box has proper {@link #hashCode()} and {@link #equals(Object)}
COMMENT implementations and can be used as a map key.
COMMENT
COMMENT @see BlockBox
FIELD field_1320 maxX D
FIELD field_1321 minZ D
FIELD field_1322 minY D
FIELD field_1323 minX D
FIELD field_1324 maxZ D
FIELD field_1325 maxY D
FIELD field_31879 EPSILON D
METHOD <init> (DDDDDD)V
COMMENT Creates a box of the given positions as corners.
ARG 1 x1
ARG 3 y1
ARG 5 z1
@ -13,11 +22,14 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 9 y2
ARG 11 z2
METHOD <init> (Lnet/minecraft/class_2338;)V
COMMENT Creates a box that only contains the given block position.
ARG 1 pos
METHOD <init> (Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)V
COMMENT Creates a box of the given positions as corners.
ARG 1 pos1
ARG 2 pos2
METHOD <init> (Lnet/minecraft/class_243;Lnet/minecraft/class_243;)V
COMMENT Creates a box of the given positions as corners.
ARG 1 pos1
ARG 2 pos2
METHOD equals (Ljava/lang/Object;)Z
@ -29,6 +41,7 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 3 y
ARG 5 z
METHOD method_1003 intersects (DDDDDD)Z
COMMENT Checks if this box intersects the box of the given coordinates.
ARG 1 minX
ARG 3 minY
ARG 5 minZ
@ -36,8 +49,10 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 9 maxY
ARG 11 maxZ
METHOD method_1005 getCenter ()Lnet/minecraft/class_243;
COMMENT Returns the center position of this box.
METHOD method_1006 contains (Lnet/minecraft/class_243;)Z
ARG 1 vec
COMMENT Checks if the given position is in this box.
ARG 1 pos
METHOD method_1007 traceCollisionSide (Lnet/minecraft/class_238;Lnet/minecraft/class_243;[DLnet/minecraft/class_2350;DDD)Lnet/minecraft/class_2350;
ARG 0 box
ARG 1 intersectingVector
@ -47,10 +62,12 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 6 yDelta
ARG 8 zDelta
METHOD method_1008 contains (DDD)Z
COMMENT Checks if the given position is in this box.
ARG 1 x
ARG 3 y
ARG 5 z
METHOD method_1009 expand (DDD)Lnet/minecraft/class_238;
COMMENT @see #contract(double, double, double)
ARG 1 x
ARG 3 y
ARG 5 z
@ -60,13 +77,17 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 2 to
ARG 3 pos
METHOD method_1011 contract (D)Lnet/minecraft/class_238;
COMMENT @see #expand(double)
ARG 1 value
METHOD method_1012 stretch (DDD)Lnet/minecraft/class_238;
ARG 1 x
ARG 3 y
ARG 5 z
METHOD method_1013 isValid ()Z
COMMENT Checks if any of the coordinates of this box is {@linkplain
COMMENT Double#isNaN(double) not a number}.
METHOD method_1014 expand (D)Lnet/minecraft/class_238;
COMMENT @see #contract(double)
ARG 1 value
METHOD method_17939 getXLength ()D
METHOD method_17940 getYLength ()D
@ -76,33 +97,76 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
METHOD method_19316 from (Lnet/minecraft/class_3341;)Lnet/minecraft/class_238;
ARG 0 mutable
METHOD method_29968 from (Lnet/minecraft/class_243;)Lnet/minecraft/class_238;
ARG 0 vec3d
ARG 0 pos
METHOD method_30048 of (Lnet/minecraft/class_243;DDD)Lnet/minecraft/class_238;
ARG 0 center
ARG 1 dx
ARG 3 dy
ARG 5 dz
METHOD method_35574 withMinX (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the minimum X provided and all other coordinates
COMMENT of this box.
ARG 1 minX
METHOD method_35575 withMinY (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the minimum Y provided and all other coordinates
COMMENT of this box.
ARG 1 minY
METHOD method_35576 withMinZ (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the minimum Z provided and all other coordinates
COMMENT of this box.
ARG 1 minZ
METHOD method_35577 withMaxX (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the maximum X provided and all other coordinates
COMMENT of this box.
ARG 1 maxX
METHOD method_35578 withMaxY (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the maximum Y provided and all other coordinates
COMMENT of this box.
ARG 1 maxY
METHOD method_35579 withMaxZ (D)Lnet/minecraft/class_238;
COMMENT Creates a box with the maximum Z provided and all other coordinates
COMMENT of this box.
ARG 1 maxZ
METHOD method_35580 contract (DDD)Lnet/minecraft/class_238;
COMMENT @see #expand(double, double, double)
ARG 1 x
ARG 3 y
ARG 5 z
METHOD method_989 offset (DDD)Lnet/minecraft/class_238;
COMMENT Creates a box that is translated by {@code x}, {@code y}, {@code z} on
COMMENT each axis from this box.
ARG 1 x
ARG 3 y
ARG 5 z
METHOD method_990 getMax (Lnet/minecraft/class_2350$class_2351;)D
ARG 1 axis
METHOD method_991 union (Lnet/minecraft/class_238;)Lnet/minecraft/class_238;
COMMENT Creates the minimum box that contains this box and the given box.
ARG 1 box
METHOD method_992 raycast (Lnet/minecraft/class_243;Lnet/minecraft/class_243;)Ljava/util/Optional;
ARG 1 min
ARG 2 max
METHOD method_993 intersects (Lnet/minecraft/class_243;Lnet/minecraft/class_243;)Z
ARG 1 from
ARG 2 to
COMMENT Checks if this box intersects the box of the given positions as
COMMENT corners.
ARG 1 pos1
ARG 2 pos2
METHOD method_994 intersects (Lnet/minecraft/class_238;)Z
COMMENT Checks if this box intersects the given box.
ARG 1 box
METHOD method_995 getAverageSideLength ()D
METHOD method_996 offset (Lnet/minecraft/class_2338;)Lnet/minecraft/class_238;
COMMENT Creates a box that is translated by {@code blockPos.getX()}, {@code
COMMENT blockPos.getY()}, {@code blockPos.getZ()} on each axis from this box.
COMMENT
COMMENT @see #offset(double, double, double)
ARG 1 blockPos
METHOD method_997 offset (Lnet/minecraft/class_243;)Lnet/minecraft/class_238;
ARG 1 vec3d
COMMENT Creates a box that is translated by {@code vec.x}, {@code vec.y}, {@code
COMMENT vec.z} on each axis from this box.
COMMENT
COMMENT @see #offset(double, double, double)
ARG 1 vec
METHOD method_998 traceCollisionSide ([DLnet/minecraft/class_2350;DDDDDDDDLnet/minecraft/class_2350;DDD)Lnet/minecraft/class_2350;
ARG 0 traceDistanceResult
ARG 1 approachDirection
@ -119,4 +183,5 @@ CLASS net/minecraft/class_238 net/minecraft/util/math/Box
ARG 21 startY
ARG 23 startZ
METHOD method_999 intersection (Lnet/minecraft/class_238;)Lnet/minecraft/class_238;
COMMENT Creates the maximum box that this box and the given box contain.
ARG 1 box