Skip to content

Commit 6715b8b

Browse files
committed
switched back to LinkedList from LinkedHashSet
1 parent 1b60759 commit 6715b8b

File tree

1 file changed

+5
-4
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/player

1 file changed

+5
-4
lines changed

common/src/main/kotlin/com/lambda/module/modules/player/PacketMine.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import com.lambda.util.BlockUtils.blockState
3939
import com.lambda.util.math.distSq
4040
import com.lambda.util.world.raycast.InteractionMask
4141
import net.minecraft.util.math.BlockPos
42+
import java.util.*
4243
import java.util.concurrent.ConcurrentLinkedQueue
4344

4445
object PacketMine : Module(
@@ -68,7 +69,7 @@ object PacketMine : Module(
6869
private var itemDrops = 0
6970

7071
private val breakPositions = arrayOfNulls<BlockPos>(2)
71-
private val queuePositions = LinkedHashSet<MutableCollection<BlockPos>>()
72+
private val queuePositions = LinkedList<MutableCollection<BlockPos>>()
7273
private val queueSorted
7374
get() = when (queueOrder) {
7475
QueueOrder.Standard -> queuePositions
@@ -180,7 +181,7 @@ object PacketMine : Module(
180181
}
181182
}
182183

183-
private fun LinkedHashSet<MutableCollection<BlockPos>>.removePos(element: BlockPos): Boolean {
184+
private fun LinkedList<MutableCollection<BlockPos>>.removePos(element: BlockPos): Boolean {
184185
var anyRemoved = false
185186
removeIf {
186187
val removed = it.remove(element)
@@ -190,7 +191,7 @@ object PacketMine : Module(
190191
return anyRemoved
191192
}
192193

193-
private fun LinkedHashSet<MutableCollection<BlockPos>>.retainAllPositions(positions: Collection<BreakContext>): Boolean {
194+
private fun LinkedList<MutableCollection<BlockPos>>.retainAllPositions(positions: Collection<BreakContext>): Boolean {
194195
var modified = false
195196
forEach {
196197
modified = modified or it.retainAll { pos ->
@@ -202,7 +203,7 @@ object PacketMine : Module(
202203
return modified
203204
}
204205

205-
private fun LinkedHashSet<MutableCollection<BlockPos>>.any(predicate: (BlockPos) -> Boolean): Boolean {
206+
private fun LinkedList<MutableCollection<BlockPos>>.any(predicate: (BlockPos) -> Boolean): Boolean {
206207
if (isEmpty()) return false
207208
forEach { if (it.any(predicate)) return true }
208209
return false

0 commit comments

Comments
 (0)