-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCustomPacket.java
More file actions
31 lines (26 loc) · 931 Bytes
/
CustomPacket.java
File metadata and controls
31 lines (26 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.machinemc.paklet;
import org.machinemc.paklet.serialization.SerializerContext;
/**
* Used for packets that are serialized manually (not automatically using registered serializers).
* <p>
* This can be used for packets that require very specific serialization to be done to optimize
* the process and keeping the code clean.
* <p>
* This also allows the packet class to extend another class.
*/
public interface CustomPacket {
/**
* Used during deserialization of the packet to read the packet data.
*
* @param context serialization context
* @param visitor visitor
*/
void construct(SerializerContext context, DataVisitor visitor);
/**
* Used during serialization of the packet to write the packet data.
*
* @param context serialization context
* @param visitor visitor
*/
void deconstruct(SerializerContext context, DataVisitor visitor);
}