Compare commits

..

No commits in common. "dev" and "main" have entirely different histories.
dev ... main

247 changed files with 2900 additions and 4870 deletions

View file

@ -1,11 +1,11 @@
[package] [package]
name = "aiocraft" name = "aiocraft"
version = "0.3.0" version = "1.0.0"
edition = "2021" edition = "2021"
[lib] [lib]
name = "aiocraft" name = "aiocraft"
path = "src/aiocraft/rs/lib.rs" # The source file of the target. path = "src/lib.rs" # The source file of the target.
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]

View file

@ -1,46 +1,2 @@
# aiocraft # aiocraft
**an asyncio-driven headless client library for block game with packet definitions** An asyncio-driven headless client library for block game
aiocraft is a collection of types, definitions and utils to build minecraft clients without the official Java implementation
it is built on top of [PrismarineJS/minecraft-data](https://github.com/PrismarineJS/minecraft-data), which contains definitions for all types across all versions
aiocraft provides a raw implementation of a client but it isn't ready to be used, if you're looking for a convenient client library take a look at **[Treepuncher](https://git.alemi.dev/treepuncher.git/about)**
## Packets
the whole Minecraft protocol from `0.30c` to `1.19.3` is compiled and available
feature flags to only include certain protocol versions are planned
all types and packets are instantiable and serializable on all supported protocols:
```py
from aiocraft.proto.play.serverbound import PacketPosition
a_packet = PacketPosition(x=-4.0, y=64.0, z=10.5, onGround=True)
await client.dispatcher.write(a_packet)
```
## Client
an abstract client implementation is provided, but it's supposed to be extended (like in **[Treepuncher](https://git.alemi.dev/treepuncher.git/about)**)
the abstract client implements flows for all game phases and both a `.join()` or a `.info()` method to easily start the login flow
## Types
aiocraft defines these minecraft types:
* `Dimension`
* `Difficulty`
* `Gamemode`
* `GameProfile`
* `Enchantment`
* `BlockPos`
* `Item` (without constants)
* `Texture`
* `Player`
more types are planned but still not generated:
* `Entity`
* `Block`
* `Item` (with constants)
## World
a chunk parser is provided with native code (Rust + PyO3). It is pretty fast but the abstract client doesn't make use of it

12
aiocraft/__init__.py Normal file
View file

@ -0,0 +1,12 @@
"""aiocraft is an asyncio-driven headless minecraft client"""
# from .client import Client
from .mc import * # TODO move mc out of mc
from .client import MinecraftClient
from .server import MinecraftServer
from .mc.auth import MicrosoftAuthenticator, MojangAuthenticator
from .aiocraft import * # This is needed for PyO3 functions! No clue why or how...
__author__ = "alemidev"
__credits__ = "Thanks to pyCraft, really inspired this"

View file

@ -1,74 +1,77 @@
import asyncio
import logging import logging
import json import json
import uuid
from dataclasses import dataclass
from asyncio import Task from asyncio import Task
from enum import Enum
from time import time from time import time
from typing import Any, Type from typing import Dict, List, Callable, Type, Optional, Tuple, AsyncIterator, Any, Set
import dns.resolver import dns.resolver
from .dispatcher import Dispatcher from .dispatcher import Dispatcher
from .auth import AuthInterface, AuthException from .mc.packet import Packet
from .types import ConnectionState from .mc.auth import AuthInterface, AuthException, MojangAuthenticator, MicrosoftAuthenticator
from .packet import Packet from .mc.definitions import Dimension, Difficulty, Gamemode, ConnectionState
from .proto.status.serverbound import PacketPing, PacketPingStart from .mc.proto.status.serverbound import PacketPing, PacketPingStart
from .proto.status.clientbound import PacketServerInfo, PacketPing as PacketPong from .mc.proto.status.clientbound import PacketServerInfo, PacketPing as PacketPong
from .proto.handshaking.serverbound import PacketSetProtocol from .mc.proto.handshaking.serverbound import PacketSetProtocol
from .proto.play.serverbound import PacketKeepAlive as PacketKeepAliveResponse from .mc.proto.play.serverbound import PacketKeepAlive as PacketKeepAliveResponse
from .proto.play.clientbound import PacketKeepAlive, PacketSetCompression, PacketKickDisconnect from .mc.proto.play.clientbound import PacketKeepAlive, PacketSetCompression, PacketKickDisconnect
from .proto.login.serverbound import PacketLoginStart, PacketEncryptionBegin as PacketEncryptionResponse from .mc.proto.login.serverbound import PacketLoginStart, PacketEncryptionBegin as PacketEncryptionResponse
from .proto.login.clientbound import ( from .mc.proto.login.clientbound import (
PacketCompress, PacketDisconnect, PacketEncryptionBegin, PacketLoginPluginRequest, PacketSuccess PacketCompress, PacketDisconnect, PacketEncryptionBegin, PacketLoginPluginRequest, PacketSuccess
) )
from .util import encryption, helpers from .util import encryption, helpers
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
class AbstractMinecraftClient: class MinecraftClient:
online_mode:bool online_mode:bool
authenticator:AuthInterface authenticator:AuthInterface
dispatcher : Dispatcher
logger : logging.Logger logger : logging.Logger
_dispatcher: Dispatcher | None
_authenticated : bool _authenticated : bool
_processing : bool _processing : bool
_worker : Task _worker : Task
def __init__( def __init__(
self, self,
server:str,
authenticator:AuthInterface, authenticator:AuthInterface,
online_mode:bool = True, online_mode:bool = True,
force_port:int = 0,
resolve_srv:bool = True,
): ):
self.logger = LOGGER.getChild(f"as({authenticator.selectedProfile.name})") self.logger = LOGGER.getChild(f"on({server})")
self.online_mode = online_mode self.online_mode = online_mode
self.authenticator = authenticator self.authenticator = authenticator
self._authenticated = False self._authenticated = False
self._processing = False self._processing = False
self._dispatcher = None
def resolve_srv(self, server: str) -> tuple[str, int]: host = server
port = force_port or 25565
if resolve_srv:
try: try:
answ = dns.resolver.resolve(f"_minecraft._tcp.{server}", "SRV") answ = dns.resolver.resolve(f"_minecraft._tcp.{server}", "SRV")
# TODO can we just use the 1st record? # TODO can we just use the 1st record?
host = str(answ[0].target).rstrip('.') host = str(answ[0].target).rstrip('.')
port = answ[0].port port = answ[0].port
return (host, port)
except Exception: # TODO what can I catch? dns.resolver.exception doesn't always exist, wtf except Exception: # TODO what can I catch? dns.resolver.exception doesn't always exist, wtf
self.logger.warning("Failed resolving SRV record for '%s'", server) self.logger.warning("Failed resolving SRV record for '%s'", server)
return (server, 25565)
self.dispatcher = Dispatcher().set_host(host, port)
@property @property
def connected(self) -> bool: def connected(self) -> bool:
return self._dispatcher is not None and self.dispatcher.connected return self.dispatcher.connected
@property async def write(self, packet:Packet, wait:bool=False):
def dispatcher(self) -> Dispatcher: await self.dispatcher.write(packet, wait)
# This is a weird fix to avoid asserting dispatcher is not None in all handlers:
# if i'm receiving a packet callback dispatcher is very likely not None, if I received
# a callback and it's None it's because client is stopping so an exc is ok
if self._dispatcher is None:
raise ValueError("Invalid state: connect first")
return self._dispatcher
async def authenticate(self): async def authenticate(self):
if self._authenticated: if self._authenticated:
@ -86,78 +89,46 @@ class AbstractMinecraftClient:
self.logger.info("Logged in") self.logger.info("Logged in")
self._authenticated = True self._authenticated = True
async def info( async def info(self, host:str="", port:int=0, proto:int=0, ping:bool=False) -> Dict[str, Any]:
self,
host:str,
port:int=0,
proto:int=0,
ping:bool=False,
log_ignored_packets:bool=False,
whitelist: set[Type[Packet]] = set(),
) -> dict[str, Any]:
"""Make a mini connection to asses server status and version""" """Make a mini connection to asses server status and version"""
if not port:
host, port = self.resolve_srv(host)
self._dispatcher = Dispatcher(
host=host,
port=port,
proto=proto,
log_ignored_packets=log_ignored_packets,
whitelist=whitelist
)
try: try:
await self.dispatcher.connect() await self.dispatcher.set_host(host, port).connect()
await self._handshake(ConnectionState.STATUS) await self._handshake(ConnectionState.STATUS)
return await self._status(ping) return await self._status(ping)
finally: finally:
if self.dispatcher.connected: if self.dispatcher.connected:
await self.dispatcher.disconnect() await self.dispatcher.disconnect()
self._dispatcher = None
async def join( async def join(self, host:str="", port:int=0, proto:int=0):
self,
host:str,
port:int=0,
proto:int=0,
log_ignored_packets:bool=False,
whitelist: set[Type[Packet]]=set(),
):
if not port:
host, port = self.resolve_srv(host)
self._dispatcher = Dispatcher(
host=host,
port=port,
proto=proto,
log_ignored_packets=log_ignored_packets,
whitelist=whitelist,
)
if self.online_mode: if self.online_mode:
await self.authenticate() await self.authenticate()
try: try:
await self.dispatcher.connect() await self.dispatcher.set_host(host, port).set_proto(proto).connect()
await self._handshake(ConnectionState.LOGIN) await self._handshake(ConnectionState.LOGIN)
if await self._login(): if await self._login():
await self._play() await self._play()
finally: finally:
if self.dispatcher.connected: if self.dispatcher.connected:
await self.dispatcher.disconnect() await self.dispatcher.disconnect()
self._dispatcher = None
async def _handshake(self, state:ConnectionState): async def _handshake(self, state:ConnectionState):
await self.dispatcher.write( await self.dispatcher.write(
PacketSetProtocol( PacketSetProtocol(
protocolVersion=self.dispatcher.proto, self.dispatcher._proto,
serverHost=self.dispatcher.host, protocolVersion=self.dispatcher._proto,
serverPort=self.dispatcher.port, serverHost=self.dispatcher._host,
serverPort=self.dispatcher._port,
nextState=state.value nextState=state.value
) )
) )
async def _status(self, ping:bool=False) -> dict[str, Any]: async def _status(self, ping:bool=False) -> Dict[str, Any]:
self.dispatcher.promote(ConnectionState.STATUS) self.dispatcher.state = ConnectionState.STATUS
await self.dispatcher.write(PacketPingStart()) #empty packet await self.dispatcher.write(
PacketPingStart(self.dispatcher._proto) #empty packet
)
#Response #Response
data : dict[str, Any] = {} data : Dict[str, Any] = {}
ping_id : int = 0 ping_id : int = 0
ping_time : float = 0 ping_time : float = 0
async for packet in self.dispatcher.packets(): async for packet in self.dispatcher.packets():
@ -169,7 +140,10 @@ class AbstractMinecraftClient:
ping_id = int(time()) ping_id = int(time())
ping_time = time() ping_time = time()
await self.dispatcher.write( await self.dispatcher.write(
PacketPing(time=ping_id) PacketPing(
self.dispatcher._proto,
time=ping_id,
)
) )
if isinstance(packet, PacketPong): if isinstance(packet, PacketPong):
if packet.time == ping_id: if packet.time == ping_id:
@ -178,9 +152,12 @@ class AbstractMinecraftClient:
return data return data
async def _login(self) -> bool: async def _login(self) -> bool:
self.dispatcher.promote(ConnectionState.LOGIN) self.dispatcher.state = ConnectionState.LOGIN
await self.dispatcher.write( await self.dispatcher.write(
PacketLoginStart(username=self.authenticator.selectedProfile.name) PacketLoginStart(
self.dispatcher._proto,
username=self.authenticator.selectedProfile.name
)
) )
async for packet in self.dispatcher.packets(): async for packet in self.dispatcher.packets():
if isinstance(packet, PacketEncryptionBegin): if isinstance(packet, PacketEncryptionBegin):
@ -209,6 +186,7 @@ class AbstractMinecraftClient:
else: else:
self.logger.warning("Server gave an offline-mode serverId but still requested Encryption") self.logger.warning("Server gave an offline-mode serverId but still requested Encryption")
encryption_response = PacketEncryptionResponse( encryption_response = PacketEncryptionResponse(
self.dispatcher._proto,
sharedSecret=encrypted_secret, sharedSecret=encrypted_secret,
verifyToken=token verifyToken=token
) )
@ -228,7 +206,7 @@ class AbstractMinecraftClient:
return False return False
async def _play(self): async def _play(self):
self.dispatcher.promote(ConnectionState.PLAY) self.dispatcher.state = ConnectionState.PLAY
async for packet in self.dispatcher.packets(): async for packet in self.dispatcher.packets():
self.logger.debug("[ * ] Processing %s", packet.__class__.__name__) self.logger.debug("[ * ] Processing %s", packet.__class__.__name__)
if isinstance(packet, PacketSetCompression): if isinstance(packet, PacketSetCompression):

View file

@ -1,18 +1,19 @@
import io import io
import asyncio import asyncio
import contextlib
import zlib import zlib
import logging import logging
from typing import Type, AsyncIterator
from asyncio import StreamReader, StreamWriter, Queue, Task from asyncio import StreamReader, StreamWriter, Queue, Task
from enum import Enum
from typing import List, Dict, Set, Optional, AsyncIterator, Type, Union
from types import ModuleType from types import ModuleType
from cryptography.hazmat.primitives.ciphers import CipherContext from cryptography.hazmat.primitives.ciphers import CipherContext
from . import proto as minecraft_protocol from .mc import proto as minecraft_protocol
from .primitives import VarInt, Context from .mc.types import VarInt, Context
from .packet import Packet from .mc.packet import Packet
from .types import ConnectionState from .mc.definitions import ConnectionState
from .util import encryption from .util import encryption
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
@ -28,11 +29,11 @@ class Dispatcher:
_is_server : bool # True when receiving packets from clients _is_server : bool # True when receiving packets from clients
_down : StreamReader _down : StreamReader
_reader : Task | None _reader : Optional[Task]
_decryptor : CipherContext _decryptor : CipherContext
_up : StreamWriter _up : StreamWriter
_writer : Task | None _writer : Optional[Task]
_encryptor : CipherContext _encryptor : CipherContext
_dispatching : bool _dispatching : bool
@ -40,8 +41,8 @@ class Dispatcher:
_incoming : Queue _incoming : Queue
_outgoing : Queue _outgoing : Queue
_packet_whitelist : set[Type[Packet]] | None _packet_whitelist : Optional[Set[Type[Packet]]]
_packet_id_whitelist : set[int] | None _packet_id_whitelist : Optional[Set[int]]
_log_ignored_packets : bool _log_ignored_packets : bool
@ -51,39 +52,20 @@ class Dispatcher:
_proto : int _proto : int
_encryption : bool _encryption : bool
_compression : int | None _compression : Optional[int]
state : ConnectionState # TODO make getter/setter ? state : ConnectionState # TODO make getter/setter ?
logger : logging.Logger logger : logging.Logger
def __init__( def __init__(self, server:bool = False):
self, self._proto = 757
host:str = "localhost",
port:int = 25565,
proto:int = 757,
compression_threshold: int | None = None,
server:bool = False,
log_ignored_packets: bool = False,
whitelist: set[Type[Packet]] = set(),
):
self._proto = proto
self._host = host
self._port = port
self._compression = compression_threshold
self._is_server = server self._is_server = server
self._host = "localhost"
self._port = 25565
self._dispatching = False self._dispatching = False
self._packet_whitelist = None self._packet_whitelist = None
self._packet_id_whitelist = None self._packet_id_whitelist = None
self._log_ignored_packets = log_ignored_packets self._log_ignored_packets = False
self._packet_whitelist = set(whitelist) if whitelist is not None else None
if self._packet_whitelist:
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKeepAlive)
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKickDisconnect)
self._packet_id_whitelist = set((P().for_proto(self.proto) for P in self._packet_whitelist)) if self._packet_whitelist else None
def promote(self, next_state:ConnectionState):
# change dispatcher state
self.state = next_state
@property @property
def proto(self) -> int: def proto(self) -> int:
@ -102,7 +84,7 @@ class Dispatcher:
return self._encryption return self._encryption
@property @property
def compression(self) -> int | None: def compression(self) -> Optional[int]:
return self._compression return self._compression
@property @property
@ -130,7 +112,7 @@ class Dispatcher:
except asyncio.TimeoutError: except asyncio.TimeoutError:
pass # so we recheck self.connected pass # so we recheck self.connected
def encrypt(self, secret: bytes | None = None): def encrypt(self, secret:Optional[bytes]=None) -> 'Dispatcher':
if secret is not None: if secret is not None:
cipher = encryption.create_AES_cipher(secret) cipher = encryption.create_AES_cipher(secret)
self._encryptor = cipher.encryptor() self._encryptor = cipher.encryptor()
@ -140,20 +122,52 @@ class Dispatcher:
else: else:
self._encryption = False self._encryption = False
self.logger.info("Encryption disabled") self.logger.info("Encryption disabled")
return self
def update_compression_threshold(self, threshold: int | None): def whitelist(self, ids:Optional[List[Type[Packet]]]) -> 'Dispatcher':
self._compression = threshold or 0 self._packet_whitelist = set(ids) if ids is not None else None
if self._packet_whitelist:
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKeepAlive)
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKickDisconnect)
self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist)) if self._packet_whitelist else None
return self
def set_host(
self,
host:Optional[str]="",
port:Optional[int]=0,
) -> 'Dispatcher':
self._host = host or self._host
self._port = port or self._port
self.logger = LOGGER.getChild(f"on({self._host}:{self._port})")
return self
def set_proto(self, proto:Optional[int]=757) -> 'Dispatcher':
self._proto = proto or self._proto
if self._packet_whitelist:
self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist))
return self
def set_compression(self, threshold:Optional[int] = None) -> 'Dispatcher':
self._compression = threshold
return self
def set_state(self, state:Optional[ConnectionState]=ConnectionState.HANDSHAKING) -> 'Dispatcher':
self.state = state or self.state
return self
def log_ignored_packets(self, log:bool) -> 'Dispatcher':
self._log_ignored_packets = log
return self
async def connect(self, async def connect(self,
reader : StreamReader | None = None, reader : Optional[StreamReader] = None,
writer : StreamWriter | None = None, writer : Optional[StreamWriter] = None,
queue_size : int = 100, queue_size : int = 100,
): ) -> 'Dispatcher':
if self.connected: if self.connected:
raise InvalidState("Dispatcher already connected") raise InvalidState("Dispatcher already connected")
self.logger = LOGGER.getChild(f"on({self._host}:{self._port})")
self._encryption = False self._encryption = False
self._compression = None self._compression = None
self._incoming = Queue(queue_size) self._incoming = Queue(queue_size)
@ -177,7 +191,7 @@ class Dispatcher:
self.logger.info("Connected") self.logger.info("Connected")
return self return self
async def disconnect(self, block:bool=True): async def disconnect(self, block:bool=True) -> 'Dispatcher':
self._dispatching = False self._dispatching = False
if block and self._writer and self._reader: if block and self._writer and self._reader:
await asyncio.gather(self._writer, self._reader) await asyncio.gather(self._writer, self._reader)
@ -219,10 +233,7 @@ class Dispatcher:
if not self._proto: if not self._proto:
raise InvalidState("Cannot access registries from invalid protocol") raise InvalidState("Cannot access registries from invalid protocol")
proto = self._proto proto_reg = reg[self._proto]
while proto not in reg:
proto -= 1
proto_reg = reg[proto]
return proto_reg[packet_id] return proto_reg[packet_id]
@ -300,7 +311,7 @@ class Dispatcher:
self.logger.debug("%s", buffer.getvalue()) self.logger.debug("%s", buffer.getvalue())
await self.disconnect(block=False) await self.disconnect(block=False)
async def _up_worker(self, timeout:float = 1.): async def _up_worker(self, timeout=1):
while self._dispatching: while self._dispatching:
try: try:
packet : Packet = await asyncio.wait_for(self._outgoing.get(), timeout=timeout) packet : Packet = await asyncio.wait_for(self._outgoing.get(), timeout=timeout)
@ -311,7 +322,7 @@ class Dispatcher:
return return
try: try:
buffer = packet.serialize(self.proto) buffer = packet.serialize()
length = len(buffer.getvalue()) # ewww TODO length = len(buffer.getvalue()) # ewww TODO
if self._compression is not None: if self._compression is not None:

2
aiocraft/mc/__init__.py Normal file
View file

@ -0,0 +1,2 @@
from .packet import Packet
from .definitions import *

View file

@ -6,7 +6,7 @@ from typing import Optional, Dict, Any
import aiohttp import aiohttp
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from ..types import GameProfile from ..definitions import GameProfile
logger = logging.getLogger(__file__) logger = logging.getLogger(__file__)
@ -26,14 +26,10 @@ class AuthException(Exception):
class AuthInterface: class AuthInterface:
accessToken : str accessToken : str
selectedProfile : GameProfile selectedProfile : GameProfile
session_server_override : str | None = None
SESSION_SERVER = "https://sessionserver.mojang.com/session/minecraft" SESSION_SERVER = "https://sessionserver.mojang.com/session/minecraft"
TIMEOUT = aiohttp.ClientTimeout(total=3) TIMEOUT = aiohttp.ClientTimeout(total=3)
def __init__(self):
raise NotImplementedError
async def login(self) -> 'AuthInterface': async def login(self) -> 'AuthInterface':
raise NotImplementedError raise NotImplementedError
@ -49,29 +45,27 @@ class AuthInterface:
def deserialize(self, data:Dict[str, Any]): def deserialize(self, data:Dict[str, Any]):
raise NotImplementedError raise NotImplementedError
@property
def session_server(self) -> str:
return self.session_server_override or self.SESSION_SERVER
async def join(self, server_id) -> dict: async def join(self, server_id) -> dict:
return await self._post( return await self._post(
self.session_server + "/join", self.SESSION_SERVER + "/join",
headers={"content-type":"application/json"}, headers={"content-type":"application/json"},
json={ json={
"serverId": server_id, "serverId": server_id,
"accessToken": self.accessToken, "accessToken": self.accessToken,
"selectedProfile": self.selectedProfile.id, "selectedProfile": self.selectedProfile.serialize()
} }
) )
async def server_join(self, username:str, serverId:str, ip:Optional[str] = None): @classmethod # TODO more love for server side!
async def server_join(cls, username:str, serverId:str, ip:Optional[str] = None):
params = {"username":username, "serverId":serverId} params = {"username":username, "serverId":serverId}
if ip: if ip:
params["ip"] = ip params["ip"] = ip
return await self._get(self.session_server + "/hasJoined", params=params) return await cls._get(cls.SESSION_SERVER + "/hasJoined", params=params)
async def _post(self, endpoint:str, **kwargs) -> Dict[str, Any]: @classmethod
async with aiohttp.ClientSession(timeout=self.TIMEOUT) as session: async def _post(cls, endpoint:str, **kwargs) -> Dict[str, Any]:
async with aiohttp.ClientSession(timeout=cls.TIMEOUT) as session:
try: try:
async with session.post(endpoint, **kwargs) as res: async with session.post(endpoint, **kwargs) as res:
try: try:
@ -85,8 +79,9 @@ class AuthInterface:
except TimeoutError: except TimeoutError:
raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs) raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs)
async def _get(self, endpoint:str, **kwargs) -> Dict[str, Any]: @classmethod
async with aiohttp.ClientSession(timeout=self.TIMEOUT) as session: async def _get(cls, endpoint:str, **kwargs) -> Dict[str, Any]:
async with aiohttp.ClientSession(timeout=cls.TIMEOUT) as session:
try: try:
async with session.get(endpoint, **kwargs) as res: async with session.get(endpoint, **kwargs) as res:
try: try:

