File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed
api/src/main/java/com/github/retrooper/packetevents/util Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,15 @@ public Vector3d offset(BlockFace face) {
189189 return add (face .getModX (), face .getModY (), face .getModZ ());
190190 }
191191
192- public Vector3d offset (BlockFace face , int i ) {
193- return i == 0 ? this : add (face .getModX () * i , face .getModY () * i , face .getModZ () * i );
192+ /**
193+ * Offsets the vector by a specific BlockFace direction and distance.
194+ *
195+ * @param face The direction in which to offset.
196+ * @param distance The distance to offset in that direction.
197+ * @return A new Vector3d with the calculated offset.
198+ */
199+ public Vector3d offset (BlockFace face , int distance ) {
200+ return distance == 0 ? this : add (face .getModX () * distance , face .getModY () * distance , face .getModZ () * distance );
194201 }
195202
196203 public Vector3d subtract (double x , double y , double z ) {
Original file line number Diff line number Diff line change @@ -150,8 +150,15 @@ public Vector3f offset(BlockFace face) {
150150 return add (face .getModX (), face .getModY (), face .getModZ ());
151151 }
152152
153- public Vector3f offset (BlockFace face , int i ) {
154- return i == 0 ? this : add (face .getModX () * i , face .getModY () * i , face .getModZ () * i );
153+ /**
154+ * Offsets the vector by a specific BlockFace direction and distance.
155+ *
156+ * @param face The direction in which to offset.
157+ * @param distance The distance to offset in that direction.
158+ * @return A new Vector3f with the calculated offset.
159+ */
160+ public Vector3f offset (BlockFace face , int distance ) {
161+ return distance == 0 ? this : add (face .getModX () * distance , face .getModY () * distance , face .getModZ () * distance );
155162 }
156163
157164 public Vector3f subtract (float x , float y , float z ) {
Original file line number Diff line number Diff line change @@ -217,8 +217,15 @@ public Vector3i offset(BlockFace face) {
217217 return add (face .getModX (), face .getModY (), face .getModZ ());
218218 }
219219
220- public Vector3i offset (BlockFace face , int i ) {
221- return i == 0 ? this : add (face .getModX () * i , face .getModY () * i , face .getModZ () * i );
220+ /**
221+ * Offsets the vector by a specific BlockFace direction and distance.
222+ *
223+ * @param face The direction in which to offset.
224+ * @param distance The distance to offset in that direction.
225+ * @return A new Vector3i with the calculated offset.
226+ */
227+ public Vector3i offset (BlockFace face , int distance ) {
228+ return distance == 0 ? this : add (face .getModX () * distance , face .getModY () * distance , face .getModZ () * distance );
222229 }
223230
224231 public Vector3i subtract (int x , int y , int z ) {
You can’t perform that action at this time.
0 commit comments