public abstract class CheckRulesVersion<T extends PixelmonPacket> extends AbstractPixelmonPacket
Modifier and Type | Field and Description |
---|---|
protected T |
packet
The packet that will be processed once rules are synced.
|
Modifier | Constructor and Description |
---|---|
protected |
CheckRulesVersion()
Empty constructor for packet registration.
|
|
CheckRulesVersion(T packet)
Initializes a rules checking packet.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(net.minecraft.network.PacketBuffer buf)
Decodes the information from the buffer to the packet instance
|
void |
encode(net.minecraft.network.PacketBuffer buf)
Encodes the buffer with the packet information
|
protected void |
onMessage(net.minecraftforge.fml.network.NetworkEvent.Context context)
Verifies that the client has the same rules version as the server, and requests a sync if not.
|
abstract void |
processPacket(net.minecraftforge.fml.network.NetworkEvent.Context context)
Acts upon the inner packet when rules have been synced.
|
protected abstract void |
readPacket(net.minecraft.network.PacketBuffer buf)
Reads back the contained packet from buffer data.
|
handle, handlePacket, reply
protected T extends PixelmonPacket packet
protected CheckRulesVersion()
public CheckRulesVersion(T packet)
packet
- The packet that will be processed once rules are synced.public void encode(net.minecraft.network.PacketBuffer buf)
PixelmonPacket
encode
in interface PixelmonPacket
encode
in class AbstractPixelmonPacket
buf
- The buffer being encodedpublic void decode(net.minecraft.network.PacketBuffer buf)
PixelmonPacket
decode
in interface PixelmonPacket
decode
in class AbstractPixelmonPacket
buf
- The buffer being decodedprotected abstract void readPacket(net.minecraft.network.PacketBuffer buf)
buf
- The buffer to read data from.public abstract void processPacket(net.minecraftforge.fml.network.NetworkEvent.Context context)
context
- The context that the packet was sent from.protected void onMessage(net.minecraftforge.fml.network.NetworkEvent.Context context)
context
- The context that the packet was sent from.