From 9ae5d6af6098ac421f4af3e4563423a0d69da137 Mon Sep 17 00:00:00 2001 From: liach <7806504+liach@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:32:53 -0600 Subject: [PATCH] Add missing methods for util math from 10a update (#2126) * Add missing methods for util math from 10a update Signed-off-by: liach * Update mappings/net/minecraft/util/math/BlockBox.mapping Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com> * Update mappings/net/minecraft/util/math/Vec3i.mapping Co-authored-by: SuperCoder79 <25208576+SuperCoder7979@users.noreply.github.com> Co-authored-by: liach Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com> Co-authored-by: SuperCoder79 <25208576+SuperCoder7979@users.noreply.github.com> --- .../net/minecraft/util/math/BlockBox.mapping | 40 +++++++++++++++++++ .../net/minecraft/util/math/Vec3i.mapping | 10 +++++ 2 files changed, 50 insertions(+) diff --git a/mappings/net/minecraft/util/math/BlockBox.mapping b/mappings/net/minecraft/util/math/BlockBox.mapping index 2e2240eee5..17b82fcfe9 100644 --- a/mappings/net/minecraft/util/math/BlockBox.mapping +++ b/mappings/net/minecraft/util/math/BlockBox.mapping @@ -1,10 +1,22 @@ CLASS net/minecraft/class_3341 net/minecraft/util/math/BlockBox + COMMENT A mutable box with integer coordinates. The box is axis-aligned and the + COMMENT coordinates are inclusive. + COMMENT + COMMENT

This box, though mutable, has proper {@code hashCode} and {@code + COMMENT equals} implementations and can be used as map keys if user can ensure + COMMENT they are not modified. + COMMENT + COMMENT @see Box FIELD field_14376 maxZ I FIELD field_14377 maxY I FIELD field_14378 maxX I FIELD field_14379 minZ I FIELD field_14380 minY I FIELD field_14381 minX I + FIELD field_29325 CODEC Lcom/mojang/serialization/Codec; + COMMENT A codec that stores a block box as an int array. In the serialized array, + COMMENT the ordered elements are {@link #minX}, {@link #minY}, {@link #minZ}, + COMMENT {@link #maxX}, {@link #maxY}, {@link #maxZ}. METHOD (IIIIII)V ARG 1 minX ARG 2 minY @@ -12,6 +24,11 @@ CLASS net/minecraft/class_3341 net/minecraft/util/math/BlockBox ARG 4 maxX ARG 5 maxY ARG 6 maxZ + METHOD (Lnet/minecraft/class_2338;)V + COMMENT Creates a box enclosing only {@code pos}. + ARG 1 pos + METHOD equals (Ljava/lang/Object;)Z + ARG 1 o METHOD method_14657 intersects (Lnet/minecraft/class_3341;)Z ARG 1 other METHOD method_14659 getDimensions ()Lnet/minecraft/class_2382; @@ -25,6 +42,7 @@ CLASS net/minecraft/class_3341 net/minecraft/util/math/BlockBox METHOD method_14663 getBlockCountY ()I METHOD method_14664 getBlockCountZ ()I METHOD method_14665 empty ()Lnet/minecraft/class_3341; + COMMENT Creates an empty box. METHOD method_14666 create (IIIIII)Lnet/minecraft/class_3341; ARG 0 x1 ARG 1 y1 @@ -51,6 +69,11 @@ CLASS net/minecraft/class_3341 net/minecraft/util/math/BlockBox ARG 3 maxX ARG 4 maxZ METHOD method_19311 offset (III)Lnet/minecraft/class_3341; + COMMENT Creates a new box that is translated by {@code x}, {@code y}, {@code z} + COMMENT on each axis from this box. + COMMENT + COMMENT @return the new box created + COMMENT @see #move(int, int, int) ARG 1 x ARG 2 y ARG 3 z @@ -59,3 +82,20 @@ CLASS net/minecraft/class_3341 net/minecraft/util/math/BlockBox METHOD method_27234 infinite ()Lnet/minecraft/class_3341; METHOD method_29299 move (Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341; ARG 1 vec + METHOD method_34389 encompass (Lnet/minecraft/class_2338;)Lnet/minecraft/class_3341; + COMMENT Expands this box to encompass the {@code pos}. + COMMENT + COMMENT @return this box, for chaining + ARG 1 pos + COMMENT the pos to encompass + METHOD method_34390 create (Lnet/minecraft/class_2382;Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341; + ARG 0 first + ARG 1 second + METHOD method_34391 forEachVertex (Ljava/util/function/Consumer;)V + ARG 1 consumer + METHOD method_34392 (Ljava/util/stream/IntStream;)Lcom/mojang/serialization/DataResult; + ARG 0 values + METHOD method_34393 ([I)Lnet/minecraft/class_3341; + ARG 0 array + METHOD method_34394 (Lnet/minecraft/class_3341;)Ljava/util/stream/IntStream; + ARG 0 box diff --git a/mappings/net/minecraft/util/math/Vec3i.mapping b/mappings/net/minecraft/util/math/Vec3i.mapping index 30652eb1cb..3e0d945c3b 100644 --- a/mappings/net/minecraft/util/math/Vec3i.mapping +++ b/mappings/net/minecraft/util/math/Vec3i.mapping @@ -13,6 +13,8 @@ CLASS net/minecraft/class_2382 net/minecraft/util/math/Vec3i ARG 1 x ARG 2 y ARG 3 z + METHOD equals (Ljava/lang/Object;)Z + ARG 1 o METHOD method_10099 setY (I)Lnet/minecraft/class_2382; ARG 1 y METHOD method_10259 crossProduct (Lnet/minecraft/class_2382;)Lnet/minecraft/class_2382; @@ -57,3 +59,11 @@ CLASS net/minecraft/class_2382 net/minecraft/util/math/Vec3i METHOD method_33106 getSquaredDistance (Lnet/minecraft/class_2382;Z)D ARG 1 vec ARG 2 treatAsBlockPos + METHOD method_34592 add (III)Lnet/minecraft/class_2382; + COMMENT Returns another Vec3i whose coordinates have the parameter x, y, and z + COMMENT added to the coordinates of this vector. + COMMENT + COMMENT

This method always returns an immutable object. + ARG 1 x + ARG 2 y + ARG 3 z