View file

@ -1,9 +1,14 @@
import re
import uuid
import logging import logging
from urllib.parse import urlencode from urllib.parse import urlencode
from typing import Any from typing import Dict, List, Optional, Any
from ..types import GameProfile from yarl import URL
import aiohttp
from ..definitions import GameProfile
from .interface import AuthInterface, AuthException from .interface import AuthInterface, AuthException
class InvalidStateError(Exception): class InvalidStateError(Exception):
@ -13,11 +18,11 @@ class MicrosoftAuthenticator(AuthInterface):
client_id : str client_id : str
client_secret : str client_secret : str
redirect_uri : str redirect_uri : str
code : str | None code : Optional[str]
accessToken : str accessToken : str
selectedProfile : GameProfile selectedProfile : GameProfile
refreshToken : str | None refreshToken : Optional[str]
MINECRAFT_CLIENT_ID = "00000000402b5328" MINECRAFT_CLIENT_ID = "00000000402b5328"
OAUTH_LOGIN = "https://login.live.com/oauth20" OAUTH_LOGIN = "https://login.live.com/oauth20"
@ -29,7 +34,7 @@ class MicrosoftAuthenticator(AuthInterface):
client_id:str, client_id:str,
client_secret:str, client_secret:str,
redirect_uri:str="http://localhost", redirect_uri:str="http://localhost",
code:str|None = None code:Optional[str]=None
): ):
self.client_id = client_id self.client_id = client_id
self.client_secret = client_secret self.client_secret = client_secret
@ -39,14 +44,14 @@ class MicrosoftAuthenticator(AuthInterface):
self.accessToken = '' self.accessToken = ''
self.selectedProfile = GameProfile(id='', name='') self.selectedProfile = GameProfile(id='', name='')
def serialize(self) -> dict[str, Any]: def serialize(self) -> Dict[str, Any]:
return { return {
'accessToken': self.accessToken, 'accessToken': self.accessToken,
'refreshToken': self.refreshToken, 'refreshToken': self.refreshToken,
'selectedProfile': self.selectedProfile.serialize(), 'selectedProfile': self.selectedProfile.serialize(),
} }
def deserialize(self, data:dict[str, Any]): def deserialize(self, data:Dict[str, Any]):
self.accessToken = data['accessToken'] self.accessToken = data['accessToken']
self.refreshToken = data['refreshToken'] self.refreshToken = data['refreshToken']
self.selectedProfile = GameProfile(**data['selectedProfile']) self.selectedProfile = GameProfile(**data['selectedProfile'])
@ -60,9 +65,9 @@ class MicrosoftAuthenticator(AuthInterface):
return ( return (
self.OAUTH_LOGIN + "_authorize.srf" + self.OAUTH_LOGIN + "_authorize.srf" +
f"?client_id={self.client_id}" + f"?client_id={self.client_id}" +
"&response_type=code" + f"&response_type=code" +
f"&redirect_uri={self.redirect_uri}" + f"&redirect_uri={self.redirect_uri}" +
"&scope=XboxLive.signin%20offline_access" + f"&scope=XboxLive.signin%20offline_access" +
f"&state={state}" f"&state={state}"
) )
@ -176,7 +181,7 @@ class MicrosoftAuthenticator(AuthInterface):
) )
return auth_response['access_token'] return auth_response['access_token']
async def fetch_mcstore(self) -> dict[str, Any]: async def fetch_mcstore(self) -> Dict[str, Any]:
"""Get the store information""" """Get the store information"""
logging.debug("Fetching MC Store") logging.debug("Fetching MC Store")
return await self._get( return await self._get(
@ -184,7 +189,7 @@ class MicrosoftAuthenticator(AuthInterface):
headers={ "Authorization": f"Bearer {self.accessToken}" }, headers={ "Authorization": f"Bearer {self.accessToken}" },
) )
async def fetch_profile(self) -> dict[str, Any]: async def fetch_profile(self) -> Dict[str, Any]:
"""Get player profile""" """Get player profile"""
logging.debug("Fetching profile") logging.debug("Fetching profile")
return await self._get( return await self._get(

View file

@ -1,20 +1,23 @@
"""Minecraft identity utilities.""" """Minecraft identity utilities."""
import json import json
import uuid import uuid
import logging
from dataclasses import dataclass from dataclasses import dataclass
from typing import Optional, Dict, Any from typing import Optional, Dict, Any
import aiohttp
from .interface import AuthInterface, AuthException from .interface import AuthInterface, AuthException
from ..types import GameProfile from ..definitions import GameProfile
@dataclass @dataclass
class MojangAuthenticator(AuthInterface): class MojangAuthenticator(AuthInterface):
username : str username : str
password : Optional[str] password : Optional[str]
accessToken : str
clientToken : str clientToken : str
auth_server_override : str | None = None selectedProfile : GameProfile
AGENT_NAME = "Minecraft" AGENT_NAME = "Minecraft"
AGENT_VERSION = 1 AGENT_VERSION = 1
@ -22,19 +25,12 @@ class MojangAuthenticator(AuthInterface):
CONTENT_TYPE = "application/json" CONTENT_TYPE = "application/json"
HEADERS = {"content-type": CONTENT_TYPE} HEADERS = {"content-type": CONTENT_TYPE}
def __init__( def __init__(self, username:str="", password:Optional[str]=None):
self, username:str="",
password:Optional[str]=None,
session_server_override:Optional[str]=None,
auth_server_override:Optional[str]=None,
):
self.username = username self.username = username
self.password = password self.password = password
self.accessToken = "" self.accessToken = ""
self.clientToken = "" self.clientToken = ""
self.selectedProfile = GameProfile("", username) self.selectedProfile = GameProfile("", username)
self.session_server_override = session_server_override
self.auth_server_override = auth_server_override
def __equals__(self, other) -> bool: def __equals__(self, other) -> bool:
if not isinstance(other, self.__class__): if not isinstance(other, self.__class__):
@ -52,16 +48,6 @@ class MojangAuthenticator(AuthInterface):
def __str__(self) -> str: def __str__(self) -> str:
return repr(self) return repr(self)
@property
def auth_server(self) -> str:
return self.auth_server_override or self.AUTH_SERVER
@property
def code(self) -> str:
if self.username and self.password:
return self.username
return ""
def serialize(self) -> Dict[str, Any]: def serialize(self) -> Dict[str, Any]:
return { return {
"username":self.username, "username":self.username,
@ -89,7 +75,7 @@ class MojangAuthenticator(AuthInterface):
payload["clientToken"] = uuid.uuid4().hex # don't include this to invalidate all other sessions payload["clientToken"] = uuid.uuid4().hex # don't include this to invalidate all other sessions
res = await self._post(self.auth_server + "/authenticate", json=payload) res = await self._post(self.AUTH_SERVER + "/authenticate", json=payload)
self.accessToken=res["accessToken"] self.accessToken=res["accessToken"]
self.clientToken=res["clientToken"] self.clientToken=res["clientToken"]
@ -97,10 +83,11 @@ class MojangAuthenticator(AuthInterface):
return self return self
async def sign_out(self, username:str, password:str) -> dict: @classmethod
return await self._post( async def sign_out(cls, username:str, password:str) -> dict:
self.auth_server + "/signout", return await cls._post(
headers=self.HEADERS, cls.AUTH_SERVER + "/signout",
headers=cls.HEADERS,
json={ json={
"username": username, "username": username,
"password": password "password": password
@ -111,7 +98,7 @@ class MojangAuthenticator(AuthInterface):
if not self.accessToken or not self.clientToken: if not self.accessToken or not self.clientToken:
raise AuthException("/refresh", 0, {"message":"No access token or client token"}, {}) raise AuthException("/refresh", 0, {"message":"No access token or client token"}, {})
res = await self._post( res = await self._post(
self.auth_server + "/refresh", self.AUTH_SERVER + "/refresh",
headers=self.HEADERS, headers=self.HEADERS,
json={ json={
"accessToken": self.accessToken, "accessToken": self.accessToken,
@ -123,7 +110,7 @@ class MojangAuthenticator(AuthInterface):
self.clientToken = res["clientToken"] self.clientToken = res["clientToken"]
self.selectedProfile = GameProfile(**res["selectedProfile"]) self.selectedProfile = GameProfile(**res["selectedProfile"])
if "user" in res and res["user"]: if "user" in res:
self.username = res["user"]["username"] self.username = res["user"]["username"]
return self return self
@ -135,7 +122,7 @@ class MojangAuthenticator(AuthInterface):
if clientToken: if clientToken:
payload["clientToken"] = self.clientToken payload["clientToken"] = self.clientToken
await self._post( await self._post(
self.auth_server + "/validate", self.AUTH_SERVER + "/validate",
headers=self.HEADERS, headers=self.HEADERS,
json=payload, json=payload,
) )
@ -143,7 +130,7 @@ class MojangAuthenticator(AuthInterface):
async def invalidate(self) -> AuthInterface: async def invalidate(self) -> AuthInterface:
await self._post( await self._post(
self.auth_server + "/invalidate", self.AUTH_SERVER + "/invalidate",
headers=self.HEADERS, headers=self.HEADERS,
json= { json= {
"accessToken": self.accessToken, "accessToken": self.accessToken,

275
aiocraft/mc/chunk.py Normal file
View file

@ -0,0 +1,275 @@
import io
import math
import logging
import struct
from typing import Dict, Tuple, Any, Optional, Iterable, List
import numpy as np
from aiocraft.mc.types import VarInt, Short, UnsignedByte, UnsignedLong, Type, Context
def bit_pack(data:Iterable[int], bits:int, size:int=64):
if size <= bits:
raise ValueError("Cannot pack into chunks smaller than bits per block")
out : List[int] = []
cursor = 0
buffer = 0
for el in data:
if cursor + bits > size:
delta = (cursor+bits) - size
buffer |= (el & (2**(bits-delta) - 1)) << cursor
out.append(buffer)
buffer = 0 | (( el >> (bits-delta) ) & (2**(delta) - 1))
cursor = delta
else:
buffer |= (el & (2**bits - 1)) << cursor
cursor += bits
return out
class BitStream:
data : bytes
cursor : int
size : int
def __init__(self, data:bytes, size:int):
self.data = data
self.cursor = 0
self.size = size if size > 0 else len(self.data) * 8
def __len__(self) -> int:
return self.size - self.cursor
def read(self, size:int) -> int:
if len(self) < size:
raise ValueError(f"Not enough bits ({len(self)} left, {size} requested)")
# Calculate splice indexes
start_byte = math.floor(self.cursor / 8)
end_byte = math.ceil((self.cursor + size) / 8)
# Construct int from bytes
buf = 0
delta = end_byte-start_byte
fmt = f">{delta}B" # TODO endianness doesn't seem to matter?
unpacked = struct.unpack(fmt, self.data[start_byte:end_byte])
for (i, x) in enumerate(unpacked):
# buf |= (x << (8 * (len(unpacked) - (i + 1))))
buf |= (x << (8 * i))
# Trim extra bits
# offset = self.cursor % 8 # start
offset = (8*delta) - ((self.cursor + size) % (8 * delta)) # end
if offset > 0:
buf = buf >> offset # There's an extra 1 to the left in air, maybe shift 1 bit less?
buf = buf & ((1 << size) - 1)
# Increment and return
self.cursor += size
return buf
class PalettedContainer(Type):
"""
block_data = [ UnsignedLong.read(buf) for _ in range(container_size) ]
for y in range(self.size):
for z in range(self.size):
for x in range(self.size):
i = x + ((y * 16) + z) * 16
start_long = (i * bits) // 64
start_offset = (i * bits) % 64
end_long = ((i + 1) * bits - 1) // 64
if start_long == end_long:
block = (block_data[start_long] >> start_offset) & max_val
else:
end_offset = 64 - start_offset
block = (block_data[start_long] >> start_offset |
block_data[end_long] << end_offset) & max_val
"""
pytype : type
threshold : int
size : int
def __init__(self, threshold:int, size:int):
self.threshold = threshold
self.size = size
def write(self, data, buffer:io.BytesIO, ctx:Context):
# TODO attempt to make a palette rather than sending always 13
UnsignedByte.write(13, buffer, ctx=ctx) # 13 bits per block
VarInt.write(0, buffer, ctx=ctx) # 0 palette len
for c in bit_pack(blocks, 13, 8*8): # FIXME add generator to iter blocks? idk
UnsignedLong.write(c, buffer, ctx=ctx)
def read(self, buffer:io.BytesIO, ctx:Context):
bits = UnsignedByte.read(buffer, ctx=ctx) # FIXME if bits > 4 it reads trash
#logging.debug("[%d|%d@%d] Bits per block : %d", ctx.x, ctx.z, ctx.sec, bits)
if bits < 4:
bits = 4
if bits >= self.threshold:
bits = 13 # this should not be hardcoded but we have no way to calculate all possible block states
palette_len = VarInt.read(buffer, ctx=ctx)
palette = np.zeros((palette_len,), dtype='int32')
for i in range(palette_len):
palette[i] = VarInt.read(buffer, ctx=ctx)
# logging.debug("[%d|%d@%d] Palette section : [%d] %s", ctx.x, ctx.z, ctx.sec, palette_len, str(palette))
container_size = VarInt.read(buffer, ctx=ctx)
section = np.zeros((self.size, self.size, self.size), dtype='int32')
stream = BitStream(buffer.read(container_size * 8), container_size*8*8) # a Long is 64 bits long
# logging.debug("[%d|%d@%d] Buffer : %s", ctx.x, ctx.z, ctx.sec, stream.data)
for y in range(self.size):
for z in range(self.size):
for x in range(self.size):
val = stream.read(bits)
if val >= len(palette):
logging.warning("out of bounds : %d (%d)", val, len(palette)) # FIXME happens a lot!
section[x, y, z] = val
continue
section[x, y, z] = palette[val] if bits < self.threshold else val
return section
BiomeContainer = PalettedContainer(4, 4)
BlockStateContainer = PalettedContainer(9, 16)
class HalfByteArrayType(Type):
size : int
def __init__(self, size:int):
self.size = size
def write(self, data:np.ndarray, buffer:io.BytesIO, ctx:Context):
if data.shape != (self.size, self.size, self.size):
raise ValueError(f"Array must be of shape {str((self.size, self.size, self.size))}")
alternating = False
val = 0
for y in range(self.size):
for z in range(self.size):
for x in range(self.size):
if alternating:
val |= (data[x, y, z] & 0xF)
buffer.write(struct.pack("B", val)) # FIXME this format is probably wrong
else:
val |= (data[x, y, z] & 0xF) << 4
alternating = not alternating
def read(self, buffer:io.BytesIO, ctx:Context):
section = np.empty((self.size, self.size, self.size), dtype='int32')
bit_buffer = BitStream(buffer.read((self.size**3)//2), (self.size**3)*4)
for y in range(self.size):
for z in range(self.size):
for x in range(self.size):
section[x, y, z] = bit_buffer.read(4)
return section
BlockLightSection = HalfByteArrayType(16)
SkyLightSection = HalfByteArrayType(16)
class NewChunkSectionType(Type):
pytype : type
def write(self, data, buffer:io.BytesIO, ctx:Context):
raise NotImplementedError
def read(self, buffer:io.BytesIO, ctx:Context):
block_count = Short.read(buffer, ctx=ctx)
block_states = BlockStateContainer.read(buffer, ctx=ctx)
biomes = BiomeContainer.read(buffer, ctx=ctx)
return (
block_count,
block_states,
biomes
)
class OldChunkSectionType(Type):
pytype : type
def write(self, data:Tuple[np.ndarray, np.ndarray, np.ndarray], buffer:io.BytesIO, ctx:Context):
BlockStateContainer.write(data[0], buffer, ctx=ctx)
BlockLightSection.write(data[1], buffer, ctx=ctx)
if ctx.overworld:
SkyLightSection.write(data[2], buffer, ctx=ctx)
def read(self, buffer:io.BytesIO, ctx:Context):
block_states = BlockStateContainer.read(buffer, ctx=ctx)
block_light = BlockLightSection.read(buffer, ctx=ctx)
if ctx.overworld:
sky_light = SkyLightSection.read(buffer, ctx=ctx)
else:
sky_light = np.empty((16, 16, 16), dtype='int32')
return (
block_states,
block_light,
sky_light
)
ChunkSection = OldChunkSectionType()
class Chunk(Type):
x : int
z : int
bitmask : int
ground_up_continuous : bool
blocks : np.ndarray
block_light : np.ndarray
sky_light : np.ndarray
biomes: bytes
def __init__(self, x:int, z:int, bitmask:int, ground_up_continuous:bool):
self.x = x
self.z = z
self.bitmask = bitmask
self.blocks = np.zeros((16, 256, 16), dtype='int32')
self.block_light = np.zeros((16, 256, 16), dtype='int32')
self.sky_light = np.zeros((16, 256, 16), dtype='int32')
self.ground_up_continuous = ground_up_continuous
def __getitem__(self, item:Any):
return self.blocks[item]
def merge(self, other:'Chunk'):
for i in range(16):
if not ((self.bitmask >> i) & 1):
self.blocks[:, i*16 : (i+1)*16, :] = other.blocks[:, i*16 : (i+1)*16, :]
self.block_light[:, i*16 : (i+1)*16, :] = other.block_light[:, i*16 : (i+1)*16, :]
self.sky_light[:, i*16 : (i+1)*16, :] = other.sky_light[:, i*16 : (i+1)*16, :]
def read(self, buffer:io.BytesIO, ctx:Context):
ctx.x = self.x
ctx.z = self.z
for i in range(16):
if (self.bitmask >> i) & 1:
ctx.sec = i
block_states, block_light, sky_light = ChunkSection.read(buffer, ctx=ctx)
self.blocks[:, i*16 : (i+1)*16, :] = block_states
self.block_light[:, i*16 : (i+1)*16, :] = block_light
self.sky_light[:, i*16 : (i+1)*16, :] = sky_light
if self.ground_up_continuous:
self.biomes = buffer.read(256) # 16x16
if buffer.read():
logging.warning("Leftover data in chunk buffer")
return self
def write(self, data:Any, buffer:io.BytesIO, ctx:Context):
for i in range(16):
if (self.bitmask >> i) & 1:
ChunkSection.write(
(self.blocks[:, i*16 : (i+1)*16, :], self.block_light[:, i*16 : (i+1)*16, :], self.sky_light[:, i*16 : (i+1)*16, :]),
buffer,
ctx=ctx
)
pass # TODO!!
class World:
chunks : Dict[Tuple[int, int], Chunk]
def __init__(self):
self.chunks = {}
def __getitem__(self, item:Tuple[int, int, int]):
return self.get(*item)
def get(self, x:int, y:int, z:int) -> int:
coord = (x//16, z//16)
if coord not in self.chunks:
raise KeyError(f"Chunk {coord} not loaded")
return self.chunks[coord][int(x%16), int(y), int(z%16)]
def put(self, chunk:Chunk, x:int, z:int, merge:bool=False):
if merge and (x,z) in self.chunks:
chunk.merge(self.chunks[(x,z)])
self.chunks[(x,z)] = chunk

View file

@ -17,32 +17,18 @@ class Dimension(Enum):
NETHER = -1 NETHER = -1
OVERWORLD = 0 OVERWORLD = 0
END = 1 END = 1
UNKNOWN = 666
@classmethod
def from_str(cls, txt:str) -> 'Dimension':
txt = txt.lower().replace('minecraft:', '')
if txt == 'overworld':
return Dimension.OVERWORLD
if txt == 'the_nether':
return Dimension.NETHER
if txt == 'the_end':
return Dimension.END
return Dimension.UNKNOWN
class Difficulty(Enum): class Difficulty(Enum):
PEACEFUL = 0 PEACEFUL = 0
EASY = 1 EASY = 1
NORMAL = 2 NORMAL = 2
HARD = 3 HARD = 3
UNKNOWN = -1
class Gamemode(Enum): class Gamemode(Enum):
SURVIVAL = 0 SURVIVAL = 0
CREATIVE = 1 CREATIVE = 1
ADVENTURE = 2 ADVENTURE = 2
SPECTATOR = 3 SPECTATOR = 3
UNKNOWN = -1
@dataclass @dataclass
class GameProfile: class GameProfile:
@ -106,16 +92,8 @@ class BlockPos:
and self.y == other.y \ and self.y == other.y \
and self.z == other.z and self.z == other.z
def close(self, other:'BlockPos', threshold:float = 0.1) -> bool:
return abs(self.x - other.x) < threshold \
and abs(self.y - other.y) < threshold \
and abs(self.z - other.z) < threshold
def clone(self) -> 'BlockPos':
return BlockPos(self.x, self.y, self.z)
def __repr__(self) -> str: def __repr__(self) -> str:
return f"{self.__class__.__name__}(x={self.x:.1f},y={self.y:.1f},z={self.z:.1f})" return f"{self.__class__.__name__}(x={self.x},y={self.y},z={self.z})"
def __str__(self) -> str: def __str__(self) -> str:
return repr(self) return repr(self)
@ -123,18 +101,6 @@ class BlockPos:
def __hash__(self) -> int: def __hash__(self) -> int:
return hash(self.to_tuple()) return hash(self.to_tuple())
@property
def i_x(self) -> int:
return int(self.x)
@property
def i_y(self) -> int:
return int(self.y)
@property
def i_z(self) -> int:
return int(self.z)
@classmethod @classmethod
def from_tuple(cls, t:Tuple[float, float, float]): def from_tuple(cls, t:Tuple[float, float, float]):
return cls(x=float(t[0]), y=float(t[1]), z=float(t[2])) return cls(x=float(t[0]), y=float(t[1]), z=float(t[2]))

View file

@ -1,69 +1,47 @@
import io import io
import json import json
from asyncio import Event from asyncio import Event
from typing import Tuple, List, Dict, Any from typing import Tuple, Dict, Any
from .primitives import Type, VarInt, Context from .types import Type, VarInt, Context
MAX_FIELD_PRINT_SIZE = 255 MAX_FIELD_PRINT_SIZE = 255
class Packet: class Packet:
__slots__ = 'id', 'definition', '_processed', '_proto', '_state' __slots__ = 'id', 'definition', '_processed', '_proto', '_state'
id : int | None id : int
definition : List[Tuple[str, Type]] | None definition : Tuple[Tuple[str, Type]]
_processed : Event _processed : Event
_proto : int | None _proto : int
_state : int _state : int
_ids : Dict[int, int] # definitions are compiled at install time _ids : Dict[int, int] # definitions are compiled at install time
_definitions : Dict[int, List[Tuple[str, Type]]] # definitions are compiled at install time _definitions : Dict[int, Tuple[Tuple[str, Type]]] # definitions are compiled at install time
def __init__(self, **kwargs): def __init__(self, proto:int, **kwargs):
if not self._definitions:
raise NotImplementedError("cannot instantiate Packet base class")
self.id = None
self.definition = None
self._proto = None
self._processed = Event()
for k, v in kwargs.items():
setattr(self, k, v)
def for_proto(self, proto: int) -> int:
self._proto = proto self._proto = proto
while proto not in self._definitions: self._processed = Event()
proto -= 1
self.definition = self._definitions[proto] self.definition = self._definitions[proto]
self.id = self._ids[proto] self.id = self._ids[proto]
return self.id for name, t in self.definition:
if name in kwargs and kwargs[name] is not None:
setattr(self, name, kwargs[name])
@property @property
def processed(self) -> Event: def processed(self) -> Event:
"""Returns an event which will be set only after the packet has been processed (either sent or raised exc)""" """Returns an event which will be set only after the packet has been processed (either sent or raised exc)"""
return self._processed return self._processed
@property
def slots(self) -> list[str]:
if self.definition is not None:
return [k for k, t in self.definition]
return [k for k in self.__slots__]
@classmethod @classmethod
def deserialize(cls, proto:int, buffer:io.BytesIO): def deserialize(cls, proto:int, buffer:io.BytesIO):
ctx = Context(_proto=proto) ctx = Context(_proto=proto)
fallback_proto = proto for k, t in cls._definitions[proto]:
while fallback_proto not in cls._definitions:
fallback_proto -= 1
for k, t in cls._definitions[fallback_proto]:
setattr(ctx, k, t.read(buffer, ctx=ctx)) setattr(ctx, k, t.read(buffer, ctx=ctx))
packet = cls(**ctx.serialize()) return cls(proto, **ctx.serialize())
packet.for_proto(fallback_proto) # return cls(proto, **{ name : t.read(buffer) for (name, t) in cls._definitions[proto] })
return packet
def serialize(self, proto:int) -> io.BytesIO: def serialize(self) -> io.BytesIO:
self.for_proto(proto) # this sets both id and definitions but mypy doesn't know...
assert self.id is not None
assert self.definition is not None
ctx = Context(_proto=self._proto) ctx = Context(_proto=self._proto)
buf = io.BytesIO() buf = io.BytesIO()
VarInt.write(self.id, buf, ctx=ctx) VarInt.write(self.id, buf, ctx=ctx)
@ -77,11 +55,9 @@ class Packet:
def __eq__(self, other) -> bool: def __eq__(self, other) -> bool:
if not isinstance(other, self.__class__): if not isinstance(other, self.__class__):
return False return False
if self._proto is not None \ if self._proto != other._proto:
and other._proto is not None \
and self._proto != other._proto:
return False return False
for name in self.slots: for name, t in self.definition:
if getattr(self, name) != getattr(other, name): if getattr(self, name) != getattr(other, name):
return False return False
return True return True
@ -92,13 +68,13 @@ class Packet:
obj["_proto"] = self._proto obj["_proto"] = self._proto
obj["_state"] = self._state obj["_state"] = self._state
obj["_id"] = f"0x{self.id:02x}" obj["_id"] = f"0x{self.id:02x}"
for key in self.slots: for key, t in self.definition:
obj[key] = getattr(self, key, None) obj[key] = getattr(self, key, None)
return json.dumps(obj, indent=2, default=str) return json.dumps(obj, indent=2, default=str)
def __repr__(self) -> str: def __repr__(self) -> str:
trunc = lambda x : x if len(x) < MAX_FIELD_PRINT_SIZE else "[blob]" trunc = lambda x : x if len(x) < MAX_FIELD_PRINT_SIZE else "[blob]"
attrs = (f"{key}={trunc(repr(getattr(self, key, None)))}" for key in self.slots) attrs = (f"{key}={trunc(repr(getattr(self, key, None)))}" for (key, t) in self.definition)
return f"{self.__class__.__name__}({self._proto}, {', '.join(attrs)})" return f"{self.__class__.__name__}({self._proto}, {', '.join(attrs)})"

View file

@ -40,9 +40,5 @@ REGISTRY = {
751 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }, 751 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
755 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }, 755 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
756 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }, 756 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
757 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }, 757 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }
758 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
759 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
760 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
761 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketLegacyServerListPing(Packet): class PacketLegacyServerListPing(Packet):
__slots__ = ( 'id', 'payload' ) __slots__ = ( 'id', 'payload' )
payload : int payload : int
def __init__(self, def __init__(self, proto:int,
payload:int | None = None, payload:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
payload=payload payload=payload
) )
@ -57,11 +57,7 @@ class PacketLegacyServerListPing(Packet):
751 : 254, 751 : 254,
755 : 254, 755 : 254,
756 : 254, 756 : 254,
757 : 254, 757 : 254
758 : 254,
759 : 254,
760 : 254,
761 : 254
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'payload', Byte ) ], 47 : [ ( 'payload', Byte ) ],
@ -100,9 +96,5 @@ class PacketLegacyServerListPing(Packet):
751 : [ ( 'payload', Byte ) ], 751 : [ ( 'payload', Byte ) ],
755 : [ ( 'payload', Byte ) ], 755 : [ ( 'payload', Byte ) ],
756 : [ ( 'payload', Byte ) ], 756 : [ ( 'payload', Byte ) ],
757 : [ ( 'payload', Byte ) ], 757 : [ ( 'payload', Byte ) ]
758 : [ ( 'payload', Byte ) ],
759 : [ ( 'payload', Byte ) ],
760 : [ ( 'payload', Byte ) ],
761 : [ ( 'payload', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketSetProtocol(Packet): class PacketSetProtocol(Packet):
__slots__ = ( 'id', 'nextState', 'protocolVersion', 'serverHost', 'serverPort' ) __slots__ = ( 'id', 'nextState', 'protocolVersion', 'serverHost', 'serverPort' )
@ -13,14 +13,14 @@ class PacketSetProtocol(Packet):
serverHost : str serverHost : str
serverPort : int serverPort : int
def __init__(self, def __init__(self, proto:int,
nextState:int | None = None, nextState:int=None,
protocolVersion:int | None = None, protocolVersion:int=None,
serverHost:str | None = None, serverHost:str=None,
serverPort:int | None = None, serverPort:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
nextState=nextState, nextState=nextState,
protocolVersion=protocolVersion, protocolVersion=protocolVersion,
serverHost=serverHost, serverHost=serverHost,
@ -66,11 +66,7 @@ class PacketSetProtocol(Packet):
751 : 0, 751 : 0,
755 : 0, 755 : 0,
756 : 0, 756 : 0,
757 : 0, 757 : 0
758 : 0,
759 : 0,
760 : 0,
761 : 0
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ], 47 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
@ -109,9 +105,5 @@ class PacketSetProtocol(Packet):
751 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ], 751 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
755 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ], 755 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
756 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ], 756 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
757 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ], 757 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ]
758 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
759 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
760 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
761 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ]
} }

View file

@ -43,9 +43,5 @@ REGISTRY = {
751 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }, 751 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
755 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }, 755 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
756 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }, 756 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
757 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }, 757 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }
758 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
759 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
760 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
761 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCompress(Packet): class PacketCompress(Packet):
__slots__ = ( 'id', 'threshold' ) __slots__ = ( 'id', 'threshold' )
threshold : int threshold : int
def __init__(self, def __init__(self, proto:int,
threshold:int | None = None, threshold:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
threshold=threshold threshold=threshold
) )
@ -57,11 +57,7 @@ class PacketCompress(Packet):
751 : 3, 751 : 3,
755 : 3, 755 : 3,
756 : 3, 756 : 3,
757 : 3, 757 : 3
758 : 3,
759 : 3,
760 : 3,
761 : 3
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'threshold', VarInt ) ], 47 : [ ( 'threshold', VarInt ) ],
@ -100,9 +96,5 @@ class PacketCompress(Packet):
751 : [ ( 'threshold', VarInt ) ], 751 : [ ( 'threshold', VarInt ) ],
755 : [ ( 'threshold', VarInt ) ], 755 : [ ( 'threshold', VarInt ) ],
756 : [ ( 'threshold', VarInt ) ], 756 : [ ( 'threshold', VarInt ) ],
757 : [ ( 'threshold', VarInt ) ], 757 : [ ( 'threshold', VarInt ) ]
758 : [ ( 'threshold', VarInt ) ],
759 : [ ( 'threshold', VarInt ) ],
760 : [ ( 'threshold', VarInt ) ],
761 : [ ( 'threshold', VarInt ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketDisconnect(Packet): class PacketDisconnect(Packet):
__slots__ = ( 'id', 'reason' ) __slots__ = ( 'id', 'reason' )
reason : str reason : str
def __init__(self, def __init__(self, proto:int,
reason:str | None = None, reason:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
reason=reason reason=reason
) )
@ -57,11 +57,7 @@ class PacketDisconnect(Packet):
751 : 0, 751 : 0,
755 : 0, 755 : 0,
756 : 0, 756 : 0,
757 : 0, 757 : 0
758 : 0,
759 : 0,
760 : 0,
761 : 0
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'reason', String ) ], 47 : [ ( 'reason', String ) ],
@ -100,9 +96,5 @@ class PacketDisconnect(Packet):
751 : [ ( 'reason', String ) ], 751 : [ ( 'reason', String ) ],
755 : [ ( 'reason', String ) ], 755 : [ ( 'reason', String ) ],
756 : [ ( 'reason', String ) ], 756 : [ ( 'reason', String ) ],
757 : [ ( 'reason', String ) ], 757 : [ ( 'reason', String ) ]
758 : [ ( 'reason', String ) ],
759 : [ ( 'reason', String ) ],
760 : [ ( 'reason', String ) ],
761 : [ ( 'reason', String ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEncryptionBegin(Packet): class PacketEncryptionBegin(Packet):
__slots__ = ( 'id', 'publicKey', 'serverId', 'verifyToken' ) __slots__ = ( 'id', 'publicKey', 'serverId', 'verifyToken' )
@ -12,13 +12,13 @@ class PacketEncryptionBegin(Packet):
serverId : str serverId : str
verifyToken : bytes verifyToken : bytes
def __init__(self, def __init__(self, proto:int,
publicKey:bytes | None = None, publicKey:bytes=None,
serverId:str | None = None, serverId:str=None,
verifyToken:bytes | None = None, verifyToken:bytes=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
publicKey=publicKey, publicKey=publicKey,
serverId=serverId, serverId=serverId,
verifyToken=verifyToken verifyToken=verifyToken
@ -63,11 +63,7 @@ class PacketEncryptionBegin(Packet):
751 : 1, 751 : 1,
755 : 1, 755 : 1,
756 : 1, 756 : 1,
757 : 1, 757 : 1
758 : 1,
759 : 1,
760 : 1,
761 : 1
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ], 47 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
@ -106,9 +102,5 @@ class PacketEncryptionBegin(Packet):
751 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ], 751 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
755 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ], 755 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
756 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ], 756 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
757 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ], 757 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ]
758 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
759 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
760 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
761 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketLoginPluginRequest(Packet): class PacketLoginPluginRequest(Packet):
__slots__ = ( 'id', 'channel', 'data', 'messageId' ) __slots__ = ( 'id', 'channel', 'data', 'messageId' )
@ -12,13 +12,13 @@ class PacketLoginPluginRequest(Packet):
data : bytes data : bytes
messageId : int messageId : int
def __init__(self, def __init__(self, proto:int,
channel:str | None = None, channel:str=None,
data:bytes | None = None, data:bytes=None,
messageId:int | None = None, messageId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
channel=channel, channel=channel,
data=data, data=data,
messageId=messageId messageId=messageId
@ -46,11 +46,7 @@ class PacketLoginPluginRequest(Packet):
751 : 4, 751 : 4,
755 : 4, 755 : 4,
756 : 4, 756 : 4,
757 : 4, 757 : 4
758 : 4,
759 : 4,
760 : 4,
761 : 4
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ], 393 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
@ -72,9 +68,5 @@ class PacketLoginPluginRequest(Packet):
751 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ], 751 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
755 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ], 755 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
756 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ], 756 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
757 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ], 757 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ]
758 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
759 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
760 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
761 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ]
} }

