Skip to content

Commit d217732

Browse files
committed
Spotless
1 parent df74314 commit d217732

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesConstants.kt

+19-19
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ public object InterfacesConstants {
1414
/** The [CoroutineScope] for any suspending operations performed by interfaces. */
1515
public val SCOPE: CoroutineScope = CoroutineScope(
1616
CoroutineName("interfaces") +
17-
SupervisorJob() +
18-
run {
19-
val threadNumber = AtomicInteger()
20-
val factory = { runnable: Runnable ->
21-
Thread("interfaces-${threadNumber.getAndIncrement()}").apply {
22-
isDaemon = true
23-
}
17+
SupervisorJob() +
18+
run {
19+
val threadNumber = AtomicInteger()
20+
val factory = { runnable: Runnable ->
21+
Thread("interfaces-${threadNumber.getAndIncrement()}").apply {
22+
isDaemon = true
2423
}
24+
}
2525

26-
System.getProperty("com.noxcrew.interfaces.fixedPoolSize")
27-
?.toIntOrNull()
28-
?.coerceAtLeast(2)
29-
?.let { size ->
30-
if (System.getProperty("com.noxcrew.interfaces.useScheduledPool").toBoolean()) {
31-
Executors.newScheduledThreadPool(size, factory)
32-
} else {
33-
Executors.newFixedThreadPool(size, factory)
34-
}
26+
System.getProperty("com.noxcrew.interfaces.fixedPoolSize")
27+
?.toIntOrNull()
28+
?.coerceAtLeast(2)
29+
?.let { size ->
30+
if (System.getProperty("com.noxcrew.interfaces.useScheduledPool").toBoolean()) {
31+
Executors.newScheduledThreadPool(size, factory)
32+
} else {
33+
Executors.newFixedThreadPool(size, factory)
3534
}
36-
?.asCoroutineDispatcher()
37-
?: Dispatchers.Default
38-
}
35+
}
36+
?.asCoroutineDispatcher()
37+
?: Dispatchers.Default
38+
}
3939
)
4040
}

interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesListeners.kt

+17-17
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,25 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
294294
// Don't check top inventory if we're in the player inventory!
295295
if (
296296
(
297-
!isInPlayerInventory && topInventory.withIndex().any { (index, it) ->
298-
// Check if any item is being collected that cannot be moved!
299-
it != null && it.isSimilar(clickedItem) && !canFreelyMove(
300-
view,
301-
requireNotNull(GridPoint.fromBukkitChestSlot(index)),
302-
false
303-
)
304-
}
305-
) ||
297+
!isInPlayerInventory && topInventory.withIndex().any { (index, it) ->
298+
// Check if any item is being collected that cannot be moved!
299+
it != null && it.isSimilar(clickedItem) && !canFreelyMove(
300+
view,
301+
requireNotNull(GridPoint.fromBukkitChestSlot(index)),
302+
false
303+
)
304+
}
305+
) ||
306306
bottomInventory.withIndex().any { (index, it) ->
307307
it != null && it.isSimilar(clickedItem) &&
308-
// These slots are always in the player inventory and always need to be relativized!
309-
!canFreelyMove(
310-
view,
311-
view.backing.relativizePlayerInventorySlot(
312-
requireNotNull(GridPoint.fromBukkitPlayerSlot(index))
313-
),
314-
true
315-
)
308+
// These slots are always in the player inventory and always need to be relativized!
309+
!canFreelyMove(
310+
view,
311+
view.backing.relativizePlayerInventorySlot(
312+
requireNotNull(GridPoint.fromBukkitPlayerSlot(index))
313+
),
314+
true
315+
)
316316
}
317317
) {
318318
event.isCancelled = true

0 commit comments

Comments
 (0)