File tree 2 files changed +36
-36
lines changed
interfaces/src/main/kotlin/com/noxcrew/interfaces
2 files changed +36
-36
lines changed Original file line number Diff line number Diff line change @@ -14,27 +14,27 @@ public object InterfacesConstants {
14
14
/* * The [CoroutineScope] for any suspending operations performed by interfaces. */
15
15
public val SCOPE : CoroutineScope = CoroutineScope (
16
16
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
24
23
}
24
+ }
25
25
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)
35
34
}
36
- ?.asCoroutineDispatcher()
37
- ? : Dispatchers .Default
38
- }
35
+ }
36
+ ?.asCoroutineDispatcher()
37
+ ? : Dispatchers .Default
38
+ }
39
39
)
40
40
}
Original file line number Diff line number Diff line change @@ -294,25 +294,25 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
294
294
// Don't check top inventory if we're in the player inventory!
295
295
if (
296
296
(
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
+ ) ||
306
306
bottomInventory.withIndex().any { (index, it) ->
307
307
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
+ )
316
316
}
317
317
) {
318
318
event.isCancelled = true
You can’t perform that action at this time.
0 commit comments