View file

@ -2,24 +2,21 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketSuccess(Packet): class PacketSuccess(Packet):
__slots__ = ( 'id', 'properties', 'username', 'uuid' ) __slots__ = ( 'id', 'username', 'uuid' )
properties : list
username : str username : str
uuid : str uuid : str
def __init__(self, def __init__(self, proto:int,
properties:list | None = None, username:str=None,
username:str | None = None, uuid:str=None,
uuid:str | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
properties=properties,
username=username, username=username,
uuid=uuid uuid=uuid
) )
@ -63,11 +60,7 @@ class PacketSuccess(Packet):
751 : 2, 751 : 2,
755 : 2, 755 : 2,
756 : 2, 756 : 2,
757 : 2, 757 : 2
758 : 2,
759 : 2,
760 : 2,
761 : 2
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'uuid', String ), ( 'username', String ) ], 47 : [ ( 'uuid', String ), ( 'username', String ) ],
@ -106,9 +99,5 @@ class PacketSuccess(Packet):
751 : [ ( 'uuid', UUID ), ( 'username', String ) ], 751 : [ ( 'uuid', UUID ), ( 'username', String ) ],
755 : [ ( 'uuid', UUID ), ( 'username', String ) ], 755 : [ ( 'uuid', UUID ), ( 'username', String ) ],
756 : [ ( 'uuid', UUID ), ( 'username', String ) ], 756 : [ ( 'uuid', UUID ), ( 'username', String ) ],
757 : [ ( 'uuid', UUID ), ( 'username', String ) ], 757 : [ ( 'uuid', UUID ), ( 'username', String ) ]
758 : [ ( 'uuid', UUID ), ( 'username', String ) ],
759 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ],
760 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ],
761 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ]
} }

View file

@ -41,9 +41,5 @@ REGISTRY = {
751 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }, 751 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
755 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }, 755 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
756 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }, 756 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
757 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }, 757 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }
758 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
759 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
760 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
761 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }
} }

View file

@ -2,27 +2,21 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEncryptionBegin(Packet): class PacketEncryptionBegin(Packet):
__slots__ = ( 'id', 'crypto', 'hasVerifyToken', 'sharedSecret', 'verifyToken' ) __slots__ = ( 'id', 'sharedSecret', 'verifyToken' )
crypto : Union[None, dict]
hasVerifyToken : bool
sharedSecret : bytes sharedSecret : bytes
verifyToken : bytes verifyToken : bytes
def __init__(self, def __init__(self, proto:int,
crypto:Union[None, dict] | None = None, sharedSecret:bytes=None,
hasVerifyToken:bool | None = None, verifyToken:bytes=None,
sharedSecret:bytes | None = None,
verifyToken:bytes | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
crypto=crypto,
hasVerifyToken=hasVerifyToken,
sharedSecret=sharedSecret, sharedSecret=sharedSecret,
verifyToken=verifyToken verifyToken=verifyToken
) )
@ -66,11 +60,7 @@ class PacketEncryptionBegin(Packet):
751 : 1, 751 : 1,
755 : 1, 755 : 1,
756 : 1, 756 : 1,
757 : 1, 757 : 1
758 : 1,
759 : 1,
760 : 1,
761 : 1
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ], 47 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
@ -109,9 +99,5 @@ class PacketEncryptionBegin(Packet):
751 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ], 751 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
755 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ], 755 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
756 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ], 756 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
757 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ], 757 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ]
758 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
759 : [ ( 'sharedSecret', ByteArray ), ( 'hasVerifyToken', Boolean ), ( 'crypto', SwitchType('hasVerifyToken', { 'false' : StructType(( 'salt', Long ), ( 'messageSignature', ByteArray ), ), 'true' : StructType(( 'verifyToken', ByteArray ), ) }, None, ) ) ],
760 : [ ( 'sharedSecret', ByteArray ), ( 'hasVerifyToken', Boolean ), ( 'crypto', SwitchType('hasVerifyToken', { 'false' : StructType(( 'salt', Long ), ( 'messageSignature', ByteArray ), ), 'true' : StructType(( 'verifyToken', ByteArray ), ) }, None, ) ) ],
761 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketLoginPluginResponse(Packet): class PacketLoginPluginResponse(Packet):
__slots__ = ( 'id', 'data', 'messageId' ) __slots__ = ( 'id', 'data', 'messageId' )
@ -11,12 +11,12 @@ class PacketLoginPluginResponse(Packet):
data : tuple data : tuple
messageId : int messageId : int
def __init__(self, def __init__(self, proto:int,
data:tuple | None = None, data:tuple=None,
messageId:int | None = None, messageId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
data=data, data=data,
messageId=messageId messageId=messageId
) )
@ -43,11 +43,7 @@ class PacketLoginPluginResponse(Packet):
751 : 2, 751 : 2,
755 : 2, 755 : 2,
756 : 2, 756 : 2,
757 : 2, 757 : 2
758 : 2,
759 : 2,
760 : 2,
761 : 2
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ], 393 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
@ -69,9 +65,5 @@ class PacketLoginPluginResponse(Packet):
751 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ], 751 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
755 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ], 755 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
756 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ], 756 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
757 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ], 757 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ]
758 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
759 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
760 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
761 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ]
} }

View file

@ -2,25 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketLoginStart(Packet): class PacketLoginStart(Packet):
__slots__ = ( 'id', 'playerUUID', 'signature', 'username' ) __slots__ = ( 'id', 'username' )
playerUUID : tuple
signature : tuple
username : str username : str
def __init__(self, def __init__(self, proto:int,
playerUUID:tuple | None = None, username:str=None,
signature:tuple | None = None,
username:str | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
playerUUID=playerUUID,
signature=signature,
username=username username=username
) )
@ -63,11 +57,7 @@ class PacketLoginStart(Packet):
751 : 0, 751 : 0,
755 : 0, 755 : 0,
756 : 0, 756 : 0,
757 : 0, 757 : 0
758 : 0,
759 : 0,
760 : 0,
761 : 0
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'username', String ) ], 47 : [ ( 'username', String ) ],
@ -106,9 +96,5 @@ class PacketLoginStart(Packet):
751 : [ ( 'username', String ) ], 751 : [ ( 'username', String ) ],
755 : [ ( 'username', String ) ], 755 : [ ( 'username', String ) ],
756 : [ ( 'username', String ) ], 756 : [ ( 'username', String ) ],
757 : [ ( 'username', String ) ], 757 : [ ( 'username', String ) ]
758 : [ ( 'username', String ) ],
759 : [ ( 'username', String ), ( 'signature', OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) ) ],
760 : [ ( 'username', String ), ( 'signature', OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) ), ( 'playerUUID', OptionalType(UUID, ) ) ],
761 : [ ( 'username', String ), ( 'playerUUID', OptionalType(UUID, ) ) ]
} }

View file

