You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "Automatically flies in a spiral pattern. Uses Baritone elytra pathing in the Nether.",
39
+
tag = ModuleTag.MOVEMENT,
40
+
) {
41
+
var iterator:BlockPosIterators.SpiralIterator2d?=null
42
+
var currentWaypoint:BlockPos?=null
43
+
44
+
var spiralSpacing by setting("Spiral Spacing", 128, 16..1024, description ="The distance between each loop of the spiral")
45
+
var waypointTriggerDistance by setting("Waypoint Trigger Distance", 4, 2..64, description ="The distance to the waypoint at which a new waypoint is generated. Put in 50-60 range when in the Nether.")
46
+
var setCenterOnEnable by setting("Set Center On Enable", true, description ="Whether to set the center of the spiral to your current position when enabling the module.")
47
+
var setBaritoneGoal by setting("Set Baritone Goal", true, description ="Whether to set Baritone's goal to the current waypoint. Mostly so you can see where the next waypoint is.")
48
+
49
+
var center by setting("Center", BlockPos.ORIGIN, description ="Center position for the spiral")
* This program is free software: you can redistribute it and/or modify
5
+
* it under the terms of the GNU General Public License as published by
6
+
* the Free Software Foundation, either version 3 of the License, or
7
+
* (at your option) any later version.
8
+
*
9
+
* This program is distributed in the hope that it will be useful,
10
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+
* GNU General Public License for more details.
13
+
*
14
+
* You should have received a copy of the GNU General Public License
15
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
*/
17
+
18
+
packagecom.lambda.util
19
+
20
+
importnet.minecraft.util.math.BlockPos
21
+
importkotlin.math.floor
22
+
importkotlin.math.pow
23
+
24
+
/**
25
+
* A collection of Block position iterator implementations for various purposes.
26
+
*/
27
+
object BlockPosIterators {
28
+
/**
29
+
* Spiral outwards from a central position in growing squares.
30
+
* Every point has a constant distance to its previous and following position of 1. First point returned is the starting position.
31
+
* Generates positions like this:
32
+
* ```text
33
+
* 16 15 14 13 12
34
+
* 17 4 3 2 11
35
+
* 18 5 0 1 10
36
+
* 19 6 7 8 9
37
+
* 20 21 22 23 24
38
+
* (maxDistance = 2; points returned = 25)
39
+
* ```
40
+
*
41
+
* @see <a href="https://stackoverflow.com/questions/3706219/algorithm-for-iterating-over-an-outward-spiral-on-a-discrete-2d-grid-from-the-or">StackOverflow: Algorithm for iterating over an outward spiral on a discrete 2d grid</a>
0 commit comments