File tree Expand file tree Collapse file tree 2 files changed +2
-31
lines changed
common/src/main/kotlin/com/lambda Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Original file line number Diff line number Diff line change @@ -25,40 +25,11 @@ object Lambda {
2525 init {
2626 listener<PacketEvent .Send .Pre > {
2727 if (it.packet is LookAndOnGround ) {
28- // it.cancel()
28+ it.cancel()
2929 LOG .info(" SAFE: Canceled: ${it.packet::class .simpleName} " )
3030 }
3131 }
3232
33- listener<PacketEvent .Send .Pre > {
34- if (it.packet is LookAndOnGround ) {
35- // it.cancel()
36- LOG .info(" 2 SAFE: Canceled: ${it.packet::class .simpleName} " )
37- }
38- }
39-
40- unsafeListener<PacketEvent .Send .Pre > {
41- if (it.packet is LookAndOnGround ) {
42- // it.cancel()
43- LOG .info(" UNSAFE: Canceled: ${it.packet::class .simpleName} " )
44- }
45- }
46-
47- concurrentListener<PacketEvent .Send .Pre > {
48- if (it.packet is LookAndOnGround ) {
49- LOG .info(" CONCURRENT: ${it.packet::class .simpleName} " )
50- }
51- }
52-
53- unsafeConcurrentListener<PacketEvent .Send .Pre > {
54- if (it.packet is LookAndOnGround ) {
55- LOG .info(" UNSAFE CONCURRENT: ${it.packet::class .simpleName} " )
56- }
57- }
58-
59- LOG .info(" Registered sync listeners: ${EventFlow .syncListeners} " )
60- LOG .info(" Registered concurrent listeners: ${EventFlow .concurrentListeners} " )
61-
6233 runConcurrent {
6334 sleep(60000 )
6435 LOG .info(" Unsubscribing" )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ abstract class Listener : Comparable<Listener> {
99 abstract fun execute (event : Event )
1010
1111 override fun compareTo (other : Listener ): Int {
12- return priority.compareTo(other.priority )
12+ return compareBy< Listener > { it. priority }.thenBy { it.hashCode() }.compare( this , other )
1313 }
1414
1515 companion object {
You can’t perform that action at this time.
0 commit comments