@ -118,18 +118,7 @@ from .packet_set_title_subtitle import PacketSetTitleSubtitle
from .packet_set_title_text import PacketSetTitleText from .packet_set_title_text import PacketSetTitleText
from .packet_set_title_time import PacketSetTitleTime from .packet_set_title_time import PacketSetTitleTime
from .packet_simulation_distance import PacketSimulationDistance from .packet_simulation_distance import PacketSimulationDistance
from .packet_chat_preview import PacketChatPreview
from .packet_player_chat import PacketPlayerChat
from .packet_should_display_chat_preview import PacketShouldDisplayChatPreview
from .packet_system_chat import PacketSystemChat
from .packet_server_data import PacketServerData
from .packet_chat_suggestions import PacketChatSuggestions
from .packet_hide_message import PacketHideMessage
from .packet_message_header import PacketMessageHeader
from .packet_advancement_progress import PacketAdvancementProgress from .packet_advancement_progress import PacketAdvancementProgress
from .packet_profileless_chat import PacketProfilelessChat
from .packet_player_remove import PacketPlayerRemove
from .packet_feature_flags import PacketFeatureFlags
REGISTRY = { REGISTRY = {
47 : { 0 : PacketKeepAlive, 1 : PacketLogin, 2 : PacketChat, 3 : PacketUpdateTime, 4 : PacketEntityEquipment, 5 : PacketSpawnPosition, 6 : PacketUpdateHealth, 7 : PacketRespawn, 8 : PacketPosition, 9 : PacketHeldItemSlot, 10 : PacketBed, 11 : PacketAnimation, 12 : PacketNamedEntitySpawn, 13 : PacketCollect, 14 : PacketSpawnEntity, 15 : PacketSpawnEntityLiving, 16 : PacketSpawnEntityPainting, 17 : PacketSpawnEntityExperienceOrb, 18 : PacketEntityVelocity, 19 : PacketEntityDestroy, 20 : PacketEntity, 21 : PacketRelEntityMove, 22 : PacketEntityLook, 23 : PacketEntityMoveLook, 24 : PacketEntityTeleport, 25 : PacketEntityHeadRotation, 26 : PacketEntityStatus, 27 : PacketAttachEntity, 28 : PacketEntityMetadata, 29 : PacketEntityEffect, 30 : PacketRemoveEntityEffect, 31 : PacketExperience, 32 : PacketUpdateAttributes, 33 : PacketMapChunk, 34 : PacketMultiBlockChange, 35 : PacketBlockChange, 36 : PacketBlockAction, 37 : PacketBlockBreakAnimation, 38 : PacketMapChunkBulk, 39 : PacketExplosion, 40 : PacketWorldEvent, 41 : PacketNamedSoundEffect, 42 : PacketWorldParticles, 43 : PacketGameStateChange, 44 : PacketSpawnEntityWeather, 45 : PacketOpenWindow, 46 : PacketCloseWindow, 47 : PacketSetSlot, 48 : PacketWindowItems, 49 : PacketCraftProgressBar, 50 : PacketTransaction, 51 : PacketUpdateSign, 52 : PacketMap, 53 : PacketTileEntityData, 54 : PacketOpenSignEntity, 55 : PacketStatistics, 56 : PacketPlayerInfo, 57 : PacketAbilities, 58 : PacketTabComplete, 59 : PacketScoreboardObjective, 60 : PacketScoreboardScore, 61 : PacketScoreboardDisplayObjective, 62 : PacketScoreboardTeam, 63 : PacketCustomPayload, 64 : PacketKickDisconnect, 65 : PacketDifficulty, 66 : PacketCombatEvent, 67 : PacketCamera, 68 : PacketWorldBorder, 69 : PacketTitle, 70 : PacketSetCompression, 71 : PacketPlayerlistHeader, 72 : PacketResourcePackSend, 73 : PacketUpdateEntityNbt }, 47 : { 0 : PacketKeepAlive, 1 : PacketLogin, 2 : PacketChat, 3 : PacketUpdateTime, 4 : PacketEntityEquipment, 5 : PacketSpawnPosition, 6 : PacketUpdateHealth, 7 : PacketRespawn, 8 : PacketPosition, 9 : PacketHeldItemSlot, 10 : PacketBed, 11 : PacketAnimation, 12 : PacketNamedEntitySpawn, 13 : PacketCollect, 14 : PacketSpawnEntity, 15 : PacketSpawnEntityLiving, 16 : PacketSpawnEntityPainting, 17 : PacketSpawnEntityExperienceOrb, 18 : PacketEntityVelocity, 19 : PacketEntityDestroy, 20 : PacketEntity, 21 : PacketRelEntityMove, 22 : PacketEntityLook, 23 : PacketEntityMoveLook, 24 : PacketEntityTeleport, 25 : PacketEntityHeadRotation, 26 : PacketEntityStatus, 27 : PacketAttachEntity, 28 : PacketEntityMetadata, 29 : PacketEntityEffect, 30 : PacketRemoveEntityEffect, 31 : PacketExperience, 32 : PacketUpdateAttributes, 33 : PacketMapChunk, 34 : PacketMultiBlockChange, 35 : PacketBlockChange, 36 : PacketBlockAction, 37 : PacketBlockBreakAnimation, 38 : PacketMapChunkBulk, 39 : PacketExplosion, 40 : PacketWorldEvent, 41 : PacketNamedSoundEffect, 42 : PacketWorldParticles, 43 : PacketGameStateChange, 44 : PacketSpawnEntityWeather, 45 : PacketOpenWindow, 46 : PacketCloseWindow, 47 : PacketSetSlot, 48 : PacketWindowItems, 49 : PacketCraftProgressBar, 50 : PacketTransaction, 51 : PacketUpdateSign, 52 : PacketMap, 53 : PacketTileEntityData, 54 : PacketOpenSignEntity, 55 : PacketStatistics, 56 : PacketPlayerInfo, 57 : PacketAbilities, 58 : PacketTabComplete, 59 : PacketScoreboardObjective, 60 : PacketScoreboardScore, 61 : PacketScoreboardDisplayObjective, 62 : PacketScoreboardTeam, 63 : PacketCustomPayload, 64 : PacketKickDisconnect, 65 : PacketDifficulty, 66 : PacketCombatEvent, 67 : PacketCamera, 68 : PacketWorldBorder, 69 : PacketTitle, 70 : PacketSetCompression, 71 : PacketPlayerlistHeader, 72 : PacketResourcePackSend, 73 : PacketUpdateEntityNbt },
@ -168,9 +157,5 @@ REGISTRY = {
751 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketAnimation, 6 : PacketStatistics, 7 : PacketAcknowledgePlayerDigging, 8 : PacketBlockBreakAnimation, 9 : PacketTileEntityData, 10 : PacketBlockAction, 11 : PacketBlockChange, 12 : PacketBossBar, 13 : PacketDifficulty, 14 : PacketChat, 15 : PacketTabComplete, 16 : PacketDeclareCommands, 17 : PacketTransaction, 18 : PacketCloseWindow, 19 : PacketWindowItems, 20 : PacketCraftProgressBar, 21 : PacketSetSlot, 22 : PacketSetCooldown, 23 : PacketCustomPayload, 24 : PacketNamedSoundEffect, 25 : PacketKickDisconnect, 26 : PacketEntityStatus, 27 : PacketExplosion, 28 : PacketUnloadChunk, 29 : PacketGameStateChange, 30 : PacketOpenHorseWindow, 31 : PacketKeepAlive, 32 : PacketMapChunk, 33 : PacketWorldEvent, 34 : PacketWorldParticles, 35 : PacketUpdateLight, 36 : PacketLogin, 37 : PacketMap, 38 : PacketTradeList, 39 : PacketRelEntityMove, 40 : PacketEntityMoveLook, 41 : PacketEntityLook, 42 : PacketEntity, 43 : PacketVehicleMove, 44 : PacketOpenBook, 45 : PacketOpenWindow, 46 : PacketOpenSignEntity, 47 : PacketCraftRecipeResponse, 48 : PacketAbilities, 49 : PacketCombatEvent, 50 : PacketPlayerInfo, 51 : PacketFacePlayer, 52 : PacketPosition, 53 : PacketUnlockRecipes, 54 : PacketEntityDestroy, 55 : PacketRemoveEntityEffect, 56 : PacketResourcePackSend, 57 : PacketRespawn, 58 : PacketEntityHeadRotation, 59 : PacketMultiBlockChange, 60 : PacketSelectAdvancementTab, 61 : PacketWorldBorder, 62 : PacketCamera, 63 : PacketHeldItemSlot, 64 : PacketUpdateViewPosition, 65 : PacketUpdateViewDistance, 66 : PacketSpawnPosition, 67 : PacketScoreboardDisplayObjective, 68 : PacketEntityMetadata, 69 : PacketAttachEntity, 70 : PacketEntityVelocity, 71 : PacketEntityEquipment, 72 : PacketExperience, 73 : PacketUpdateHealth, 74 : PacketScoreboardObjective, 75 : PacketSetPassengers, 76 : PacketTeams, 77 : PacketScoreboardScore, 78 : PacketUpdateTime, 79 : PacketTitle, 80 : PacketEntitySoundEffect, 81 : PacketSoundEffect, 82 : PacketStopSound, 83 : PacketPlayerlistHeader, 84 : PacketNbtQueryResponse, 85 : PacketCollect, 86 : PacketEntityTeleport, 87 : PacketAdvancements, 88 : PacketEntityUpdateAttributes, 89 : PacketEntityEffect, 90 : PacketDeclareRecipes, 91 : PacketTags }, 751 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketAnimation, 6 : PacketStatistics, 7 : PacketAcknowledgePlayerDigging, 8 : PacketBlockBreakAnimation, 9 : PacketTileEntityData, 10 : PacketBlockAction, 11 : PacketBlockChange, 12 : PacketBossBar, 13 : PacketDifficulty, 14 : PacketChat, 15 : PacketTabComplete, 16 : PacketDeclareCommands, 17 : PacketTransaction, 18 : PacketCloseWindow, 19 : PacketWindowItems, 20 : PacketCraftProgressBar, 21 : PacketSetSlot, 22 : PacketSetCooldown, 23 : PacketCustomPayload, 24 : PacketNamedSoundEffect, 25 : PacketKickDisconnect, 26 : PacketEntityStatus, 27 : PacketExplosion, 28 : PacketUnloadChunk, 29 : PacketGameStateChange, 30 : PacketOpenHorseWindow, 31 : PacketKeepAlive, 32 : PacketMapChunk, 33 : PacketWorldEvent, 34 : PacketWorldParticles, 35 : PacketUpdateLight, 36 : PacketLogin, 37 : PacketMap, 38 : PacketTradeList, 39 : PacketRelEntityMove, 40 : PacketEntityMoveLook, 41 : PacketEntityLook, 42 : PacketEntity, 43 : PacketVehicleMove, 44 : PacketOpenBook, 45 : PacketOpenWindow, 46 : PacketOpenSignEntity, 47 : PacketCraftRecipeResponse, 48 : PacketAbilities, 49 : PacketCombatEvent, 50 : PacketPlayerInfo, 51 : PacketFacePlayer, 52 : PacketPosition, 53 : PacketUnlockRecipes, 54 : PacketEntityDestroy, 55 : PacketRemoveEntityEffect, 56 : PacketResourcePackSend, 57 : PacketRespawn, 58 : PacketEntityHeadRotation, 59 : PacketMultiBlockChange, 60 : PacketSelectAdvancementTab, 61 : PacketWorldBorder, 62 : PacketCamera, 63 : PacketHeldItemSlot, 64 : PacketUpdateViewPosition, 65 : PacketUpdateViewDistance, 66 : PacketSpawnPosition, 67 : PacketScoreboardDisplayObjective, 68 : PacketEntityMetadata, 69 : PacketAttachEntity, 70 : PacketEntityVelocity, 71 : PacketEntityEquipment, 72 : PacketExperience, 73 : PacketUpdateHealth, 74 : PacketScoreboardObjective, 75 : PacketSetPassengers, 76 : PacketTeams, 77 : PacketScoreboardScore, 78 : PacketUpdateTime, 79 : PacketTitle, 80 : PacketEntitySoundEffect, 81 : PacketSoundEffect, 82 : PacketStopSound, 83 : PacketPlayerlistHeader, 84 : PacketNbtQueryResponse, 85 : PacketCollect, 86 : PacketEntityTeleport, 87 : PacketAdvancements, 88 : PacketEntityUpdateAttributes, 89 : PacketEntityEffect, 90 : PacketDeclareRecipes, 91 : PacketTags },
755 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketDestroyEntity, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags }, 755 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketDestroyEntity, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
756 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags }, 756 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
757 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags }, 757 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags }
758 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags },
759 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketChatPreview, 13 : PacketClearTitles, 14 : PacketTabComplete, 15 : PacketDeclareCommands, 16 : PacketCloseWindow, 17 : PacketWindowItems, 18 : PacketCraftProgressBar, 19 : PacketSetSlot, 20 : PacketSetCooldown, 21 : PacketCustomPayload, 22 : PacketNamedSoundEffect, 23 : PacketKickDisconnect, 24 : PacketEntityStatus, 25 : PacketExplosion, 26 : PacketUnloadChunk, 27 : PacketGameStateChange, 28 : PacketOpenHorseWindow, 29 : PacketInitializeWorldBorder, 30 : PacketKeepAlive, 31 : PacketMapChunk, 32 : PacketWorldEvent, 33 : PacketWorldParticles, 34 : PacketUpdateLight, 35 : PacketLogin, 36 : PacketMap, 37 : PacketTradeList, 38 : PacketRelEntityMove, 39 : PacketEntityMoveLook, 40 : PacketEntityLook, 41 : PacketVehicleMove, 42 : PacketOpenBook, 43 : PacketOpenWindow, 44 : PacketOpenSignEntity, 45 : PacketPing, 46 : PacketCraftRecipeResponse, 47 : PacketAbilities, 48 : PacketPlayerChat, 49 : PacketEndCombatEvent, 50 : PacketEnterCombatEvent, 51 : PacketDeathCombatEvent, 52 : PacketPlayerInfo, 53 : PacketFacePlayer, 54 : PacketPosition, 55 : PacketUnlockRecipes, 56 : PacketEntityDestroy, 57 : PacketRemoveEntityEffect, 58 : PacketResourcePackSend, 59 : PacketRespawn, 60 : PacketEntityHeadRotation, 61 : PacketMultiBlockChange, 62 : PacketSelectAdvancementTab, 63 : PacketServerData, 64 : PacketActionBar, 65 : PacketWorldBorderCenter, 66 : PacketWorldBorderLerpSize, 67 : PacketWorldBorderSize, 68 : PacketWorldBorderWarningDelay, 69 : PacketWorldBorderWarningReach, 70 : PacketCamera, 71 : PacketHeldItemSlot, 72 : PacketUpdateViewPosition, 73 : PacketUpdateViewDistance, 74 : PacketSpawnPosition, 75 : PacketShouldDisplayChatPreview, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketSystemChat, 96 : PacketPlayerlistHeader, 97 : PacketNbtQueryResponse, 98 : PacketCollect, 99 : PacketEntityTeleport, 100 : PacketAdvancements, 101 : PacketEntityUpdateAttributes, 102 : PacketEntityEffect, 103 : PacketDeclareRecipes, 104 : PacketTags },
760 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketChatPreview, 13 : PacketClearTitles, 14 : PacketTabComplete, 15 : PacketDeclareCommands, 16 : PacketCloseWindow, 17 : PacketWindowItems, 18 : PacketCraftProgressBar, 19 : PacketSetSlot, 20 : PacketSetCooldown, 21 : PacketChatSuggestions, 22 : PacketCustomPayload, 23 : PacketNamedSoundEffect, 24 : PacketHideMessage, 25 : PacketKickDisconnect, 26 : PacketEntityStatus, 27 : PacketExplosion, 28 : PacketUnloadChunk, 29 : PacketGameStateChange, 30 : PacketOpenHorseWindow, 31 : PacketInitializeWorldBorder, 32 : PacketKeepAlive, 33 : PacketMapChunk, 34 : PacketWorldEvent, 35 : PacketWorldParticles, 36 : PacketUpdateLight, 37 : PacketLogin, 38 : PacketMap, 39 : PacketTradeList, 40 : PacketRelEntityMove, 41 : PacketEntityMoveLook, 42 : PacketEntityLook, 43 : PacketVehicleMove, 44 : PacketOpenBook, 45 : PacketOpenWindow, 46 : PacketOpenSignEntity, 47 : PacketPing, 48 : PacketCraftRecipeResponse, 49 : PacketAbilities, 50 : PacketMessageHeader, 51 : PacketPlayerChat, 52 : PacketEndCombatEvent, 53 : PacketEnterCombatEvent, 54 : PacketDeathCombatEvent, 55 : PacketPlayerInfo, 56 : PacketFacePlayer, 57 : PacketPosition, 58 : PacketUnlockRecipes, 59 : PacketEntityDestroy, 60 : PacketRemoveEntityEffect, 61 : PacketResourcePackSend, 62 : PacketRespawn, 63 : PacketEntityHeadRotation, 64 : PacketMultiBlockChange, 65 : PacketSelectAdvancementTab, 66 : PacketServerData, 67 : PacketActionBar, 68 : PacketWorldBorderCenter, 69 : PacketWorldBorderLerpSize, 70 : PacketWorldBorderSize, 71 : PacketWorldBorderWarningDelay, 72 : PacketWorldBorderWarningReach, 73 : PacketCamera, 74 : PacketHeldItemSlot, 75 : PacketUpdateViewPosition, 76 : PacketUpdateViewDistance, 77 : PacketSpawnPosition, 78 : PacketShouldDisplayChatPreview, 79 : PacketScoreboardDisplayObjective, 80 : PacketEntityMetadata, 81 : PacketAttachEntity, 82 : PacketEntityVelocity, 83 : PacketEntityEquipment, 84 : PacketExperience, 85 : PacketUpdateHealth, 86 : PacketScoreboardObjective, 87 : PacketSetPassengers, 88 : PacketTeams, 89 : PacketScoreboardScore, 90 : PacketSimulationDistance, 91 : PacketSetTitleSubtitle, 92 : PacketUpdateTime, 93 : PacketSetTitleText, 94 : PacketSetTitleTime, 95 : PacketEntitySoundEffect, 96 : PacketSoundEffect, 97 : PacketStopSound, 98 : PacketSystemChat, 99 : PacketPlayerlistHeader, 100 : PacketNbtQueryResponse, 101 : PacketCollect, 102 : PacketEntityTeleport, 103 : PacketAdvancements, 104 : PacketEntityUpdateAttributes, 105 : PacketEntityEffect, 106 : PacketDeclareRecipes, 107 : PacketTags },
761 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketClearTitles, 13 : PacketTabComplete, 14 : PacketDeclareCommands, 15 : PacketCloseWindow, 16 : PacketWindowItems, 17 : PacketCraftProgressBar, 18 : PacketSetSlot, 19 : PacketSetCooldown, 20 : PacketChatSuggestions, 21 : PacketCustomPayload, 22 : PacketHideMessage, 23 : PacketKickDisconnect, 24 : PacketProfilelessChat, 25 : PacketEntityStatus, 26 : PacketExplosion, 27 : PacketUnloadChunk, 28 : PacketGameStateChange, 29 : PacketOpenHorseWindow, 30 : PacketInitializeWorldBorder, 31 : PacketKeepAlive, 32 : PacketMapChunk, 33 : PacketWorldEvent, 34 : PacketWorldParticles, 35 : PacketUpdateLight, 36 : PacketLogin, 37 : PacketMap, 38 : PacketTradeList, 39 : PacketRelEntityMove, 40 : PacketEntityMoveLook, 41 : PacketEntityLook, 42 : PacketVehicleMove, 43 : PacketOpenBook, 44 : PacketOpenWindow, 45 : PacketOpenSignEntity, 46 : PacketPing, 47 : PacketCraftRecipeResponse, 48 : PacketAbilities, 49 : PacketPlayerChat, 50 : PacketEndCombatEvent, 51 : PacketEnterCombatEvent, 52 : PacketDeathCombatEvent, 53 : PacketPlayerRemove, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketServerData, 66 : PacketActionBar, 67 : PacketWorldBorderCenter, 68 : PacketWorldBorderLerpSize, 69 : PacketWorldBorderSize, 70 : PacketWorldBorderWarningDelay, 71 : PacketWorldBorderWarningReach, 72 : PacketCamera, 73 : PacketHeldItemSlot, 74 : PacketUpdateViewPosition, 75 : PacketUpdateViewDistance, 76 : PacketSpawnPosition, 77 : PacketScoreboardDisplayObjective, 78 : PacketEntityMetadata, 79 : PacketAttachEntity, 80 : PacketEntityVelocity, 81 : PacketEntityEquipment, 82 : PacketExperience, 83 : PacketUpdateHealth, 84 : PacketScoreboardObjective, 85 : PacketSetPassengers, 86 : PacketTeams, 87 : PacketScoreboardScore, 88 : PacketSimulationDistance, 89 : PacketSetTitleSubtitle, 90 : PacketUpdateTime, 91 : PacketSetTitleText, 92 : PacketSetTitleTime, 93 : PacketEntitySoundEffect, 94 : PacketSoundEffect, 95 : PacketStopSound, 96 : PacketSystemChat, 97 : PacketPlayerlistHeader, 98 : PacketNbtQueryResponse, 99 : PacketCollect, 100 : PacketEntityTeleport, 101 : PacketAdvancements, 102 : PacketEntityUpdateAttributes, 103 : PacketFeatureFlags, 104 : PacketEntityEffect, 105 : PacketDeclareRecipes, 106 : PacketTags }
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAbilities(Packet): class PacketAbilities(Packet):
__slots__ = ( 'id', 'flags', 'flyingSpeed', 'walkingSpeed' ) __slots__ = ( 'id', 'flags', 'flyingSpeed', 'walkingSpeed' )
@ -12,13 +12,13 @@ class PacketAbilities(Packet):
flyingSpeed : float flyingSpeed : float
walkingSpeed : float walkingSpeed : float
def __init__(self, def __init__(self, proto:int,
flags:int | None = None, flags:int=None,
flyingSpeed:float | None = None, flyingSpeed:float=None,
walkingSpeed:float | None = None, walkingSpeed:float=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
flags=flags, flags=flags,
flyingSpeed=flyingSpeed, flyingSpeed=flyingSpeed,
walkingSpeed=walkingSpeed walkingSpeed=walkingSpeed
@ -63,11 +63,7 @@ class PacketAbilities(Packet):
751 : 48, 751 : 48,
755 : 50, 755 : 50,
756 : 50, 756 : 50,
757 : 50, 757 : 50
758 : 50,
759 : 47,
760 : 49,
761 : 48
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ], 47 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
@ -106,9 +102,5 @@ class PacketAbilities(Packet):
751 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ], 751 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
755 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ], 755 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
756 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ], 756 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
757 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ], 757 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ]
758 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
759 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
760 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
761 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ]
} }

View file

@ -2,30 +2,27 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAcknowledgePlayerDigging(Packet): class PacketAcknowledgePlayerDigging(Packet):
__slots__ = ( 'id', 'block', 'location', 'sequenceId', 'status', 'successful' ) __slots__ = ( 'id', 'block', 'location', 'status', 'successful' )
block : int block : int
location : tuple location : tuple
sequenceId : int
status : int status : int
successful : bool successful : bool
def __init__(self, def __init__(self, proto:int,
block:int | None = None, block:int=None,
location:tuple | None = None, location:tuple=None,
sequenceId:int | None = None, status:int=None,
status:int | None = None, successful:bool=None,
successful:bool | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
block=block, block=block,
location=location, location=location,
sequenceId=sequenceId,
status=status, status=status,
successful=successful successful=successful
) )
@ -44,11 +41,7 @@ class PacketAcknowledgePlayerDigging(Packet):
751 : 7, 751 : 7,
755 : 8, 755 : 8,
756 : 8, 756 : 8,
757 : 8, 757 : 8
758 : 8,
759 : 5,
760 : 5,
761 : 5
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
498 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ], 498 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
@ -62,9 +55,5 @@ class PacketAcknowledgePlayerDigging(Packet):
751 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ], 751 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
755 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ], 755 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
756 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ], 756 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
757 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ], 757 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ]
758 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
759 : [ ( 'sequenceId', VarInt ) ],
760 : [ ( 'sequenceId', VarInt ) ],
761 : [ ( 'sequenceId', VarInt ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketActionBar(Packet): class PacketActionBar(Packet):
__slots__ = ( 'id', 'text' ) __slots__ = ( 'id', 'text' )
text : str text : str
def __init__(self, def __init__(self, proto:int,
text:str | None = None, text:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
text=text text=text
) )
@ -23,18 +23,10 @@ class PacketActionBar(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 65, 755 : 65,
756 : 65, 756 : 65,
757 : 65, 757 : 65
758 : 65,
759 : 64,
760 : 67,
761 : 66
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'text', String ) ], 755 : [ ( 'text', String ) ],
756 : [ ( 'text', String ) ], 756 : [ ( 'text', String ) ],
757 : [ ( 'text', String ) ], 757 : [ ( 'text', String ) ]
758 : [ ( 'text', String ) ],
759 : [ ( 'text', String ) ],
760 : [ ( 'text', String ) ],
761 : [ ( 'text', String ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAdvancementProgress(Packet): class PacketAdvancementProgress(Packet):
__slots__ = ( 'id', 'id' ) __slots__ = ( 'id', 'id' )
id : tuple id : tuple
def __init__(self, def __init__(self, proto:int,
id:tuple | None = None, id:tuple=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
id=id id=id
) )

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAdvancements(Packet): class PacketAdvancements(Packet):
__slots__ = ( 'id', 'advancementMapping', 'identifiers', 'progressMapping', 'reset' ) __slots__ = ( 'id', 'advancementMapping', 'identifiers', 'progressMapping', 'reset' )
@ -13,14 +13,14 @@ class PacketAdvancements(Packet):
progressMapping : list progressMapping : list
reset : bool reset : bool
def __init__(self, def __init__(self, proto:int,
advancementMapping:list | None = None, advancementMapping:list=None,
identifiers:list | None = None, identifiers:list=None,
progressMapping:list | None = None, progressMapping:list=None,
reset:bool | None = None, reset:bool=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
advancementMapping=advancementMapping, advancementMapping=advancementMapping,
identifiers=identifiers, identifiers=identifiers,
progressMapping=progressMapping, progressMapping=progressMapping,
@ -56,11 +56,7 @@ class PacketAdvancements(Packet):
751 : 87, 751 : 87,
755 : 98, 755 : 98,
756 : 98, 756 : 98,
757 : 99, 757 : 99
758 : 99,
759 : 100,
760 : 103,
761 : 101
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
321 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', VarInt ), ( 'frameType', VarInt ), ( 'backgroundTexture', OptionalType(String, ) ), ( 'xCord', VarInt ), ( 'yCord', VarInt ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ], 321 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', VarInt ), ( 'frameType', VarInt ), ( 'backgroundTexture', OptionalType(String, ) ), ( 'xCord', VarInt ), ( 'yCord', VarInt ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
@ -89,9 +85,5 @@ class PacketAdvancements(Packet):
751 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ], 751 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
755 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ], 755 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
756 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ], 756 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
757 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ], 757 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ]
758 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
759 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
760 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
761 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAnimation(Packet): class PacketAnimation(Packet):
__slots__ = ( 'id', 'animation', 'entityId' ) __slots__ = ( 'id', 'animation', 'entityId' )
@ -11,12 +11,12 @@ class PacketAnimation(Packet):
animation : int animation : int
entityId : int entityId : int
def __init__(self, def __init__(self, proto:int,
animation:int | None = None, animation:int=None,
entityId:int | None = None, entityId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
animation=animation, animation=animation,
entityId=entityId entityId=entityId
) )
@ -60,11 +60,7 @@ class PacketAnimation(Packet):
751 : 5, 751 : 5,
755 : 6, 755 : 6,
756 : 6, 756 : 6,
757 : 6, 757 : 6
758 : 6,
759 : 3,
760 : 3,
761 : 3
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ], 47 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
@ -103,9 +99,5 @@ class PacketAnimation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
759 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
760 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
761 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketAttachEntity(Packet): class PacketAttachEntity(Packet):
__slots__ = ( 'id', 'entityId', 'leash', 'vehicleId' ) __slots__ = ( 'id', 'entityId', 'leash', 'vehicleId' )
@ -12,13 +12,13 @@ class PacketAttachEntity(Packet):
leash : bool leash : bool
vehicleId : int vehicleId : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
leash:bool | None = None, leash:bool=None,
vehicleId:int | None = None, vehicleId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
leash=leash, leash=leash,
vehicleId=vehicleId vehicleId=vehicleId
@ -63,11 +63,7 @@ class PacketAttachEntity(Packet):
751 : 69, 751 : 69,
755 : 78, 755 : 78,
756 : 78, 756 : 78,
757 : 78, 757 : 78
758 : 78,
759 : 78,
760 : 81,
761 : 79
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'vehicleId', Int ), ( 'leash', Boolean ) ], 47 : [ ( 'entityId', Int ), ( 'vehicleId', Int ), ( 'leash', Boolean ) ],
@ -106,9 +102,5 @@ class PacketAttachEntity(Packet):
751 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ], 751 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
755 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ], 755 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
756 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ], 756 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
757 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ], 757 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ]
758 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
759 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
760 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
761 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketBed(Packet): class PacketBed(Packet):
__slots__ = ( 'id', 'entityId', 'location' ) __slots__ = ( 'id', 'entityId', 'location' )
@ -11,12 +11,12 @@ class PacketBed(Packet):
entityId : int entityId : int
location : tuple location : tuple
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
location:tuple | None = None, location:tuple=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
location=location location=location
) )

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketBlockAction(Packet): class PacketBlockAction(Packet):
__slots__ = ( 'id', 'blockId', 'byte1', 'byte2', 'location' ) __slots__ = ( 'id', 'blockId', 'byte1', 'byte2', 'location' )
@ -13,14 +13,14 @@ class PacketBlockAction(Packet):
byte2 : int byte2 : int
location : tuple location : tuple
def __init__(self, def __init__(self, proto:int,
blockId:int | None = None, blockId:int=None,
byte1:int | None = None, byte1:int=None,
byte2:int | None = None, byte2:int=None,
location:tuple | None = None, location:tuple=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
blockId=blockId, blockId=blockId,
byte1=byte1, byte1=byte1,
byte2=byte2, byte2=byte2,
@ -66,11 +66,7 @@ class PacketBlockAction(Packet):
751 : 10, 751 : 10,
755 : 11, 755 : 11,
756 : 11, 756 : 11,
757 : 11, 757 : 11
758 : 11,
759 : 8,
760 : 8,
761 : 8
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ], 47 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
@ -109,9 +105,5 @@ class PacketBlockAction(Packet):
751 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ], 751 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
755 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ], 755 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
756 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ], 756 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
757 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ], 757 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ]
758 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
759 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
760 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
761 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketBlockBreakAnimation(Packet): class PacketBlockBreakAnimation(Packet):
__slots__ = ( 'id', 'destroyStage', 'entityId', 'location' ) __slots__ = ( 'id', 'destroyStage', 'entityId', 'location' )
@ -12,13 +12,13 @@ class PacketBlockBreakAnimation(Packet):
entityId : int entityId : int
location : tuple location : tuple
def __init__(self, def __init__(self, proto:int,
destroyStage:int | None = None, destroyStage:int=None,
entityId:int | None = None, entityId:int=None,
location:tuple | None = None, location:tuple=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
destroyStage=destroyStage, destroyStage=destroyStage,
entityId=entityId, entityId=entityId,
location=location location=location
@ -63,11 +63,7 @@ class PacketBlockBreakAnimation(Packet):
751 : 8, 751 : 8,
755 : 9, 755 : 9,
756 : 9, 756 : 9,
757 : 9, 757 : 9
758 : 9,
759 : 6,
760 : 6,
761 : 6
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ], 47 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
@ -106,9 +102,5 @@ class PacketBlockBreakAnimation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
759 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
760 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
761 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketBlockChange(Packet): class PacketBlockChange(Packet):
__slots__ = ( 'id', 'location', 'type' ) __slots__ = ( 'id', 'location', 'type' )
@ -11,12 +11,12 @@ class PacketBlockChange(Packet):
location : tuple location : tuple
type : int type : int
def __init__(self, def __init__(self, proto:int,
location:tuple | None = None, location:tuple=None,
type:int | None = None, type:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
location=location, location=location,
type=type type=type
) )
@ -60,11 +60,7 @@ class PacketBlockChange(Packet):
751 : 11, 751 : 11,
755 : 12, 755 : 12,
756 : 12, 756 : 12,
757 : 12, 757 : 12
758 : 12,
759 : 9,
760 : 9,
761 : 9
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'location', Position ), ( 'type', VarInt ) ], 47 : [ ( 'location', Position ), ( 'type', VarInt ) ],
@ -103,9 +99,5 @@ class PacketBlockChange(Packet):
751 : [ ( 'location', Position ), ( 'type', VarInt ) ], 751 : [ ( 'location', Position ), ( 'type', VarInt ) ],
755 : [ ( 'location', Position ), ( 'type', VarInt ) ], 755 : [ ( 'location', Position ), ( 'type', VarInt ) ],
756 : [ ( 'location', Position ), ( 'type', VarInt ) ], 756 : [ ( 'location', Position ), ( 'type', VarInt ) ],
757 : [ ( 'location', Position ), ( 'type', VarInt ) ], 757 : [ ( 'location', Position ), ( 'type', VarInt ) ]
758 : [ ( 'location', Position ), ( 'type', VarInt ) ],
759 : [ ( 'location', Position ), ( 'type', VarInt ) ],
760 : [ ( 'location', Position ), ( 'type', VarInt ) ],
761 : [ ( 'location', Position ), ( 'type', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketBossBar(Packet): class PacketBossBar(Packet):
__slots__ = ( 'id', 'action', 'color', 'dividers', 'entityUUID', 'flags', 'health', 'title' ) __slots__ = ( 'id', 'action', 'color', 'dividers', 'entityUUID', 'flags', 'health', 'title' )
@ -16,17 +16,17 @@ class PacketBossBar(Packet):
health : Union[None, float] health : Union[None, float]
title : Union[None, str] title : Union[None, str]
def __init__(self, def __init__(self, proto:int,
action:int | None = None, action:int=None,
color:Union[None, int] | None = None, color:Union[None, int]=None,
dividers:Union[None, int] | None = None, dividers:Union[None, int]=None,
entityUUID:str | None = None, entityUUID:str=None,
flags:Union[None, int] | None = None, flags:Union[None, int]=None,
health:Union[None, float] | None = None, health:Union[None, float]=None,
title:Union[None, str] | None = None, title:Union[None, str]=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
action=action, action=action,
color=color, color=color,
dividers=dividers, dividers=dividers,
@ -74,11 +74,7 @@ class PacketBossBar(Packet):
751 : 12, 751 : 12,
755 : 13, 755 : 13,
756 : 13, 756 : 13,
757 : 13, 757 : 13
758 : 13,
759 : 10,
760 : 10,
761 : 10
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
76 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ], 76 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
@ -116,9 +112,5 @@ class PacketBossBar(Packet):
751 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ], 751 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
755 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ], 755 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
756 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ], 756 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
757 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ], 757 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ]
758 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
759 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
760 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
761 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCamera(Packet): class PacketCamera(Packet):
__slots__ = ( 'id', 'cameraId' ) __slots__ = ( 'id', 'cameraId' )
cameraId : int cameraId : int
def __init__(self, def __init__(self, proto:int,
cameraId:int | None = None, cameraId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
cameraId=cameraId cameraId=cameraId
) )
@ -57,11 +57,7 @@ class PacketCamera(Packet):
751 : 62, 751 : 62,
755 : 71, 755 : 71,
756 : 71, 756 : 71,
757 : 71, 757 : 71
758 : 71,
759 : 70,
760 : 73,
761 : 72
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'cameraId', VarInt ) ], 47 : [ ( 'cameraId', VarInt ) ],
@ -100,9 +96,5 @@ class PacketCamera(Packet):
751 : [ ( 'cameraId', VarInt ) ], 751 : [ ( 'cameraId', VarInt ) ],
755 : [ ( 'cameraId', VarInt ) ], 755 : [ ( 'cameraId', VarInt ) ],
756 : [ ( 'cameraId', VarInt ) ], 756 : [ ( 'cameraId', VarInt ) ],
757 : [ ( 'cameraId', VarInt ) ], 757 : [ ( 'cameraId', VarInt ) ]
758 : [ ( 'cameraId', VarInt ) ],
759 : [ ( 'cameraId', VarInt ) ],
760 : [ ( 'cameraId', VarInt ) ],
761 : [ ( 'cameraId', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketChat(Packet): class PacketChat(Packet):
__slots__ = ( 'id', 'message', 'position', 'sender' ) __slots__ = ( 'id', 'message', 'position', 'sender' )
@ -12,13 +12,13 @@ class PacketChat(Packet):
position : int position : int
sender : str sender : str
def __init__(self, def __init__(self, proto:int,
message:str | None = None, message:str=None,
position:int | None = None, position:int=None,
sender:str | None = None, sender:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
message=message, message=message,
position=position, position=position,
sender=sender sender=sender
@ -63,8 +63,7 @@ class PacketChat(Packet):
751 : 14, 751 : 14,
755 : 15, 755 : 15,
756 : 15, 756 : 15,
757 : 15, 757 : 15
758 : 15
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'message', String ), ( 'position', Byte ) ], 47 : [ ( 'message', String ), ( 'position', Byte ) ],
@ -103,6 +102,5 @@ class PacketChat(Packet):
751 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ], 751 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
755 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ], 755 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
756 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ], 756 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
757 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ], 757 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ]
758 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketClearTitles(Packet): class PacketClearTitles(Packet):
__slots__ = ( 'id', 'reset' ) __slots__ = ( 'id', 'reset' )
reset : bool reset : bool
def __init__(self, def __init__(self, proto:int,
reset:bool | None = None, reset:bool=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
reset=reset reset=reset
) )
@ -23,18 +23,10 @@ class PacketClearTitles(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 16, 755 : 16,
756 : 16, 756 : 16,
757 : 16, 757 : 16
758 : 16,
759 : 13,
760 : 13,
761 : 12
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'reset', Boolean ) ], 755 : [ ( 'reset', Boolean ) ],
756 : [ ( 'reset', Boolean ) ], 756 : [ ( 'reset', Boolean ) ],
757 : [ ( 'reset', Boolean ) ], 757 : [ ( 'reset', Boolean ) ]
758 : [ ( 'reset', Boolean ) ],
759 : [ ( 'reset', Boolean ) ],
760 : [ ( 'reset', Boolean ) ],
761 : [ ( 'reset', Boolean ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCloseWindow(Packet): class PacketCloseWindow(Packet):
__slots__ = ( 'id', 'windowId' ) __slots__ = ( 'id', 'windowId' )
windowId : int windowId : int
def __init__(self, def __init__(self, proto:int,
windowId:int | None = None, windowId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
windowId=windowId windowId=windowId
) )
@ -57,11 +57,7 @@ class PacketCloseWindow(Packet):
751 : 18, 751 : 18,
755 : 19, 755 : 19,
756 : 19, 756 : 19,
757 : 19, 757 : 19
758 : 19,
759 : 16,
760 : 16,
761 : 15
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'windowId', Byte ) ], 47 : [ ( 'windowId', Byte ) ],
@ -100,9 +96,5 @@ class PacketCloseWindow(Packet):
751 : [ ( 'windowId', Byte ) ], 751 : [ ( 'windowId', Byte ) ],
755 : [ ( 'windowId', Byte ) ], 755 : [ ( 'windowId', Byte ) ],
756 : [ ( 'windowId', Byte ) ], 756 : [ ( 'windowId', Byte ) ],
757 : [ ( 'windowId', Byte ) ], 757 : [ ( 'windowId', Byte ) ]
758 : [ ( 'windowId', Byte ) ],
759 : [ ( 'windowId', Byte ) ],
760 : [ ( 'windowId', Byte ) ],
761 : [ ( 'windowId', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCollect(Packet): class PacketCollect(Packet):
__slots__ = ( 'id', 'collectedEntityId', 'collectorEntityId', 'pickupItemCount' ) __slots__ = ( 'id', 'collectedEntityId', 'collectorEntityId', 'pickupItemCount' )
@ -12,13 +12,13 @@ class PacketCollect(Packet):
collectorEntityId : int collectorEntityId : int
pickupItemCount : int pickupItemCount : int
def __init__(self, def __init__(self, proto:int,
collectedEntityId:int | None = None, collectedEntityId:int=None,
collectorEntityId:int | None = None, collectorEntityId:int=None,
pickupItemCount:int | None = None, pickupItemCount:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
collectedEntityId=collectedEntityId, collectedEntityId=collectedEntityId,
collectorEntityId=collectorEntityId, collectorEntityId=collectorEntityId,
pickupItemCount=pickupItemCount pickupItemCount=pickupItemCount
@ -63,11 +63,7 @@ class PacketCollect(Packet):
751 : 85, 751 : 85,
755 : 96, 755 : 96,
756 : 96, 756 : 96,
757 : 97, 757 : 97
758 : 97,
759 : 98,
760 : 101,
761 : 99
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ) ], 47 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ) ],
@ -106,9 +102,5 @@ class PacketCollect(Packet):
751 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ], 751 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
755 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ], 755 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
756 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ], 756 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
757 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ], 757 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ]
758 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
759 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
760 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
761 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCombatEvent(Packet): class PacketCombatEvent(Packet):
__slots__ = ( 'id', 'duration', 'entityId', 'event', 'message', 'playerId' ) __slots__ = ( 'id', 'duration', 'entityId', 'event', 'message', 'playerId' )
@ -14,15 +14,15 @@ class PacketCombatEvent(Packet):
message : Union[None, str] message : Union[None, str]
playerId : Union[None, int] playerId : Union[None, int]
def __init__(self, def __init__(self, proto:int,
duration:Union[None, int] | None = None, duration:Union[None, int]=None,
entityId:Union[None, int] | None = None, entityId:Union[None, int]=None,
event:int | None = None, event:int=None,
message:Union[None, str] | None = None, message:Union[None, str]=None,
playerId:Union[None, int] | None = None, playerId:Union[None, int]=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
duration=duration, duration=duration,
entityId=entityId, entityId=entityId,
event=event, event=event,

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCraftProgressBar(Packet): class PacketCraftProgressBar(Packet):
__slots__ = ( 'id', 'property', 'value', 'windowId' ) __slots__ = ( 'id', 'property', 'value', 'windowId' )
@ -12,13 +12,13 @@ class PacketCraftProgressBar(Packet):
value : int value : int
windowId : int windowId : int
def __init__(self, def __init__(self, proto:int,
property:int | None = None, property:int=None,
value:int | None = None, value:int=None,
windowId:int | None = None, windowId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
property=property, property=property,
value=value, value=value,
windowId=windowId windowId=windowId
@ -63,11 +63,7 @@ class PacketCraftProgressBar(Packet):
751 : 20, 751 : 20,
755 : 21, 755 : 21,
756 : 21, 756 : 21,
757 : 21, 757 : 21
758 : 21,
759 : 18,
760 : 18,
761 : 17
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ], 47 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
@ -106,9 +102,5 @@ class PacketCraftProgressBar(Packet):
751 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ], 751 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
755 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ], 755 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
756 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ], 756 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
757 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ], 757 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ]
758 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
759 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
760 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
761 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCraftRecipeResponse(Packet): class PacketCraftRecipeResponse(Packet):
__slots__ = ( 'id', 'recipe', 'windowId' ) __slots__ = ( 'id', 'recipe', 'windowId' )
@ -11,12 +11,12 @@ class PacketCraftRecipeResponse(Packet):
recipe : Union[int,str] recipe : Union[int,str]
windowId : int windowId : int
def __init__(self, def __init__(self, proto:int,
recipe:Union[int,str] | None = None, recipe:Union[int,str]=None,
windowId:int | None = None, windowId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
recipe=recipe, recipe=recipe,
windowId=windowId windowId=windowId
) )
@ -46,11 +46,7 @@ class PacketCraftRecipeResponse(Packet):
751 : 47, 751 : 47,
755 : 49, 755 : 49,
756 : 49, 756 : 49,
757 : 49, 757 : 49
758 : 49,
759 : 46,
760 : 48,
761 : 47
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
338 : [ ( 'windowId', Byte ), ( 'recipe', VarInt ) ], 338 : [ ( 'windowId', Byte ), ( 'recipe', VarInt ) ],
@ -75,9 +71,5 @@ class PacketCraftRecipeResponse(Packet):
751 : [ ( 'windowId', Byte ), ( 'recipe', String ) ], 751 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
755 : [ ( 'windowId', Byte ), ( 'recipe', String ) ], 755 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
756 : [ ( 'windowId', Byte ), ( 'recipe', String ) ], 756 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
757 : [ ( 'windowId', Byte ), ( 'recipe', String ) ], 757 : [ ( 'windowId', Byte ), ( 'recipe', String ) ]
758 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
759 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
760 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
761 : [ ( 'windowId', Byte ), ( 'recipe', String ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketCustomPayload(Packet): class PacketCustomPayload(Packet):
__slots__ = ( 'id', 'channel', 'data' ) __slots__ = ( 'id', 'channel', 'data' )
@ -11,12 +11,12 @@ class PacketCustomPayload(Packet):
channel : str channel : str
data : bytes data : bytes
def __init__(self, def __init__(self, proto:int,
channel:str | None = None, channel:str=None,
data:bytes | None = None, data:bytes=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
channel=channel, channel=channel,
data=data data=data
) )
@ -60,11 +60,7 @@ class PacketCustomPayload(Packet):
751 : 23, 751 : 23,
755 : 24, 755 : 24,
756 : 24, 756 : 24,
757 : 24, 757 : 24
758 : 24,
759 : 21,
760 : 22,
761 : 21
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'channel', String ), ( 'data', TrailingData ) ], 47 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
@ -103,9 +99,5 @@ class PacketCustomPayload(Packet):
751 : [ ( 'channel', String ), ( 'data', TrailingData ) ], 751 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
755 : [ ( 'channel', String ), ( 'data', TrailingData ) ], 755 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
756 : [ ( 'channel', String ), ( 'data', TrailingData ) ], 756 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
757 : [ ( 'channel', String ), ( 'data', TrailingData ) ], 757 : [ ( 'channel', String ), ( 'data', TrailingData ) ]
758 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
759 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
760 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
761 : [ ( 'channel', String ), ( 'data', TrailingData ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketDeathCombatEvent(Packet): class PacketDeathCombatEvent(Packet):
__slots__ = ( 'id', 'entityId', 'message', 'playerId' ) __slots__ = ( 'id', 'entityId', 'message', 'playerId' )
@ -12,13 +12,13 @@ class PacketDeathCombatEvent(Packet):
message : str message : str
playerId : int playerId : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
message:str | None = None, message:str=None,
playerId:int | None = None, playerId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
message=message, message=message,
playerId=playerId playerId=playerId
@ -29,18 +29,10 @@ class PacketDeathCombatEvent(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 53, 755 : 53,
756 : 53, 756 : 53,
757 : 53, 757 : 53
758 : 53,
759 : 51,
760 : 54,
761 : 52
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ], 755 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
756 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ], 756 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
757 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ], 757 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ]
758 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
759 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
760 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
761 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ]
} }

View file

@ -0,0 +1,71 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
class PacketDeclareCommands(Packet):
__slots__ = ( 'id', 'nodes', 'rootIndex' )
nodes : list
rootIndex : int
def __init__(self, proto:int,
nodes:list=None,
rootIndex:int=None,
**kwargs
):
super().__init__(proto,
nodes=nodes,
rootIndex=rootIndex
)
_state : int = 3
_ids : Dict[int, int] = {
351 : 17,
393 : 17,
401 : 17,
402 : 17,
403 : 17,
404 : 17,
477 : 17,
480 : 17,
490 : 17,
498 : 17,
573 : 18,
575 : 18,
578 : 18,
709 : 18,
734 : 17,
735 : 17,
736 : 17,
751 : 16,
755 : 18,
756 : 18,
757 : 18
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
351 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
393 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
401 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
402 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
403 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
404 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
477 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
480 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
490 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
498 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
573 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
575 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
578 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
709 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
734 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
735 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
736 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
751 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
755 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
756 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ],
757 : [ ( 'nodes', ArrayType(StructType(( 'flags', Int ), ( 'children', ArrayType(VarInt, VarInt, ) ), ( 'redirectNode', SwitchType('has_redirect_node', { 1 : VarInt }, None, ) ), ( 'extraNodeData', SwitchType('command_node_type', { 0 : Void, 1 : String, 2 : StructType(( 'name', String ), ( 'parser', String ), ( 'properties', SwitchType('parser', { 'brigadier:double' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Double }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Double }, None, ) ), ), 'brigadier:float' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Float }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Float }, None, ) ), ), 'brigadier:integer' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Int }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Int }, None, ) ), ), 'brigadier:long' : StructType(( 'flags', Int ), ( 'min', SwitchType('min_present', { 1 : Long }, None, ) ), ( 'max', SwitchType('max_present', { 1 : Long }, None, ) ), ), 'brigadier:string' : VarInt, 'minecraft:entity' : Byte, 'minecraft:range' : Boolean, 'minecraft:score_holder' : Byte }, None, ) ), ( 'suggests', SwitchType('has_custom_suggestions', { 1 : String }, None, ) ), ) }, None, ) ), ), VarInt, ) ), ( 'rootIndex', VarInt ) ]
}

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketDeclareRecipes(Packet): class PacketDeclareRecipes(Packet):
__slots__ = ( 'id', 'recipes' ) __slots__ = ( 'id', 'recipes' )
recipes : list recipes : list
def __init__(self, def __init__(self, proto:int,
recipes:list | None = None, recipes:list=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
recipes=recipes recipes=recipes
) )
@ -41,11 +41,7 @@ class PacketDeclareRecipes(Packet):
751 : 90, 751 : 90,
755 : 101, 755 : 101,
756 : 101, 756 : 101,
757 : 102, 757 : 102
758 : 102,
759 : 103,
760 : 106,
761 : 105
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
351 : [ ( 'recipes', ArrayType(StructType(( 'recipeId', String ), ( 'type', String ), ( 'data', SwitchType('type', { 'crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(ArrayType(Slot, VarInt, ), 'height', ), 'width', ) ), ( 'result', Slot ), ), 'crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(ArrayType(Slot, VarInt, ), VarInt, ) ), ( 'result', Slot ), ), 'crafting_special_armordye' : Void, 'crafting_special_banneraddpattern' : Void, 'crafting_special_bannerduplicate' : Void, 'crafting_special_bookcloning' : Void, 'crafting_special_firework_rocket' : Void, 'crafting_special_firework_star' : Void, 'crafting_special_firework_star_fade' : Void, 'crafting_special_mapcloning' : Void, 'crafting_special_mapextending' : Void, 'crafting_special_repairitem' : Void, 'crafting_special_shielddecoration' : Void, 'crafting_special_shulkerboxcoloring' : Void, 'crafting_special_tippedarrow' : Void }, None, ) ), ), VarInt, ) ) ], 351 : [ ( 'recipes', ArrayType(StructType(( 'recipeId', String ), ( 'type', String ), ( 'data', SwitchType('type', { 'crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(ArrayType(Slot, VarInt, ), 'height', ), 'width', ) ), ( 'result', Slot ), ), 'crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(ArrayType(Slot, VarInt, ), VarInt, ) ), ( 'result', Slot ), ), 'crafting_special_armordye' : Void, 'crafting_special_banneraddpattern' : Void, 'crafting_special_bannerduplicate' : Void, 'crafting_special_bookcloning' : Void, 'crafting_special_firework_rocket' : Void, 'crafting_special_firework_star' : Void, 'crafting_special_firework_star_fade' : Void, 'crafting_special_mapcloning' : Void, 'crafting_special_mapextending' : Void, 'crafting_special_repairitem' : Void, 'crafting_special_shielddecoration' : Void, 'crafting_special_shulkerboxcoloring' : Void, 'crafting_special_tippedarrow' : Void }, None, ) ), ), VarInt, ) ) ],
@ -68,9 +64,5 @@ class PacketDeclareRecipes(Packet):
751 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'width', ), 'height', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ], 751 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'width', ), 'height', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
755 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ], 755 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
756 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ], 756 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
757 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ], 757 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ]
758 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
759 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
760 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
761 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'category', VarInt ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'category', VarInt ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : TrailingData, 'minecraft:crafting_special_banneraddpattern' : TrailingData, 'minecraft:crafting_special_bannerduplicate' : TrailingData, 'minecraft:crafting_special_bookcloning' : TrailingData, 'minecraft:crafting_special_firework_rocket' : TrailingData, 'minecraft:crafting_special_firework_star' : TrailingData, 'minecraft:crafting_special_firework_star_fade' : TrailingData, 'minecraft:crafting_special_mapcloning' : TrailingData, 'minecraft:crafting_special_mapextending' : TrailingData, 'minecraft:crafting_special_repairitem' : TrailingData, 'minecraft:crafting_special_shielddecoration' : TrailingData, 'minecraft:crafting_special_shulkerboxcoloring' : TrailingData, 'minecraft:crafting_special_suspiciousstew' : TrailingData, 'minecraft:crafting_special_tippedarrow' : TrailingData, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketDestroyEntity(Packet): class PacketDestroyEntity(Packet):
__slots__ = ( 'id', 'entityId' ) __slots__ = ( 'id', 'entityId' )
entityId : int entityId : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId entityId=entityId
) )

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketDifficulty(Packet): class PacketDifficulty(Packet):
__slots__ = ( 'id', 'difficulty', 'difficultyLocked' ) __slots__ = ( 'id', 'difficulty', 'difficultyLocked' )
@ -11,12 +11,12 @@ class PacketDifficulty(Packet):
difficulty : int difficulty : int
difficultyLocked : bool difficultyLocked : bool
def __init__(self, def __init__(self, proto:int,
difficulty:int | None = None, difficulty:int=None,
difficultyLocked:bool | None = None, difficultyLocked:bool=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
difficulty=difficulty, difficulty=difficulty,
difficultyLocked=difficultyLocked difficultyLocked=difficultyLocked
) )
@ -60,11 +60,7 @@ class PacketDifficulty(Packet):
751 : 13, 751 : 13,
755 : 14, 755 : 14,
756 : 14, 756 : 14,
757 : 14, 757 : 14
758 : 14,
759 : 11,
760 : 11,
761 : 11
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'difficulty', Byte ) ], 47 : [ ( 'difficulty', Byte ) ],
@ -103,9 +99,5 @@ class PacketDifficulty(Packet):
751 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ], 751 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
755 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ], 755 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
756 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ], 756 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
757 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ], 757 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ]
758 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
759 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
760 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
761 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEndCombatEvent(Packet): class PacketEndCombatEvent(Packet):
__slots__ = ( 'id', 'duration', 'entityId' ) __slots__ = ( 'id', 'duration', 'entityId' )
@ -11,12 +11,12 @@ class PacketEndCombatEvent(Packet):
duration : int duration : int
entityId : int entityId : int
def __init__(self, def __init__(self, proto:int,
duration:int | None = None, duration:int=None,
entityId:int | None = None, entityId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
duration=duration, duration=duration,
entityId=entityId entityId=entityId
) )
@ -26,18 +26,10 @@ class PacketEndCombatEvent(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 51, 755 : 51,
756 : 51, 756 : 51,
757 : 51, 757 : 51
758 : 51,
759 : 49,
760 : 52,
761 : 50
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ], 755 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
756 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ], 756 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
757 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ], 757 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ]
758 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
759 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
760 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
761 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ]
} }

View file

@ -2,18 +2,18 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEnterCombatEvent(Packet): class PacketEnterCombatEvent(Packet):
__slots__ = ( 'id' ) __slots__ = ( 'id' )
def __init__(self, def __init__(self, proto:int,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
) )
@ -22,18 +22,10 @@ class PacketEnterCombatEvent(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 52, 755 : 52,
756 : 52, 756 : 52,
757 : 52, 757 : 52
758 : 52,
759 : 50,
760 : 53,
761 : 51
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ], 755 : [ ],
756 : [ ], 756 : [ ],
757 : [ ], 757 : [ ]
758 : [ ],
759 : [ ],
760 : [ ],
761 : [ ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntity(Packet): class PacketEntity(Packet):
__slots__ = ( 'id', 'entityId' ) __slots__ = ( 'id', 'entityId' )
entityId : int entityId : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId entityId=entityId
) )

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityDestroy(Packet): class PacketEntityDestroy(Packet):
__slots__ = ( 'id', 'entityIds' ) __slots__ = ( 'id', 'entityIds' )
entityIds : list entityIds : list
def __init__(self, def __init__(self, proto:int,
entityIds:list | None = None, entityIds:list=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityIds=entityIds entityIds=entityIds
) )
@ -56,11 +56,7 @@ class PacketEntityDestroy(Packet):
736 : 55, 736 : 55,
751 : 54, 751 : 54,
756 : 58, 756 : 58,
757 : 58, 757 : 58
758 : 58,
759 : 56,
760 : 59,
761 : 58
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ], 47 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
@ -98,9 +94,5 @@ class PacketEntityDestroy(Packet):
736 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ], 736 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
751 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ], 751 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
756 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ], 756 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
757 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ], 757 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ]
758 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
759 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
760 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
761 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ]
} }

View file

@ -2,34 +2,31 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityEffect(Packet): class PacketEntityEffect(Packet):
__slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'factorCodec', 'hideParticles' ) __slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'hideParticles' )
amplifier : int amplifier : int
duration : int duration : int
effectId : int effectId : int
entityId : int entityId : int
factorCodec : tuple
hideParticles : Union[bool,int] hideParticles : Union[bool,int]
def __init__(self, def __init__(self, proto:int,
amplifier:int | None = None, amplifier:int=None,
duration:int | None = None, duration:int=None,
effectId:int | None = None, effectId:int=None,
entityId:int | None = None, entityId:int=None,
factorCodec:tuple | None = None, hideParticles:Union[bool,int]=None,
hideParticles:Union[bool,int] | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
amplifier=amplifier, amplifier=amplifier,
duration=duration, duration=duration,
effectId=effectId, effectId=effectId,
entityId=entityId, entityId=entityId,
factorCodec=factorCodec,
hideParticles=hideParticles hideParticles=hideParticles
) )
@ -72,11 +69,7 @@ class PacketEntityEffect(Packet):
751 : 89, 751 : 89,
755 : 100, 755 : 100,
756 : 100, 756 : 100,
757 : 101, 757 : 101
758 : 101,
759 : 102,
760 : 105,
761 : 104
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Boolean ) ], 47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Boolean ) ],
@ -115,9 +108,5 @@ class PacketEntityEffect(Packet):
751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
759 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ],
760 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ],
761 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityEquipment(Packet): class PacketEntityEquipment(Packet):
__slots__ = ( 'id', 'entityId', 'equipments', 'item', 'slot' ) __slots__ = ( 'id', 'entityId', 'equipments', 'item', 'slot' )
@ -13,14 +13,14 @@ class PacketEntityEquipment(Packet):
item : Item item : Item
slot : int slot : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
equipments:bytes | None = None, equipments:bytes=None,
item:Item | None = None, item:Item=None,
slot:int | None = None, slot:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
equipments=equipments, equipments=equipments,
item=item, item=item,
@ -66,11 +66,7 @@ class PacketEntityEquipment(Packet):
751 : 71, 751 : 71,
755 : 80, 755 : 80,
756 : 80, 756 : 80,
757 : 80, 757 : 80
758 : 80,
759 : 80,
760 : 83,
761 : 81
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'slot', Short ), ( 'item', Slot ) ], 47 : [ ( 'entityId', VarInt ), ( 'slot', Short ), ( 'item', Slot ) ],
@ -109,9 +105,5 @@ class PacketEntityEquipment(Packet):
751 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ], 751 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
755 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ], 755 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
756 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ], 756 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
757 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ], 757 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ]
758 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
759 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
760 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
761 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityHeadRotation(Packet): class PacketEntityHeadRotation(Packet):
__slots__ = ( 'id', 'entityId', 'headYaw' ) __slots__ = ( 'id', 'entityId', 'headYaw' )
@ -11,12 +11,12 @@ class PacketEntityHeadRotation(Packet):
entityId : int entityId : int
headYaw : int headYaw : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
headYaw:int | None = None, headYaw:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
headYaw=headYaw headYaw=headYaw
) )
@ -60,11 +60,7 @@ class PacketEntityHeadRotation(Packet):
751 : 58, 751 : 58,
755 : 62, 755 : 62,
756 : 62, 756 : 62,
757 : 62, 757 : 62
758 : 62,
759 : 60,
760 : 63,
761 : 62
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ], 47 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
@ -103,9 +99,5 @@ class PacketEntityHeadRotation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
759 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
760 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
761 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityLook(Packet): class PacketEntityLook(Packet):
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'yaw' ) __slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'yaw' )
@ -13,14 +13,14 @@ class PacketEntityLook(Packet):
pitch : int pitch : int
yaw : int yaw : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
onGround:bool | None = None, onGround:bool=None,
pitch:int | None = None, pitch:int=None,
yaw:int | None = None, yaw:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
onGround=onGround, onGround=onGround,
pitch=pitch, pitch=pitch,
@ -66,11 +66,7 @@ class PacketEntityLook(Packet):
751 : 41, 751 : 41,
755 : 43, 755 : 43,
756 : 43, 756 : 43,
757 : 43, 757 : 43
758 : 43,
759 : 40,
760 : 42,
761 : 41
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 47 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -109,9 +105,5 @@ class PacketEntityLook(Packet):
751 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 751 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
755 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 755 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
756 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 756 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
757 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 757 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
758 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
759 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
760 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
761 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityMetadata(Packet): class PacketEntityMetadata(Packet):
__slots__ = ( 'id', 'entityId', 'metadata' ) __slots__ = ( 'id', 'entityId', 'metadata' )
@ -11,12 +11,12 @@ class PacketEntityMetadata(Packet):
entityId : int entityId : int
metadata : dict metadata : dict
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
metadata:dict | None = None, metadata:dict=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
metadata=metadata metadata=metadata
) )
@ -60,11 +60,7 @@ class PacketEntityMetadata(Packet):
751 : 68, 751 : 68,
755 : 77, 755 : 77,
756 : 77, 756 : 77,
757 : 77, 757 : 77
758 : 77,
759 : 77,
760 : 80,
761 : 78
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ], 47 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
@ -103,9 +99,5 @@ class PacketEntityMetadata(Packet):
751 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ], 751 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
755 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ], 755 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
756 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ], 756 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
757 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ], 757 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ]
758 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
759 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
760 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
761 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityMoveLook(Packet): class PacketEntityMoveLook(Packet):
__slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround', 'pitch', 'yaw' ) __slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround', 'pitch', 'yaw' )
@ -16,17 +16,17 @@ class PacketEntityMoveLook(Packet):
pitch : int pitch : int
yaw : int yaw : int
def __init__(self, def __init__(self, proto:int,
dX:int | None = None, dX:int=None,
dY:int | None = None, dY:int=None,
dZ:int | None = None, dZ:int=None,
entityId:int | None = None, entityId:int=None,
onGround:bool | None = None, onGround:bool=None,
pitch:int | None = None, pitch:int=None,
yaw:int | None = None, yaw:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
dX=dX, dX=dX,
dY=dY, dY=dY,
dZ=dZ, dZ=dZ,
@ -75,11 +75,7 @@ class PacketEntityMoveLook(Packet):
751 : 40, 751 : 40,
755 : 42, 755 : 42,
756 : 42, 756 : 42,
757 : 42, 757 : 42
758 : 42,
759 : 39,
760 : 41,
761 : 40
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -118,9 +114,5 @@ class PacketEntityMoveLook(Packet):
751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
758 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
759 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
760 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
761 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
} }

View file

