You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
Once base packet class is done, start creating all the packets. These packets should go under pymine_net/packets/757/<state> and should be subclasses of src.types.packet.ServerBoundPacket or src.types.packet.ClientBoundPacket. For a list of all the packets, look here: https://wiki.vg/Protocol(Important: this link displays the most recent versions protocol, to view a specific version go here)
Packet Making Guide
Naming
Packets are named by their state and name on wiki.vg
Examples: class PlayUpdateLight or class HandshakeHandshake or class PlayPlayerPosition
Creation
Packets should have one class attribute (id), a docstring describing them and any other instance variables, an __init__, and an unpack or pack method (or both)
Packets need to subclass ServerBoundPacket or ClientBoundPacket and call super().__init__()
Example:
classTestExample(ServerBoundPacket, ClientBoundPacket):
"""This is an example packet, not used at all. (Client <-> Server) :param str dummy_payload: The payload of the packet. :attr int id: Unique packet ID. :attr dummy_payload: """id=0x00# ID of the packet, found on wiki.vg in the section where there's info on the packetdef__init__(self, dummy_payload: str):
super().__init__()
self.dummy_payload=dummy_payloaddefencode(self) ->Buffer:
returnBuffer().write_string(self.dummy_payload)
@classmethoddefdecode(cls, buf: Buffer) ->TestExample:
returncls(buf.read_string())
Additional Info:
Packet docstrings should be in the sphinx format, they can be generated via a plugin for atom or vscode.
Docstrings, on the first line, should contain the short summary, any additional links/info, and in parentheses the direction(s) of the packet.
Remember to add the name of the packet to the file's __all__ (located near the top of the file, after imports)
If you can't find the right file to place your packet, you can create a new one. Remember to add from __future__ import annotations to allow for return typehints to be the class itself, and to add an __all__.
Make sure the packet name and ID are correct before commiting, as some have changed since 754.
Progress Checklist (By States)
handshake packets
status packets
login packets
play packets
The text was updated successfully, but these errors were encountered:
Once base packet class is done, start creating all the packets. These packets should go under
pymine_net/packets/757/<state>
and should be subclasses ofsrc.types.packet.ServerBoundPacket
orsrc.types.packet.ClientBoundPacket
. For a list of all the packets, look here: https://wiki.vg/Protocol (Important: this link displays the most recent versions protocol, to view a specific version go here)Packet Making Guide
Naming
Examples:
class PlayUpdateLight
orclass HandshakeHandshake
orclass PlayPlayerPosition
Creation
id
), a docstring describing them and any other instance variables, an__init__
, and anunpack
orpack
method (or both)ServerBoundPacket
orClientBoundPacket
and callsuper().__init__()
Example:
Additional Info:
__all__
(located near the top of the file, after imports)from __future__ import annotations
to allow for return typehints to be the class itself, and to add an__all__
.Progress Checklist (By States)
The text was updated successfully, but these errors were encountered: