Skip to content

Commit 048ddf7

Browse files
committed
missed one here
1 parent 0d79c25 commit 048ddf7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

common/src/main/kotlin/com/lambda/event/events/PacketEvent.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import com.lambda.event.Event
2121
import com.lambda.event.EventFlow
2222
import com.lambda.event.callback.Cancellable
2323
import com.lambda.event.callback.ICancellable
24-
import com.lambda.event.events.PacketEvent.Receive
25-
import com.lambda.event.events.PacketEvent.Send
2624
import com.lambda.util.ClientPacket
2725
import com.lambda.util.ServerPacket
2826

@@ -41,44 +39,44 @@ import com.lambda.util.ServerPacket
4139
* @see Send
4240
* @see Receive
4341
*/
44-
abstract class PacketEvent : Event {
42+
sealed class PacketEvent {
4543
/**
4644
* Represents a [PacketEvent] that is triggered when a packet is sent.
4745
* It has two subclasses: [Pre] and [Post], which are triggered before and after the packet is sent.
4846
*/
49-
sealed class Send : PacketEvent() {
47+
sealed class Send {
5048
/**
5149
* Represents the event triggered before a packet is sent.
5250
*
5351
* @param packet the packet that is about to be sent.
5452
*/
55-
class Pre(val packet: ClientPacket) : Send(), ICancellable by Cancellable()
53+
data class Pre(val packet: ClientPacket) : ICancellable by Cancellable()
5654

5755
/**
5856
* Represents the event triggered after a packet is sent.
5957
*
6058
* @param packet the packet that has been sent.
6159
*/
62-
class Post(val packet: ClientPacket) : Send()
60+
data class Post(val packet: ClientPacket) : Event
6361
}
6462

6563
/**
6664
* Represents a [PacketEvent] that is triggered when a packet is received.
6765
* It has two subclasses: [Pre] and [Post], which are triggered before and after the packet is received.
6866
*/
69-
sealed class Receive : PacketEvent() {
67+
sealed class Receive {
7068
/**
7169
* Represents the event triggered before a packet is received.
7270
*
7371
* @param packet the packet that is about to be received.
7472
*/
75-
class Pre(val packet: ServerPacket) : Receive(), ICancellable by Cancellable()
73+
data class Pre(val packet: ServerPacket) : ICancellable by Cancellable()
7674

7775
/**
7876
* Represents the event triggered after a packet is received.
7977
*
8078
* @param packet the packet that has been received.
8179
*/
82-
class Post(val packet: ServerPacket) : Receive()
80+
data class Post(val packet: ServerPacket) : Event
8381
}
8482
}

0 commit comments

Comments
 (0)