@ -2,36 +2,30 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntitySoundEffect(Packet): class PacketEntitySoundEffect(Packet):
__slots__ = ( 'id', 'entityId', 'pitch', 'seed', 'soundCategory', 'soundEvent', 'soundId', 'volume' ) __slots__ = ( 'id', 'entityId', 'pitch', 'soundCategory', 'soundId', 'volume' )
entityId : int entityId : int
pitch : float pitch : float
seed : int
soundCategory : int soundCategory : int
soundEvent : Union[None, dict]
soundId : int soundId : int
volume : float volume : float
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
pitch:float | None = None, pitch:float=None,
seed:int | None = None, soundCategory:int=None,
soundCategory:int | None = None, soundId:int=None,
soundEvent:Union[None, dict] | None = None, volume:float=None,
soundId:int | None = None,
volume:float | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
pitch=pitch, pitch=pitch,
seed=seed,
soundCategory=soundCategory, soundCategory=soundCategory,
soundEvent=soundEvent,
soundId=soundId, soundId=soundId,
volume=volume volume=volume
) )
@ -53,11 +47,7 @@ class PacketEntitySoundEffect(Packet):
751 : 80, 751 : 80,
755 : 91, 755 : 91,
756 : 91, 756 : 91,
757 : 92, 757 : 92
758 : 92,
759 : 92,
760 : 95,
761 : 93
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
477 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ], 477 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
@ -74,9 +64,5 @@ class PacketEntitySoundEffect(Packet):
751 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ], 751 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
755 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ], 755 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
756 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ], 756 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
757 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ], 757 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ]
758 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
759 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
760 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ],
761 : [ ( 'soundId', VarInt ), ( 'soundEvent', SwitchType('soundId', { 0 : StructType(( 'resource', String ), ( 'range', OptionalType(Float, ) ), ) }, None, ) ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityStatus(Packet): class PacketEntityStatus(Packet):
__slots__ = ( 'id', 'entityId', 'entityStatus' ) __slots__ = ( 'id', 'entityId', 'entityStatus' )
@ -11,12 +11,12 @@ class PacketEntityStatus(Packet):
entityId : int entityId : int
entityStatus : int entityStatus : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
entityStatus:int | None = None, entityStatus:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
entityStatus=entityStatus entityStatus=entityStatus
) )
@ -60,11 +60,7 @@ class PacketEntityStatus(Packet):
751 : 26, 751 : 26,
755 : 27, 755 : 27,
756 : 27, 756 : 27,
757 : 27, 757 : 27
758 : 27,
759 : 24,
760 : 26,
761 : 25
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ], 47 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
@ -103,9 +99,5 @@ class PacketEntityStatus(Packet):
751 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ], 751 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
755 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ], 755 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
756 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ], 756 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
757 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ], 757 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ]
758 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
759 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
760 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
761 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityTeleport(Packet): class PacketEntityTeleport(Packet):
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'x', 'y', 'yaw', 'z' ) __slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'x', 'y', 'yaw', 'z' )
@ -16,17 +16,17 @@ class PacketEntityTeleport(Packet):
yaw : int yaw : int
z : Union[float,int] z : Union[float,int]
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
onGround:bool | None = None, onGround:bool=None,
pitch:int | None = None, pitch:int=None,
x:Union[float,int] | None = None, x:Union[float,int]=None,
y:Union[float,int] | None = None, y:Union[float,int]=None,
yaw:int | None = None, yaw:int=None,
z:Union[float,int] | None = None, z:Union[float,int]=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
onGround=onGround, onGround=onGround,
pitch=pitch, pitch=pitch,
@ -75,11 +75,7 @@ class PacketEntityTeleport(Packet):
751 : 86, 751 : 86,
755 : 97, 755 : 97,
756 : 97, 756 : 97,
757 : 98, 757 : 98
758 : 98,
759 : 99,
760 : 102,
761 : 100
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 47 : [ ( 'entityId', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -118,9 +114,5 @@ class PacketEntityTeleport(Packet):
751 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 751 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
755 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 755 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
756 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 756 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
757 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ], 757 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
758 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
759 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
760 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
761 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityUpdateAttributes(Packet): class PacketEntityUpdateAttributes(Packet):
__slots__ = ( 'id', 'entityId', 'properties' ) __slots__ = ( 'id', 'entityId', 'properties' )
@ -11,12 +11,12 @@ class PacketEntityUpdateAttributes(Packet):
entityId : int entityId : int
properties : list properties : list
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
properties:list | None = None, properties:list=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
properties=properties properties=properties
) )
@ -58,11 +58,7 @@ class PacketEntityUpdateAttributes(Packet):
751 : 88, 751 : 88,
755 : 99, 755 : 99,
756 : 99, 756 : 99,
757 : 100, 757 : 100
758 : 100,
759 : 101,
760 : 104,
761 : 102
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
107 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ], 107 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ],
@ -99,9 +95,5 @@ class PacketEntityUpdateAttributes(Packet):
751 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ], 751 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ],
755 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ], 755 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
756 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ], 756 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
757 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ], 757 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ]
758 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
759 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
760 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
761 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketEntityVelocity(Packet): class PacketEntityVelocity(Packet):
__slots__ = ( 'id', 'entityId', 'velocityX', 'velocityY', 'velocityZ' ) __slots__ = ( 'id', 'entityId', 'velocityX', 'velocityY', 'velocityZ' )
@ -13,14 +13,14 @@ class PacketEntityVelocity(Packet):
velocityY : int velocityY : int
velocityZ : int velocityZ : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
velocityX:int | None = None, velocityX:int=None,
velocityY:int | None = None, velocityY:int=None,
velocityZ:int | None = None, velocityZ:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
velocityX=velocityX, velocityX=velocityX,
velocityY=velocityY, velocityY=velocityY,
@ -66,11 +66,7 @@ class PacketEntityVelocity(Packet):
751 : 70, 751 : 70,
755 : 79, 755 : 79,
756 : 79, 756 : 79,
757 : 79, 757 : 79
758 : 79,
759 : 79,
760 : 82,
761 : 80
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ], 47 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
@ -109,9 +105,5 @@ class PacketEntityVelocity(Packet):
751 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ], 751 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
755 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ], 755 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
756 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ], 756 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
757 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ], 757 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ]
758 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
759 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
760 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
761 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketExperience(Packet): class PacketExperience(Packet):
__slots__ = ( 'id', 'experienceBar', 'level', 'totalExperience' ) __slots__ = ( 'id', 'experienceBar', 'level', 'totalExperience' )
@ -12,13 +12,13 @@ class PacketExperience(Packet):
level : int level : int
totalExperience : int totalExperience : int
def __init__(self, def __init__(self, proto:int,
experienceBar:float | None = None, experienceBar:float=None,
level:int | None = None, level:int=None,
totalExperience:int | None = None, totalExperience:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
experienceBar=experienceBar, experienceBar=experienceBar,
level=level, level=level,
totalExperience=totalExperience totalExperience=totalExperience
@ -63,11 +63,7 @@ class PacketExperience(Packet):
751 : 72, 751 : 72,
755 : 81, 755 : 81,
756 : 81, 756 : 81,
757 : 81, 757 : 81
758 : 81,
759 : 81,
760 : 84,
761 : 82
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ], 47 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
@ -106,9 +102,5 @@ class PacketExperience(Packet):
751 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ], 751 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
755 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ], 755 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
756 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ], 756 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
757 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ], 757 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ]
758 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
759 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
760 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
761 : [ ( 'experienceBar', Float ), ( 'totalExperience', VarInt ), ( 'level', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketExplosion(Packet): class PacketExplosion(Packet):
__slots__ = ( 'id', 'affectedBlockOffsets', 'playerMotionX', 'playerMotionY', 'playerMotionZ', 'radius', 'x', 'y', 'z' ) __slots__ = ( 'id', 'affectedBlockOffsets', 'playerMotionX', 'playerMotionY', 'playerMotionZ', 'radius', 'x', 'y', 'z' )
@ -17,18 +17,18 @@ class PacketExplosion(Packet):
y : float y : float
z : float z : float
def __init__(self, def __init__(self, proto:int,
affectedBlockOffsets:list | None = None, affectedBlockOffsets:list=None,
playerMotionX:float | None = None, playerMotionX:float=None,
playerMotionY:float | None = None, playerMotionY:float=None,
playerMotionZ:float | None = None, playerMotionZ:float=None,
radius:float | None = None, radius:float=None,
x:float | None = None, x:float=None,
y:float | None = None, y:float=None,
z:float | None = None, z:float=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
affectedBlockOffsets=affectedBlockOffsets, affectedBlockOffsets=affectedBlockOffsets,
playerMotionX=playerMotionX, playerMotionX=playerMotionX,
playerMotionY=playerMotionY, playerMotionY=playerMotionY,
@ -78,11 +78,7 @@ class PacketExplosion(Packet):
751 : 27, 751 : 27,
755 : 28, 755 : 28,
756 : 28, 756 : 28,
757 : 28, 757 : 28
758 : 28,
759 : 25,
760 : 27,
761 : 26
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ], 47 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
@ -121,9 +117,5 @@ class PacketExplosion(Packet):
751 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ], 751 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
755 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ], 755 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
756 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ], 756 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
757 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ], 757 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ]
758 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
759 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
760 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
761 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketFacePlayer(Packet): class PacketFacePlayer(Packet):
__slots__ = ( 'id', 'entityId', 'entity_feet_eyes', 'feet_eyes', 'isEntity', 'x', 'y', 'z' ) __slots__ = ( 'id', 'entityId', 'entity_feet_eyes', 'feet_eyes', 'isEntity', 'x', 'y', 'z' )
@ -16,17 +16,17 @@ class PacketFacePlayer(Packet):
y : float y : float
z : float z : float
def __init__(self, def __init__(self, proto:int,
entityId:Union[None, int] | None = None, entityId:Union[None, int]=None,
entity_feet_eyes:Union[None, str] | None = None, entity_feet_eyes:Union[None, str]=None,
feet_eyes:int | None = None, feet_eyes:int=None,
isEntity:bool | None = None, isEntity:bool=None,
x:float | None = None, x:float=None,
y:float | None = None, y:float=None,
z:float | None = None, z:float=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
entity_feet_eyes=entity_feet_eyes, entity_feet_eyes=entity_feet_eyes,
feet_eyes=feet_eyes, feet_eyes=feet_eyes,
@ -58,11 +58,7 @@ class PacketFacePlayer(Packet):
751 : 51, 751 : 51,
755 : 55, 755 : 55,
756 : 55, 756 : 55,
757 : 55, 757 : 55
758 : 55,
759 : 53,
760 : 56,
761 : 55
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ], 393 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
@ -84,9 +80,5 @@ class PacketFacePlayer(Packet):
751 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ], 751 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
755 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ], 755 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
756 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ], 756 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
757 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ], 757 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ]
758 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
759 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
760 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
761 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketGameStateChange(Packet): class PacketGameStateChange(Packet):
__slots__ = ( 'id', 'gameMode', 'reason' ) __slots__ = ( 'id', 'gameMode', 'reason' )
@ -11,12 +11,12 @@ class PacketGameStateChange(Packet):
gameMode : float gameMode : float
reason : int reason : int
def __init__(self, def __init__(self, proto:int,
gameMode:float | None = None, gameMode:float=None,
reason:int | None = None, reason:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
gameMode=gameMode, gameMode=gameMode,
reason=reason reason=reason
) )
@ -60,11 +60,7 @@ class PacketGameStateChange(Packet):
751 : 29, 751 : 29,
755 : 30, 755 : 30,
756 : 30, 756 : 30,
757 : 30, 757 : 30
758 : 30,
759 : 27,
760 : 29,
761 : 28
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ], 47 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
@ -103,9 +99,5 @@ class PacketGameStateChange(Packet):
751 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ], 751 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
755 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ], 755 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
756 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ], 756 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
757 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ], 757 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ]
758 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
759 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
760 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
761 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketHeldItemSlot(Packet): class PacketHeldItemSlot(Packet):
__slots__ = ( 'id', 'slot' ) __slots__ = ( 'id', 'slot' )
slot : int slot : int
def __init__(self, def __init__(self, proto:int,
slot:int | None = None, slot:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
slot=slot slot=slot
) )
@ -57,11 +57,7 @@ class PacketHeldItemSlot(Packet):
751 : 63, 751 : 63,
755 : 72, 755 : 72,
756 : 72, 756 : 72,
757 : 72, 757 : 72
758 : 72,
759 : 71,
760 : 74,
761 : 73
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'slot', Byte ) ], 47 : [ ( 'slot', Byte ) ],
@ -100,9 +96,5 @@ class PacketHeldItemSlot(Packet):
751 : [ ( 'slot', Byte ) ], 751 : [ ( 'slot', Byte ) ],
755 : [ ( 'slot', Byte ) ], 755 : [ ( 'slot', Byte ) ],
756 : [ ( 'slot', Byte ) ], 756 : [ ( 'slot', Byte ) ],
757 : [ ( 'slot', Byte ) ], 757 : [ ( 'slot', Byte ) ]
758 : [ ( 'slot', Byte ) ],
759 : [ ( 'slot', Byte ) ],
760 : [ ( 'slot', Byte ) ],
761 : [ ( 'slot', Byte ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketInitializeWorldBorder(Packet): class PacketInitializeWorldBorder(Packet):
__slots__ = ( 'id', 'newDiameter', 'oldDiameter', 'portalTeleportBoundary', 'speed', 'warningBlocks', 'warningTime', 'x', 'z' ) __slots__ = ( 'id', 'newDiameter', 'oldDiameter', 'portalTeleportBoundary', 'speed', 'warningBlocks', 'warningTime', 'x', 'z' )
@ -17,18 +17,18 @@ class PacketInitializeWorldBorder(Packet):
x : float x : float
z : float z : float
def __init__(self, def __init__(self, proto:int,
newDiameter:float | None = None, newDiameter:float=None,
oldDiameter:float | None = None, oldDiameter:float=None,
portalTeleportBoundary:int | None = None, portalTeleportBoundary:int=None,
speed:int | None = None, speed:int=None,
warningBlocks:int | None = None, warningBlocks:int=None,
warningTime:int | None = None, warningTime:int=None,
x:float | None = None, x:float=None,
z:float | None = None, z:float=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
newDiameter=newDiameter, newDiameter=newDiameter,
oldDiameter=oldDiameter, oldDiameter=oldDiameter,
portalTeleportBoundary=portalTeleportBoundary, portalTeleportBoundary=portalTeleportBoundary,
@ -44,18 +44,10 @@ class PacketInitializeWorldBorder(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 32, 755 : 32,
756 : 32, 756 : 32,
757 : 32, 757 : 32
758 : 32,
759 : 29,
760 : 31,
761 : 30
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarLong ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ], 755 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
756 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarLong ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ], 756 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
757 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarLong ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ], 757 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ]
758 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarLong ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
759 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
760 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
761 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketKeepAlive(Packet): class PacketKeepAlive(Packet):
__slots__ = ( 'id', 'keepAliveId' ) __slots__ = ( 'id', 'keepAliveId' )
keepAliveId : int keepAliveId : int
def __init__(self, def __init__(self, proto:int,
keepAliveId:int | None = None, keepAliveId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
keepAliveId=keepAliveId keepAliveId=keepAliveId
) )
@ -57,11 +57,7 @@ class PacketKeepAlive(Packet):
751 : 31, 751 : 31,
755 : 33, 755 : 33,
756 : 33, 756 : 33,
757 : 33, 757 : 33
758 : 33,
759 : 30,
760 : 32,
761 : 31
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'keepAliveId', VarInt ) ], 47 : [ ( 'keepAliveId', VarInt ) ],
@ -100,9 +96,5 @@ class PacketKeepAlive(Packet):
751 : [ ( 'keepAliveId', Long ) ], 751 : [ ( 'keepAliveId', Long ) ],
755 : [ ( 'keepAliveId', Long ) ], 755 : [ ( 'keepAliveId', Long ) ],
756 : [ ( 'keepAliveId', Long ) ], 756 : [ ( 'keepAliveId', Long ) ],
757 : [ ( 'keepAliveId', Long ) ], 757 : [ ( 'keepAliveId', Long ) ]
758 : [ ( 'keepAliveId', Long ) ],
759 : [ ( 'keepAliveId', Long ) ],
760 : [ ( 'keepAliveId', Long ) ],
761 : [ ( 'keepAliveId', Long ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketKickDisconnect(Packet): class PacketKickDisconnect(Packet):
__slots__ = ( 'id', 'reason' ) __slots__ = ( 'id', 'reason' )
reason : str reason : str
def __init__(self, def __init__(self, proto:int,
reason:str | None = None, reason:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
reason=reason reason=reason
) )
@ -57,11 +57,7 @@ class PacketKickDisconnect(Packet):
751 : 25, 751 : 25,
755 : 26, 755 : 26,
756 : 26, 756 : 26,
757 : 26, 757 : 26
758 : 26,
759 : 23,
760 : 25,
761 : 23
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'reason', String ) ], 47 : [ ( 'reason', String ) ],
@ -100,9 +96,5 @@ class PacketKickDisconnect(Packet):
751 : [ ( 'reason', String ) ], 751 : [ ( 'reason', String ) ],
755 : [ ( 'reason', String ) ], 755 : [ ( 'reason', String ) ],
756 : [ ( 'reason', String ) ], 756 : [ ( 'reason', String ) ],
757 : [ ( 'reason', String ) ], 757 : [ ( 'reason', String ) ]
758 : [ ( 'reason', String ) ],
759 : [ ( 'reason', String ) ],
760 : [ ( 'reason', String ) ],
761 : [ ( 'reason', String ) ]
} }

View file

@ -2,13 +2,12 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketLogin(Packet): class PacketLogin(Packet):
__slots__ = ( 'id', 'death', 'difficulty', 'dimension', 'dimensionCodec', 'enableRespawnScreen', 'entityId', 'gameMode', 'hashedSeed', 'isDebug', 'isFlat', 'isHardcore', 'levelType', 'maxPlayers', 'previousGameMode', 'reducedDebugInfo', 'simulationDistance', 'viewDistance', 'worldName', 'worldNames', 'worldType' ) __slots__ = ( 'id', 'difficulty', 'dimension', 'dimensionCodec', 'enableRespawnScreen', 'entityId', 'gameMode', 'hashedSeed', 'isDebug', 'isFlat', 'isHardcore', 'levelType', 'maxPlayers', 'previousGameMode', 'reducedDebugInfo', 'simulationDistance', 'viewDistance', 'worldName', 'worldNames' )
death : tuple
difficulty : int difficulty : int
dimension : Union[dict,int,str] dimension : Union[dict,int,str]
dimensionCodec : dict dimensionCodec : dict
@ -27,33 +26,29 @@ class PacketLogin(Packet):
viewDistance : int viewDistance : int
worldName : str worldName : str
worldNames : list worldNames : list
worldType : str
def __init__(self, def __init__(self, proto:int,
death:tuple | None = None, difficulty:int=None,
difficulty:int | None = None, dimension:Union[dict,int,str]=None,
dimension:Union[dict,int,str] | None = None, dimensionCodec:dict=None,
dimensionCodec:dict | None = None, enableRespawnScreen:bool=None,
enableRespawnScreen:bool | None = None, entityId:int=None,
entityId:int | None = None, gameMode:int=None,
gameMode:int | None = None, hashedSeed:int=None,
hashedSeed:int | None = None, isDebug:bool=None,
isDebug:bool | None = None, isFlat:bool=None,
isFlat:bool | None = None, isHardcore:bool=None,
isHardcore:bool | None = None, levelType:str=None,
levelType:str | None = None, maxPlayers:int=None,
maxPlayers:int | None = None, previousGameMode:int=None,
previousGameMode:int | None = None, reducedDebugInfo:bool=None,
reducedDebugInfo:bool | None = None, simulationDistance:int=None,
simulationDistance:int | None = None, viewDistance:int=None,
viewDistance:int | None = None, worldName:str=None,
worldName:str | None = None, worldNames:list=None,
worldNames:list | None = None,
worldType:str | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
death=death,
difficulty=difficulty, difficulty=difficulty,
dimension=dimension, dimension=dimension,
dimensionCodec=dimensionCodec, dimensionCodec=dimensionCodec,
@ -71,8 +66,7 @@ class PacketLogin(Packet):
simulationDistance=simulationDistance, simulationDistance=simulationDistance,
viewDistance=viewDistance, viewDistance=viewDistance,
worldName=worldName, worldName=worldName,
worldNames=worldNames, worldNames=worldNames
worldType=worldType
) )
_state : int = 3 _state : int = 3
@ -114,11 +108,7 @@ class PacketLogin(Packet):
751 : 36, 751 : 36,
755 : 38, 755 : 38,
756 : 38, 756 : 38,
757 : 38, 757 : 38
758 : 38,
759 : 35,
760 : 37,
761 : 36
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'gameMode', Byte ), ( 'dimension', Byte ), ( 'difficulty', Byte ), ( 'maxPlayers', Byte ), ( 'levelType', String ), ( 'reducedDebugInfo', Boolean ) ], 47 : [ ( 'entityId', Int ), ( 'gameMode', Byte ), ( 'dimension', Byte ), ( 'difficulty', Byte ), ( 'maxPlayers', Byte ), ( 'levelType', String ), ( 'reducedDebugInfo', Boolean ) ],
@ -157,9 +147,5 @@ class PacketLogin(Packet):
751 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ], 751 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
755 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ], 755 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
756 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ], 756 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
757 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ], 757 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ]
758 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
759 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ],
760 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ],
761 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketMap(Packet): class PacketMap(Packet):
__slots__ = ( 'id', 'columns', 'data', 'icons', 'itemDamage', 'locked', 'rows', 'scale', 'trackingPosition', 'x', 'y' ) __slots__ = ( 'id', 'columns', 'data', 'icons', 'itemDamage', 'locked', 'rows', 'scale', 'trackingPosition', 'x', 'y' )
@ -19,20 +19,20 @@ class PacketMap(Packet):
x : Union[None, int] x : Union[None, int]
y : Union[None, int] y : Union[None, int]
def __init__(self, def __init__(self, proto:int,
columns:int | None = None, columns:int=None,
data:Union[None, bytes] | None = None, data:Union[None, bytes]=None,
icons:Union[list,tuple] | None = None, icons:Union[list,tuple]=None,
itemDamage:int | None = None, itemDamage:int=None,
locked:bool | None = None, locked:bool=None,
rows:Union[None, int] | None = None, rows:Union[None, int]=None,
scale:int | None = None, scale:int=None,
trackingPosition:bool | None = None, trackingPosition:bool=None,
x:Union[None, int] | None = None, x:Union[None, int]=None,
y:Union[None, int] | None = None, y:Union[None, int]=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
columns=columns, columns=columns,
data=data, data=data,
icons=icons, icons=icons,
@ -84,11 +84,7 @@ class PacketMap(Packet):
751 : 37, 751 : 37,
755 : 39, 755 : 39,
756 : 39, 756 : 39,
757 : 39, 757 : 39
758 : 39,
759 : 36,
760 : 38,
761 : 37
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'icons', ArrayType(StructType(( 'directionAndType', Byte ), ( 'x', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ], 47 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'icons', ArrayType(StructType(( 'directionAndType', Byte ), ( 'x', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
@ -127,9 +123,5 @@ class PacketMap(Packet):
751 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'trackingPosition', Boolean ), ( 'locked', Boolean ), ( 'icons', ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ], 751 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'trackingPosition', Boolean ), ( 'locked', Boolean ), ( 'icons', ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
755 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ], 755 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
756 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ], 756 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
757 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ], 757 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ]
758 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
759 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
760 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
761 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketMapChunk(Packet): class PacketMapChunk(Packet):
__slots__ = ( 'id', 'biomes', 'bitMap', 'blockEntities', 'blockLight', 'blockLightMask', 'chunkData', 'emptyBlockLightMask', 'emptySkyLightMask', 'groundUp', 'heightmaps', 'ignoreOldData', 'skyLight', 'skyLightMask', 'trustEdges', 'x', 'z' ) __slots__ = ( 'id', 'biomes', 'bitMap', 'blockEntities', 'blockLight', 'blockLightMask', 'chunkData', 'emptyBlockLightMask', 'emptySkyLightMask', 'groundUp', 'heightmaps', 'ignoreOldData', 'skyLight', 'skyLightMask', 'trustEdges', 'x', 'z' )
@ -25,26 +25,26 @@ class PacketMapChunk(Packet):
x : int x : int
z : int z : int
def __init__(self, def __init__(self, proto:int,
biomes:Union[Union[None, list],list] | None = None, biomes:Union[Union[None, list],list]=None,
bitMap:Union[int,list] | None = None, bitMap:Union[int,list]=None,
blockEntities:list | None = None, blockEntities:list=None,
blockLight:list | None = None, blockLight:list=None,
blockLightMask:list | None = None, blockLightMask:list=None,
chunkData:bytes | None = None, chunkData:bytes=None,
emptyBlockLightMask:list | None = None, emptyBlockLightMask:list=None,
emptySkyLightMask:list | None = None, emptySkyLightMask:list=None,
groundUp:bool | None = None, groundUp:bool=None,
heightmaps:dict | None = None, heightmaps:dict=None,
ignoreOldData:bool | None = None, ignoreOldData:bool=None,
skyLight:list | None = None, skyLight:list=None,
skyLightMask:list | None = None, skyLightMask:list=None,
trustEdges:bool | None = None, trustEdges:bool=None,
x:int | None = None, x:int=None,
z:int | None = None, z:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
biomes=biomes, biomes=biomes,
bitMap=bitMap, bitMap=bitMap,
blockEntities=blockEntities, blockEntities=blockEntities,
@ -102,11 +102,7 @@ class PacketMapChunk(Packet):
751 : 32, 751 : 32,
755 : 34, 755 : 34,
756 : 34, 756 : 34,
757 : 34, 757 : 34
758 : 34,
759 : 31,
760 : 33,
761 : 32
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', UnsignedShort ), ( 'chunkData', ByteArray ) ], 47 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', UnsignedShort ), ( 'chunkData', ByteArray ) ],
@ -145,9 +141,5 @@ class PacketMapChunk(Packet):
751 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', VarInt ), ( 'heightmaps', NBTTag ), ( 'biomes', SwitchType('groundUp', { 'false' : Void, 'true' : ArrayType(VarInt, VarInt, ) }, None, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ], 751 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', VarInt ), ( 'heightmaps', NBTTag ), ( 'biomes', SwitchType('groundUp', { 'false' : Void, 'true' : ArrayType(VarInt, VarInt, ) }, None, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
755 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ], 755 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
756 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ], 756 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
757 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ], 757 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ]
758 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
759 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
760 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
761 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketMapChunkBulk(Packet): class PacketMapChunkBulk(Packet):
__slots__ = ( 'id', 'data', 'meta', 'skyLightSent' ) __slots__ = ( 'id', 'data', 'meta', 'skyLightSent' )
@ -12,13 +12,13 @@ class PacketMapChunkBulk(Packet):
meta : list meta : list
skyLightSent : bool skyLightSent : bool
def __init__(self, def __init__(self, proto:int,
data:bytes | None = None, data:bytes=None,
meta:list | None = None, meta:list=None,
skyLightSent:bool | None = None, skyLightSent:bool=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
data=data, data=data,
meta=meta, meta=meta,
skyLightSent=skyLightSent skyLightSent=skyLightSent

View file

@ -2,35 +2,32 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketMultiBlockChange(Packet): class PacketMultiBlockChange(Packet):
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records', 'suppressLightUpdates' ) __slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records' )
chunkCoordinates : int chunkCoordinates : bytes
chunkX : int chunkX : int
chunkZ : int chunkZ : int
notTrustEdges : bool notTrustEdges : bool
records : list records : list
suppressLightUpdates : bool
def __init__(self, def __init__(self, proto:int,
chunkCoordinates:int | None = None, chunkCoordinates:bytes=None,
chunkX:int | None = None, chunkX:int=None,
chunkZ:int | None = None, chunkZ:int=None,
notTrustEdges:bool | None = None, notTrustEdges:bool=None,
records:list | None = None, records:list=None,
suppressLightUpdates:bool | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
chunkCoordinates=chunkCoordinates, chunkCoordinates=chunkCoordinates,
chunkX=chunkX, chunkX=chunkX,
chunkZ=chunkZ, chunkZ=chunkZ,
notTrustEdges=notTrustEdges, notTrustEdges=notTrustEdges,
records=records, records=records
suppressLightUpdates=suppressLightUpdates
) )
_state : int = 3 _state : int = 3
@ -72,11 +69,7 @@ class PacketMultiBlockChange(Packet):
751 : 59, 751 : 59,
755 : 63, 755 : 63,
756 : 63, 756 : 63,
757 : 63, 757 : 63
758 : 63,
759 : 61,
760 : 64,
761 : 63
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ], 47 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
@ -112,12 +105,8 @@ class PacketMultiBlockChange(Packet):
734 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ], 734 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
735 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ], 735 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
736 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ], 736 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
751 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ], 751 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
755 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ], 755 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
756 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ], 756 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
757 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ], 757 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ]
758 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ],
759 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
760 : [ ( 'chunkCoordinates', Long ), ( 'suppressLightUpdates', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
761 : [ ( 'chunkCoordinates', Long ), ( 'suppressLightUpdates', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketNamedEntitySpawn(Packet): class PacketNamedEntitySpawn(Packet):
__slots__ = ( 'id', 'currentItem', 'entityId', 'metadata', 'pitch', 'playerUUID', 'x', 'y', 'yaw', 'z' ) __slots__ = ( 'id', 'currentItem', 'entityId', 'metadata', 'pitch', 'playerUUID', 'x', 'y', 'yaw', 'z' )
@ -18,19 +18,19 @@ class PacketNamedEntitySpawn(Packet):
yaw : int yaw : int
z : Union[float,int] z : Union[float,int]
def __init__(self, def __init__(self, proto:int,
currentItem:int | None = None, currentItem:int=None,
entityId:int | None = None, entityId:int=None,
metadata:dict | None = None, metadata:dict=None,
pitch:int | None = None, pitch:int=None,
playerUUID:str | None = None, playerUUID:str=None,
x:Union[float,int] | None = None, x:Union[float,int]=None,
y:Union[float,int] | None = None, y:Union[float,int]=None,
yaw:int | None = None, yaw:int=None,
z:Union[float,int] | None = None, z:Union[float,int]=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
currentItem=currentItem, currentItem=currentItem,
entityId=entityId, entityId=entityId,
metadata=metadata, metadata=metadata,
@ -81,11 +81,7 @@ class PacketNamedEntitySpawn(Packet):
751 : 4, 751 : 4,
755 : 4, 755 : 4,
756 : 4, 756 : 4,
757 : 4, 757 : 4
758 : 4,
759 : 2,
760 : 2,
761 : 2
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'currentItem', Short ), ( 'metadata', EntityMetadata ) ], 47 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'currentItem', Short ), ( 'metadata', EntityMetadata ) ],
@ -124,9 +120,5 @@ class PacketNamedEntitySpawn(Packet):
751 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
759 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
760 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ],
761 : [ ( 'entityId', VarInt ), ( 'playerUUID', UUID ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ) ]
} }

View file

