@@ -80,6 +80,7 @@ object GriffinBurrows {
8080 hasSpadeInHotbar = mc.thePlayer != null && Utils .inSkyblock && (0 .. 7 ).any {
8181 mc.thePlayer.inventory.getStackInSlot(it).isSpade
8282 }
83+ if (! Skytils .config.burrowEstimation) return
8384 BurrowEstimation .guesses.entries.removeIf { (_, instant) ->
8485 Duration .between(instant, Instant .now()).toMinutes() > 30
8586 }
@@ -135,22 +136,24 @@ object GriffinBurrows {
135136 pb.drawWaypoint(event.partialTicks, matrixStack)
136137 }
137138 }
138- for (bg in BurrowEstimation .guesses.keys) {
139- bg.drawWaypoint(event.partialTicks, matrixStack)
140- }
141- for (arrow in BurrowEstimation .arrows.keys) {
142- RenderUtil .drawCircle(
143- matrixStack,
144- arrow.pos.x,
145- arrow.pos.y + 0.2 ,
146- arrow.pos.z,
147- event.partialTicks,
148- 5.0 ,
149- 100 ,
150- 255 ,
151- 128 ,
152- 0 ,
153- )
139+ if (Skytils .config.burrowEstimation) {
140+ for (bg in BurrowEstimation .guesses.keys) {
141+ bg.drawWaypoint(event.partialTicks, matrixStack)
142+ }
143+ for (arrow in BurrowEstimation .arrows.keys) {
144+ RenderUtil .drawCircle(
145+ matrixStack,
146+ arrow.pos.x,
147+ arrow.pos.y + 0.2 ,
148+ arrow.pos.z,
149+ event.partialTicks,
150+ 5.0 ,
151+ 100 ,
152+ 255 ,
153+ 128 ,
154+ 0 ,
155+ )
156+ }
154157 }
155158 }
156159 }
@@ -198,6 +201,7 @@ object GriffinBurrows {
198201 }
199202 }
200203 is S04PacketEntityEquipment -> {
204+ if (! Skytils .config.burrowEstimation) return
201205 val entity = mc.theWorld?.getEntityByID(event.packet.entityID)
202206 (entity as ? EntityArmorStand )?.let { armorStand ->
203207 if (event.packet.itemStack?.item != Items .arrow) return
@@ -215,6 +219,7 @@ object GriffinBurrows {
215219 }
216220 }
217221 is S29PacketSoundEffect -> {
222+ if (! Skytils .config.burrowEstimation) return
218223 if (event.packet.soundName != " note.harp" ) return
219224 val (arrow, distance) = BurrowEstimation .arrows.keys
220225 .associateWith { arrow ->
@@ -233,7 +238,7 @@ object GriffinBurrows {
233238 // x ranges from 195 to -281
234239 // z ranges from 207 to -233
235240 do {
236- y = BurrowEstimation .grassData[( x++ % 507 ) * 507 + (z++ % 495 )] .toInt()
241+ y = BurrowEstimation .grassData.getOrNull(( x++ % 507 ) * 507 + (z++ % 495 ))? .toInt() ? : 0
237242 } while (y < 2 )
238243 val guess = BurrowGuess (guessPos.x.toInt(), y, guessPos.z.toInt())
239244 BurrowEstimation .arrows.remove(arrow)
0 commit comments