@ -2,14 +2,13 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketNamedSoundEffect(Packet): class PacketNamedSoundEffect(Packet):
__slots__ = ( 'id', 'pitch', 'seed', 'soundCategory', 'soundName', 'volume', 'x', 'y', 'z' ) __slots__ = ( 'id', 'pitch', 'soundCategory', 'soundName', 'volume', 'x', 'y', 'z' )
pitch : Union[float,int] pitch : Union[float,int]
seed : int
soundCategory : int soundCategory : int
soundName : str soundName : str
volume : float volume : float
@ -17,20 +16,18 @@ class PacketNamedSoundEffect(Packet):
y : int y : int
z : int z : int
def __init__(self, def __init__(self, proto:int,
pitch:Union[float,int] | None = None, pitch:Union[float,int]=None,
seed:int | None = None, soundCategory:int=None,
soundCategory:int | None = None, soundName:str=None,
soundName:str | None = None, volume:float=None,
volume:float | None = None, x:int=None,
x:int | None = None, y:int=None,
y:int | None = None, z:int=None,
z:int | None = None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
pitch=pitch, pitch=pitch,
seed=seed,
soundCategory=soundCategory, soundCategory=soundCategory,
soundName=soundName, soundName=soundName,
volume=volume, volume=volume,
@ -78,10 +75,7 @@ class PacketNamedSoundEffect(Packet):
751 : 24, 751 : 24,
755 : 25, 755 : 25,
756 : 25, 756 : 25,
757 : 25, 757 : 25
758 : 25,
759 : 22,
760 : 23
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'soundName', String ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Byte ) ], 47 : [ ( 'soundName', String ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Byte ) ],
@ -120,8 +114,5 @@ class PacketNamedSoundEffect(Packet):
751 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ], 751 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ],
755 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ], 755 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ],
756 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ], 756 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ],
757 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ], 757 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ]
758 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ) ],
759 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ],
760 : [ ( 'soundName', String ), ( 'soundCategory', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketNbtQueryResponse(Packet): class PacketNbtQueryResponse(Packet):
__slots__ = ( 'id', 'nbt', 'transactionId' ) __slots__ = ( 'id', 'nbt', 'transactionId' )
@ -11,12 +11,12 @@ class PacketNbtQueryResponse(Packet):
nbt : Optional[dict] nbt : Optional[dict]
transactionId : int transactionId : int
def __init__(self, def __init__(self, proto:int,
nbt:Optional[dict] | None = None, nbt:Optional[dict]=None,
transactionId:int | None = None, transactionId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
nbt=nbt, nbt=nbt,
transactionId=transactionId transactionId=transactionId
) )
@ -43,11 +43,7 @@ class PacketNbtQueryResponse(Packet):
751 : 84, 751 : 84,
755 : 95, 755 : 95,
756 : 95, 756 : 95,
757 : 96, 757 : 96
758 : 96,
759 : 97,
760 : 100,
761 : 98
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ], 393 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
@ -69,9 +65,5 @@ class PacketNbtQueryResponse(Packet):
751 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ], 751 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
755 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ], 755 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
756 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ], 756 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
757 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ], 757 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ]
758 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
759 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
760 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ],
761 : [ ( 'transactionId', VarInt ), ( 'nbt', OptionalType(NBTTag) ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketOpenBook(Packet): class PacketOpenBook(Packet):
__slots__ = ( 'id', 'hand' ) __slots__ = ( 'id', 'hand' )
hand : int hand : int
def __init__(self, def __init__(self, proto:int,
hand:int | None = None, hand:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
hand=hand hand=hand
) )
@ -35,11 +35,7 @@ class PacketOpenBook(Packet):
751 : 44, 751 : 44,
755 : 45, 755 : 45,
756 : 45, 756 : 45,
757 : 45, 757 : 45
758 : 45,
759 : 42,
760 : 44,
761 : 43
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
477 : [ ( 'hand', VarInt ) ], 477 : [ ( 'hand', VarInt ) ],
@ -56,9 +52,5 @@ class PacketOpenBook(Packet):
751 : [ ( 'hand', VarInt ) ], 751 : [ ( 'hand', VarInt ) ],
755 : [ ( 'hand', VarInt ) ], 755 : [ ( 'hand', VarInt ) ],
756 : [ ( 'hand', VarInt ) ], 756 : [ ( 'hand', VarInt ) ],
757 : [ ( 'hand', VarInt ) ], 757 : [ ( 'hand', VarInt ) ]
758 : [ ( 'hand', VarInt ) ],
759 : [ ( 'hand', VarInt ) ],
760 : [ ( 'hand', VarInt ) ],
761 : [ ( 'hand', VarInt ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketOpenHorseWindow(Packet): class PacketOpenHorseWindow(Packet):
__slots__ = ( 'id', 'entityId', 'nbSlots', 'windowId' ) __slots__ = ( 'id', 'entityId', 'nbSlots', 'windowId' )
@ -12,13 +12,13 @@ class PacketOpenHorseWindow(Packet):
nbSlots : int nbSlots : int
windowId : int windowId : int
def __init__(self, def __init__(self, proto:int,
entityId:int | None = None, entityId:int=None,
nbSlots:int | None = None, nbSlots:int=None,
windowId:int | None = None, windowId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
nbSlots=nbSlots, nbSlots=nbSlots,
windowId=windowId windowId=windowId
@ -41,11 +41,7 @@ class PacketOpenHorseWindow(Packet):
751 : 30, 751 : 30,
755 : 31, 755 : 31,
756 : 31, 756 : 31,
757 : 31, 757 : 31
758 : 31,
759 : 28,
760 : 30,
761 : 29
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
477 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ], 477 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
@ -62,9 +58,5 @@ class PacketOpenHorseWindow(Packet):
751 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ], 751 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
755 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ], 755 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
756 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ], 756 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
757 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ], 757 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ]
758 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
759 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
760 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ],
761 : [ ( 'windowId', Byte ), ( 'nbSlots', VarInt ), ( 'entityId', Int ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketOpenSignEntity(Packet): class PacketOpenSignEntity(Packet):
__slots__ = ( 'id', 'location' ) __slots__ = ( 'id', 'location' )
location : tuple location : tuple
def __init__(self, def __init__(self, proto:int,
location:tuple | None = None, location:tuple=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
location=location location=location
) )
@ -57,11 +57,7 @@ class PacketOpenSignEntity(Packet):
751 : 46, 751 : 46,
755 : 47, 755 : 47,
756 : 47, 756 : 47,
757 : 47, 757 : 47
758 : 47,
759 : 44,
760 : 46,
761 : 45
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'location', Position ) ], 47 : [ ( 'location', Position ) ],
@ -100,9 +96,5 @@ class PacketOpenSignEntity(Packet):
751 : [ ( 'location', Position ) ], 751 : [ ( 'location', Position ) ],
755 : [ ( 'location', Position ) ], 755 : [ ( 'location', Position ) ],
756 : [ ( 'location', Position ) ], 756 : [ ( 'location', Position ) ],
757 : [ ( 'location', Position ) ], 757 : [ ( 'location', Position ) ]
758 : [ ( 'location', Position ) ],
759 : [ ( 'location', Position ) ],
760 : [ ( 'location', Position ) ],
761 : [ ( 'location', Position ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketOpenWindow(Packet): class PacketOpenWindow(Packet):
__slots__ = ( 'id', 'entityId', 'inventoryType', 'slotCount', 'windowId', 'windowTitle' ) __slots__ = ( 'id', 'entityId', 'inventoryType', 'slotCount', 'windowId', 'windowTitle' )
@ -14,15 +14,15 @@ class PacketOpenWindow(Packet):
windowId : int windowId : int
windowTitle : str windowTitle : str
def __init__(self, def __init__(self, proto:int,
entityId:Union[None, int] | None = None, entityId:Union[None, int]=None,
inventoryType:Union[int,str] | None = None, inventoryType:Union[int,str]=None,
slotCount:int | None = None, slotCount:int=None,
windowId:int | None = None, windowId:int=None,
windowTitle:str | None = None, windowTitle:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
entityId=entityId, entityId=entityId,
inventoryType=inventoryType, inventoryType=inventoryType,
slotCount=slotCount, slotCount=slotCount,
@ -69,11 +69,7 @@ class PacketOpenWindow(Packet):
751 : 45, 751 : 45,
755 : 46, 755 : 46,
756 : 46, 756 : 46,
757 : 46, 757 : 46
758 : 46,
759 : 43,
760 : 45,
761 : 44
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'windowId', Byte ), ( 'inventoryType', String ), ( 'windowTitle', String ), ( 'slotCount', Byte ), ( 'entityId', SwitchType('inventoryType', { 'EntityHorse' : Int }, None, ) ) ], 47 : [ ( 'windowId', Byte ), ( 'inventoryType', String ), ( 'windowTitle', String ), ( 'slotCount', Byte ), ( 'entityId', SwitchType('inventoryType', { 'EntityHorse' : Int }, None, ) ) ],
@ -112,9 +108,5 @@ class PacketOpenWindow(Packet):
751 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ], 751 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
755 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ], 755 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
756 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ], 756 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
757 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ], 757 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ]
758 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
759 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
760 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ],
761 : [ ( 'windowId', VarInt ), ( 'inventoryType', VarInt ), ( 'windowTitle', String ) ]
} }

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketPing(Packet): class PacketPing(Packet):
__slots__ = ( 'id', 'id' ) __slots__ = ( 'id', 'id' )
id : int id : int
def __init__(self, def __init__(self, proto:int,
id:int | None = None, id:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
id=id id=id
) )
@ -23,18 +23,10 @@ class PacketPing(Packet):
_ids : Dict[int, int] = { _ids : Dict[int, int] = {
755 : 48, 755 : 48,
756 : 48, 756 : 48,
757 : 48, 757 : 48
758 : 48,
759 : 45,
760 : 47,
761 : 46
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( 'id', Int ) ], 755 : [ ( 'id', Int ) ],
756 : [ ( 'id', Int ) ], 756 : [ ( 'id', Int ) ],
757 : [ ( 'id', Int ) ], 757 : [ ( 'id', Int ) ]
758 : [ ( 'id', Int ) ],
759 : [ ( 'id', Int ) ],
760 : [ ( 'id', Int ) ],
761 : [ ( 'id', Int ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketPlayerInfo(Packet): class PacketPlayerInfo(Packet):
__slots__ = ( 'id', 'action', 'data' ) __slots__ = ( 'id', 'action', 'data' )
@ -11,12 +11,12 @@ class PacketPlayerInfo(Packet):
action : int action : int
data : list data : list
def __init__(self, def __init__(self, proto:int,
action:int | None = None, action:int=None,
data:list | None = None, data:list=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
action=action, action=action,
data=data data=data
) )
@ -60,11 +60,7 @@ class PacketPlayerInfo(Packet):
751 : 50, 751 : 50,
755 : 54, 755 : 54,
756 : 54, 756 : 54,
757 : 54, 757 : 54
758 : 54,
759 : 52,
760 : 55,
761 : 54
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ], 47 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ],
@ -103,9 +99,5 @@ class PacketPlayerInfo(Packet):
751 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ], 751 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ],
755 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ], 755 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ],
756 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ], 756 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ],
757 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ], 757 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ]
758 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ],
759 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ( 'crypto', SwitchType('action', { 0 : OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) }, None, ) ), ), VarInt, ) ) ],
760 : [ ( 'action', VarInt ), ( 'data', ArrayType(StructType(( 'UUID', UUID ), ( 'name', SwitchType('action', { 0 : String }, None, ) ), ( 'properties', SwitchType('action', { 0 : ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) }, None, ) ), ( 'gamemode', SwitchType('action', { 0 : VarInt, 1 : VarInt }, None, ) ), ( 'ping', SwitchType('action', { 0 : VarInt, 2 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 0 : OptionalType(String, ), 3 : OptionalType(String, ) }, None, ) ), ( 'crypto', SwitchType('action', { 0 : OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) }, None, ) ), ), VarInt, ) ) ],
761 : [ ( 'action', Byte ), ( 'data', ArrayType(StructType(( 'uuid', UUID ), ( 'player', SwitchType('action', { 1 : TrailingData, 3 : TrailingData, 5 : TrailingData, 7 : TrailingData, 9 : TrailingData, 11 : TrailingData, 13 : TrailingData, 15 : TrailingData, 17 : TrailingData, 19 : TrailingData, 21 : TrailingData, 23 : TrailingData, 25 : TrailingData, 27 : TrailingData, 29 : TrailingData, 31 : TrailingData, 33 : TrailingData, 35 : TrailingData, 37 : TrailingData, 39 : TrailingData, 41 : TrailingData, 43 : TrailingData, 45 : TrailingData, 47 : TrailingData, 49 : TrailingData, 51 : TrailingData, 53 : TrailingData, 55 : TrailingData, 57 : TrailingData, 59 : TrailingData, 61 : TrailingData, 63 : TrailingData }, None, ) ), ( 'chatSession', SwitchType('action', { 2 : TrailingData, 3 : TrailingData, 6 : TrailingData, 7 : TrailingData, 10 : TrailingData, 11 : TrailingData, 14 : TrailingData, 15 : TrailingData, 18 : TrailingData, 19 : TrailingData, 22 : TrailingData, 23 : TrailingData, 26 : TrailingData, 27 : TrailingData, 30 : TrailingData, 31 : TrailingData, 34 : TrailingData, 35 : TrailingData, 38 : TrailingData, 39 : TrailingData, 42 : TrailingData, 43 : TrailingData, 46 : TrailingData, 47 : TrailingData, 50 : TrailingData, 51 : TrailingData, 54 : TrailingData, 55 : TrailingData, 58 : TrailingData, 59 : TrailingData, 62 : TrailingData, 63 : TrailingData }, None, ) ), ( 'gamemode', SwitchType('action', { 4 : VarInt, 5 : VarInt, 6 : VarInt, 7 : VarInt, 12 : VarInt, 13 : VarInt, 14 : VarInt, 15 : VarInt, 20 : VarInt, 21 : VarInt, 22 : VarInt, 23 : VarInt, 28 : VarInt, 29 : VarInt, 30 : VarInt, 31 : VarInt, 36 : VarInt, 37 : VarInt, 38 : VarInt, 39 : VarInt, 44 : VarInt, 45 : VarInt, 46 : VarInt, 47 : VarInt, 52 : VarInt, 53 : VarInt, 54 : VarInt, 55 : VarInt, 60 : VarInt, 61 : VarInt, 62 : VarInt, 63 : VarInt }, None, ) ), ( 'listed', SwitchType('action', { 8 : Boolean, 9 : Boolean, 10 : Boolean, 11 : Boolean, 12 : Boolean, 13 : Boolean, 14 : Boolean, 15 : Boolean, 24 : Boolean, 25 : Boolean, 26 : Boolean, 27 : Boolean, 28 : Boolean, 29 : Boolean, 30 : Boolean, 31 : Boolean, 40 : Boolean, 41 : Boolean, 42 : Boolean, 43 : Boolean, 44 : Boolean, 45 : Boolean, 46 : Boolean, 47 : Boolean, 56 : Boolean, 57 : Boolean, 58 : Boolean, 59 : Boolean, 60 : Boolean, 61 : Boolean, 62 : Boolean, 63 : Boolean }, None, ) ), ( 'latency', SwitchType('action', { 16 : VarInt, 17 : VarInt, 18 : VarInt, 19 : VarInt, 20 : VarInt, 21 : VarInt, 22 : VarInt, 23 : VarInt, 24 : VarInt, 25 : VarInt, 26 : VarInt, 27 : VarInt, 28 : VarInt, 29 : VarInt, 30 : VarInt, 31 : VarInt, 48 : VarInt, 49 : VarInt, 50 : VarInt, 51 : VarInt, 52 : VarInt, 53 : VarInt, 54 : VarInt, 55 : VarInt, 56 : VarInt, 57 : VarInt, 58 : VarInt, 59 : VarInt, 60 : VarInt, 61 : VarInt, 62 : VarInt, 63 : VarInt }, None, ) ), ( 'displayName', SwitchType('action', { 32 : OptionalType(String, ), 33 : OptionalType(String, ), 34 : OptionalType(String, ), 35 : OptionalType(String, ), 36 : OptionalType(String, ), 37 : OptionalType(String, ), 38 : OptionalType(String, ), 39 : OptionalType(String, ), 40 : OptionalType(String, ), 41 : OptionalType(String, ), 42 : OptionalType(String, ), 43 : OptionalType(String, ), 44 : OptionalType(String, ), 45 : OptionalType(String, ), 46 : OptionalType(String, ), 47 : OptionalType(String, ), 48 : OptionalType(String, ), 49 : OptionalType(String, ), 50 : OptionalType(String, ), 51 : OptionalType(String, ), 52 : OptionalType(String, ), 53 : OptionalType(String, ), 54 : OptionalType(String, ), 55 : OptionalType(String, ), 56 : OptionalType(String, ), 57 : OptionalType(String, ), 58 : OptionalType(String, ), 59 : OptionalType(String, ), 60 : OptionalType(String, ), 61 : OptionalType(String, ), 62 : OptionalType(String, ), 63 : OptionalType(String, ) }, None, ) ), ), VarInt, ) ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketPlayerlistHeader(Packet): class PacketPlayerlistHeader(Packet):
__slots__ = ( 'id', 'footer', 'header' ) __slots__ = ( 'id', 'footer', 'header' )
@ -11,12 +11,12 @@ class PacketPlayerlistHeader(Packet):
footer : str footer : str
header : str header : str
def __init__(self, def __init__(self, proto:int,
footer:str | None = None, footer:str=None,
header:str | None = None, header:str=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
footer=footer, footer=footer,
header=header header=header
) )
@ -60,11 +60,7 @@ class PacketPlayerlistHeader(Packet):
751 : 83, 751 : 83,
755 : 94, 755 : 94,
756 : 94, 756 : 94,
757 : 95, 757 : 95
758 : 95,
759 : 96,
760 : 99,
761 : 97
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'header', String ), ( 'footer', String ) ], 47 : [ ( 'header', String ), ( 'footer', String ) ],
@ -103,9 +99,5 @@ class PacketPlayerlistHeader(Packet):
751 : [ ( 'header', String ), ( 'footer', String ) ], 751 : [ ( 'header', String ), ( 'footer', String ) ],
755 : [ ( 'header', String ), ( 'footer', String ) ], 755 : [ ( 'header', String ), ( 'footer', String ) ],
756 : [ ( 'header', String ), ( 'footer', String ) ], 756 : [ ( 'header', String ), ( 'footer', String ) ],
757 : [ ( 'header', String ), ( 'footer', String ) ], 757 : [ ( 'header', String ), ( 'footer', String ) ]
758 : [ ( 'header', String ), ( 'footer', String ) ],
759 : [ ( 'header', String ), ( 'footer', String ) ],
760 : [ ( 'header', String ), ( 'footer', String ) ],
761 : [ ( 'header', String ), ( 'footer', String ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketPosition(Packet): class PacketPosition(Packet):
__slots__ = ( 'id', 'dismountVehicle', 'flags', 'pitch', 'teleportId', 'x', 'y', 'yaw', 'z' ) __slots__ = ( 'id', 'dismountVehicle', 'flags', 'pitch', 'teleportId', 'x', 'y', 'yaw', 'z' )
@ -17,18 +17,18 @@ class PacketPosition(Packet):
yaw : float yaw : float
z : float z : float
def __init__(self, def __init__(self, proto:int,
dismountVehicle:bool | None = None, dismountVehicle:bool=None,
flags:int | None = None, flags:int=None,
pitch:float | None = None, pitch:float=None,
teleportId:int | None = None, teleportId:int=None,
x:float | None = None, x:float=None,
y:float | None = None, y:float=None,
yaw:float | None = None, yaw:float=None,
z:float | None = None, z:float=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
dismountVehicle=dismountVehicle, dismountVehicle=dismountVehicle,
flags=flags, flags=flags,
pitch=pitch, pitch=pitch,
@ -78,11 +78,7 @@ class PacketPosition(Packet):
751 : 52, 751 : 52,
755 : 56, 755 : 56,
756 : 56, 756 : 56,
757 : 56, 757 : 56
758 : 56,
759 : 54,
760 : 57,
761 : 56
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ) ], 47 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ) ],
@ -121,9 +117,5 @@ class PacketPosition(Packet):
751 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ) ], 751 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ) ],
755 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ], 755 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ],
756 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ], 756 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ],
757 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ], 757 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ]
758 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ],
759 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ],
760 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ],
761 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Float ), ( 'pitch', Float ), ( 'flags', Byte ), ( 'teleportId', VarInt ), ( 'dismountVehicle', Boolean ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketRelEntityMove(Packet): class PacketRelEntityMove(Packet):
__slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround' ) __slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround' )
@ -14,15 +14,15 @@ class PacketRelEntityMove(Packet):
entityId : int entityId : int
onGround : bool onGround : bool
def __init__(self, def __init__(self, proto:int,
dX:int | None = None, dX:int=None,
dY:int | None = None, dY:int=None,
dZ:int | None = None, dZ:int=None,
entityId:int | None = None, entityId:int=None,
onGround:bool | None = None, onGround:bool=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
dX=dX, dX=dX,
dY=dY, dY=dY,
dZ=dZ, dZ=dZ,
@ -69,11 +69,7 @@ class PacketRelEntityMove(Packet):
751 : 39, 751 : 39,
755 : 41, 755 : 41,
756 : 41, 756 : 41,
757 : 41, 757 : 41
758 : 41,
759 : 38,
760 : 40,
761 : 39
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'onGround', Boolean ) ], 47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'onGround', Boolean ) ],
@ -112,9 +108,5 @@ class PacketRelEntityMove(Packet):
751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ], 751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ], 755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ], 756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ], 757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ]
758 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
759 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
760 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ],
761 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'onGround', Boolean ) ]
} }

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet from ....packet import Packet
from ....definitions import *
from ....types import * from ....types import *
from ....primitives import *
class PacketRemoveEntityEffect(Packet): class PacketRemoveEntityEffect(Packet):
__slots__ = ( 'id', 'effectId', 'entityId' ) __slots__ = ( 'id', 'effectId', 'entityId' )
@ -11,12 +11,12 @@ class PacketRemoveEntityEffect(Packet):
effectId : int effectId : int
entityId : int entityId : int
def __init__(self, def __init__(self, proto:int,
effectId:int | None = None, effectId:int=None,
entityId:int | None = None, entityId:int=None,
**kwargs **kwargs
): ):
super().__init__( super().__init__(proto,
effectId=effectId, effectId=effectId,
entityId=entityId entityId=entityId
) )
@ -60,11 +60,7 @@ class PacketRemoveEntityEffect(Packet):
751 : 55, 751 : 55,
755 : 59, 755 : 59,
756 : 59, 756 : 59,
757 : 59, 757 : 59
758 : 59,
759 : 57,
760 : 60,
761 : 59
} }
_definitions : Dict[int, List[Tuple[str, Type]]] = { _definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ], 47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ],
@ -103,9 +99,5 @@ class PacketRemoveEntityEffect(Packet):
751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ], 751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ],
755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ], 755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ],
756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ], 756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ],
757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ], 757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ) ]
758 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ) ],
759 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ) ],
760 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ) ],
761 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ) ]
} }

Some files were not shown because too many files have changed in this diff Show more