Compare commits

..

34 commits
main ... dev

Author SHA1 Message Date
47bea5fa5b
docs: fix link to treepuncher repo 2024-02-20 15:58:13 +01:00
0e4d59ec51
fix: when deserializing specialize for received proto 2024-01-17 02:09:51 +01:00
f5ae50bfd7
chore: moved all source under src 2023-11-20 23:45:09 +01:00
5e570eb30f
docs: a more impressive packet 2023-11-20 23:22:36 +01:00
b3c641678a
docs: better spacing... 2023-11-20 23:19:09 +01:00
13475e65e8
docs: wording, consistency 2023-11-20 19:25:50 +01:00
338f6c91cc
docs: updated README, bumped version 2023-11-20 17:57:33 +01:00
f295e31cce
fix: remove example which doesn't apply anymore 2023-11-20 17:50:38 +01:00
eef8bf3d26
feat: harder, better, faster, stronger
changed project structure: no more useless `mc` folder
refactored dispatcher: no longer weird stateful builder pattern
improved packets: don't need proto number to be created
2023-11-20 17:36:03 +01:00
63a272858a
fix: fall back protocol if missing for current 2023-11-02 06:26:33 +01:00
51f4d09898
chore: harder, better, faster, stronger 2023-11-02 05:42:42 +01:00
c1f9f7f262
fix: working chunk parsing in 1.16.5
basically refactored it a lot and rewrote almost from scratch and needs
a lot of cleanup but holy shit it just worked and it's insane and i
wasted my night on this so i better commit it before i fuck it up
2023-11-02 04:45:03 +01:00
1712826942
Merge branch 'dev' of fantabos.co:aiocraft into dev 2023-11-01 22:10:28 +01:00
63da8ddcd5
fix: generate metadata and particles, fix switch
now entity metadata and particle data are loaded from minecraft-data and
thus should just work ™️ for all proto versions

also fixed an ugly bug in switch type about string 'true' and 'false'.
"fixed" is kind of an overstatement, more like "awfully patched hoping
it's an exception and i don't need to parse numbers too" ...
2023-11-01 22:08:52 +01:00
42a03b0e57 fix: abs for distance, limit decimal points 2023-06-02 14:26:17 +02:00
97870d0b10 fix: more lenient str parsing for dimensions 2023-03-17 10:35:59 +01:00
f0be394458 feat: allow parsing dimension from string 2023-03-17 10:34:18 +01:00
e74da435ea
fix: send Position value correctly 2023-03-16 23:01:28 +01:00
eb934a5a06 feat: added clone method to BlockPos 2023-03-16 14:11:52 +01:00
7327d4764d
feat: utility method to compare BlockPos 2023-03-15 23:01:43 +01:00
10684be970
fix: hints for VarLong 2023-03-13 23:57:18 +01:00
9567201129
fix: add proper type hint for bitfield 2023-03-13 23:42:51 +01:00
9928ea7a46
fix: double implementation for position type 2023-03-13 23:04:49 +01:00
152dda2f2c
fix: guess properly bitfield size 2023-03-13 22:57:54 +01:00
49e85d47d1
fix: just in case user is null... 2023-03-06 23:12:36 +01:00
66f0b46503
fix: metadata types sorta for 1.16.5 2023-02-16 23:58:34 +01:00
717ca56f17
fix: handle properly translatable chat msgs 2023-02-16 22:07:12 +01:00
28dac56fc7
chore: added metadata types and particles 2023-02-16 22:06:52 +01:00
46b10711f9
fix: wrong if logic! false != -1 is true 2023-02-16 18:55:05 +01:00
cef2fe19ee
fix: add code field to legacy auth
means nothing but makes the logic just work
2023-02-16 18:43:01 +01:00
e3bde342d3
fix: protocol is weird 2023-02-16 18:42:46 +01:00
d6e5e7a6f6
fix: use definitions from previous protocols
It's not really elegant but it works. If a definition is missing, it's
likely because it's unchanged since last revision
2023-02-16 18:42:36 +01:00
6448e7bad4
build: recompiled proto with newer versions
still this should happen on the user machine and not in our repo!
2023-02-16 18:26:14 +01:00
2190554f71
feat: allow overriding auth and session servers 2023-02-16 18:07:21 +01:00
247 changed files with 4870 additions and 2900 deletions

View file

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

View file

@ -1,2 +1,46 @@
# aiocraft
An asyncio-driven headless client library for block game
**an asyncio-driven headless client library for block game with packet definitions**
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

View file

@ -1,12 +0,0 @@
"""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,2 +0,0 @@
from .packet import Packet
from .definitions import *

View file

@ -1,275 +0,0 @@
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

@ -1,71 +0,0 @@
"""[!] 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

@ -1,109 +0,0 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
class PacketScoreboardScore(Packet):
__slots__ = ( 'id', 'action', 'itemName', 'scoreName', 'value' )
action : int
itemName : str
scoreName : str
value : Union[None, int]
def __init__(self, proto:int,
action:int=None,
itemName:str=None,
scoreName:str=None,
value:Union[None, int]=None,
**kwargs
):
super().__init__(proto,
action=action,
itemName=itemName,
scoreName=scoreName,
value=value
)
_state : int = 3
_ids : Dict[int, int] = {
47 : 60,
76 : 65,
107 : 66,
108 : 66,
109 : 66,
110 : 66,
201 : 66,
210 : 66,
304 : 66,
315 : 66,
321 : 68,
327 : 68,
331 : 68,
335 : 68,
338 : 69,
340 : 69,
351 : 70,
393 : 72,
401 : 72,
402 : 72,
403 : 72,
404 : 72,
477 : 76,
480 : 76,
490 : 76,
498 : 76,
573 : 77,
575 : 77,
578 : 77,
709 : 78,
734 : 77,
735 : 77,
736 : 77,
751 : 77,
755 : 86,
756 : 86,
757 : 86
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
76 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
107 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
108 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
109 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
110 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
201 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
210 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
304 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
315 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
321 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
327 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
331 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
335 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
338 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
340 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
351 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
393 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
401 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
402 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
403 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
404 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
477 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
480 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
490 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
498 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
573 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
575 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
578 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
709 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
734 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
735 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
736 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
751 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
755 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
756 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ],
757 : [ ( 'itemName', String ), ( 'action', Byte ), ( 'scoreName', String ), ( 'value', SwitchType('action', { 1 : Void }, VarInt, ) ) ]
}

View file

@ -1,106 +0,0 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
class PacketBlockDig(Packet):
__slots__ = ( 'id', 'face', 'location', 'status' )
face : int
location : tuple
status : int
def __init__(self, proto:int,
face:int=None,
location:tuple=None,
status:int=None,
**kwargs
):
super().__init__(proto,
face=face,
location=location,
status=status
)
_state : int = 3
_ids : Dict[int, int] = {
47 : 7,
76 : 16,
107 : 19,
108 : 19,
109 : 19,
110 : 19,
201 : 19,
210 : 19,
304 : 19,
315 : 19,
321 : 20,
327 : 20,
331 : 20,
335 : 20,
338 : 20,
340 : 20,
351 : 20,
393 : 24,
401 : 24,
402 : 24,
403 : 24,
404 : 24,
477 : 26,
480 : 26,
490 : 26,
498 : 26,
573 : 26,
575 : 26,
578 : 26,
709 : 26,
734 : 27,
735 : 27,
736 : 27,
751 : 27,
755 : 26,
756 : 26,
757 : 26
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
76 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
107 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
108 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
109 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
110 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
201 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
210 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
304 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
315 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
321 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
327 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
331 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
335 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
338 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
340 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
351 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
393 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
401 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
402 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
403 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
404 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
477 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
480 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
490 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
498 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
573 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
575 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
578 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
709 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
734 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
735 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
736 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
751 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
755 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
756 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ],
757 : [ ( 'status', Byte ), ( 'location', Position ), ( 'face', Byte ) ]
}

View file

@ -5,10 +5,7 @@ import keyword
import logging
from pathlib import Path
from typing import Tuple, List, Dict, Union, Set, Type as Class
from aiocraft.mc.types import *
from aiocraft.mc.definitions import Item
from typing import Any
# TODO de-spaghetti this file sometime!
@ -16,8 +13,8 @@ DIR_MAP = {"toClient": "clientbound", "toServer": "serverbound"}
PREFACE = """\"\"\"[!] This file is autogenerated\"\"\"\n\n"""
IMPORTS = """from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *\n"""
from ....types import *
from ....primitives import *\n"""
IMPORT_ALL = """__all__ = [\n\t{all}\n]\n"""
REGISTRY_ENTRY = """
REGISTRY = {entries}\n"""
@ -26,8 +23,8 @@ class {name}(Packet):
__slots__ = {slots}
{fields}
def __init__(self, proto:int,{constructor}):
super().__init__(proto,{constructed})
def __init__(self, {constructor}):
super().__init__({constructed})
_state : int = {state}
@ -35,6 +32,15 @@ class {name}(Packet):
_definitions : Dict[int, List[Tuple[str, Type]]] = {definitions}
"""
EXT_FORMATTER = """from ..types import *
class MetadataDefinitions:
_definitions: dict[int, dict[int, Type]] = {metadata}
class ParticlesDefinitions:
_definitions: dict[int, dict[int, Type]] = {particles}
"""
class Ref:
name : str
args : tuple
@ -71,6 +77,7 @@ class Ref:
TYPE_MAP = {
"varint": Ref('VarInt'),
"varlong": Ref('VarLong'),
"u8": Ref('Byte'),
"i8": Ref('Byte'),
"u16": Ref('UnsignedShort'),
@ -96,6 +103,7 @@ TYPE_MAP = {
HINT_MAP = {
"varint": 'int',
"varlong": 'int',
"u8": 'int',
"i8": 'int',
"u16": 'int',
@ -133,7 +141,7 @@ def format_dict(d:dict, depth:int=1) -> str:
def format_list(l:list, depth:int=0) -> str:
return "[" + _format_line(l, depth) + "]"
def format_tuple(l:list, depth:int=0) -> str:
def format_tuple(l:tuple | list, depth:int=0) -> str:
return "(" + _format_line(l, depth) + ")"
def mctype(slot_type:Any) -> Ref:
@ -162,7 +170,13 @@ def mctype(slot_type:Any) -> Ref:
mctype(v["default"]) if "default" in v and v['default'] != 'void' else None,
)
elif t == "bitfield":
return Ref('Int') # TODO
# TODO can be made better...
size = 0
for field in v:
size += field["size"]
if size <= 32:
return Ref('Int')
return Ref('Long')
# elif t == "mapper": # ????
# return TrailingData
else:
@ -191,6 +205,8 @@ def mchint(slot_type:Any) -> Ref:
else:
possibilities.add(Ref('None'))
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
elif t == "bitfield":
return Ref('int')
# elif t == "mapper": # ????
# return TrailingData
logging.error("Unknown type %s, using 'bytes' as hint", str(slot_type))
@ -221,11 +237,11 @@ def snake_to_camel(name:str) -> str:
class PacketClassWriter:
name : str
attrs : Set[str]
types : Dict[str, List[Type]]
hints : Dict[str, List[Type]]
ids : Dict[int, int]
definitions : Dict[int, List[Tuple[str, Type]]]
attrs : set[str]
types : dict[str, set[Ref]]
hints : dict[str, set[Ref]]
ids : dict[int, int]
definitions : dict[int, list[tuple[str, Ref]]]
state : int
def __init__(self, pkt:dict, state:int):
@ -243,7 +259,7 @@ class PacketClassWriter:
if "name" not in field:
logging.error("Skipping anonymous field %s", str(field))
continue
field_name = field["name"] if not keyword.iskeyword(field["name"]) else "is_" + field["name"]
field_name : str = field["name"] if not keyword.iskeyword(field["name"]) else "is_" + field["name"]
self.attrs.add(field_name)
self.definitions[v].append((field_name, mctype(field["type"])))
if field_name not in self.types:
@ -259,11 +275,11 @@ class PacketClassWriter:
OBJECT.format(
name=self.name,
ids=format_dict(self.ids, depth=2),
definitions=format_dict({ k : Ref(format_list(Ref(format_tuple(x)) for x in v)) for k,v in self.definitions.items() }, depth=2),
definitions=format_dict({ k : Ref(format_list([Ref(format_tuple(x)) for x in v])) for k,v in self.definitions.items() }, depth=2),
slots=format_tuple(["id"] + sorted(self.attrs), depth=0), # TODO jank fix when no slots
fields="\n\t" + "\n\t".join(f"{a} : {pytype(sorted(self.hints[a]))}" for a in sorted(self.attrs)),
state=self.state,
constructor=_format_line([Ref(f"{field}:{pytype(sorted(self.hints[field]))}=None") for field in sorted(self.attrs)] + [Ref("**kwargs")], depth=2),
constructor=_format_line([Ref(f"{field}:{pytype(sorted(self.hints[field]))} | None = None") for field in sorted(self.attrs)] + [Ref("**kwargs")], depth=2),
constructed=_format_line((Ref(f"{field}={field}") for field in sorted(self.attrs)), depth=3),
)
@ -303,7 +319,7 @@ def compile():
from urllib.request import urlretrieve
base_path = Path(os.getcwd())
mc_path = base_path / 'aiocraft' / 'mc'
mc_path = base_path / 'aiocraft'
# Retrieve proto definitions from PrismarineJS/minecraft-data
urlretrieve("https://github.com/PrismarineJS/minecraft-data/zipball/master", mc_path / "minecraft-data.zip")
@ -336,6 +352,9 @@ def compile():
}
}
METADATA = {}
PARTICLES = {}
all_versions = os.listdir(mc_path / f'{folder_name}/data/pc/')
all_versions.remove("common")
all_proto_numbers = []
@ -350,14 +369,23 @@ def compile():
with open(mc_path / f'{folder_name}/data/pc/{v}/version.json') as f:
proto_version = json.load(f)['version']
if proto_version < 47 or proto_version > 1000:
continue # avoid versions before 1.8
if proto_version < 47 or proto_version > 761:
continue # avoid versions before 1.8 and past 1.19
all_proto_numbers.append(proto_version)
with open(mc_path / f'{folder_name}/data/pc/{v}/protocol.json') as f:
data = json.load(f)
METADATA[proto_version] = {}
for meta_id, meta_type in data["types"]["entityMetadataItem"][1]["fields"].items():
METADATA[proto_version][int(meta_id)] = mctype(meta_type)
if "particleData" in data["types"]:
PARTICLES[proto_version] = {}
for p_id, p_type in data["types"]["particleData"][1]["fields"].items():
PARTICLES[proto_version][int(p_id)] = mctype(p_type)
# Build data structure containing all packets with all their definitions for different versions
for state in ("handshaking", "status", "login", "play"):
for _direction in ("toClient", "toServer"):
@ -392,6 +420,15 @@ def compile():
_STATE_MAP = {"handshaking": 0, "status":1, "login":2, "play":3}
_make_module(mc_path / 'proto', { k:"*" for k in PACKETS.keys() })
with open(mc_path / 'proto' / 'ext.py', 'w') as f:
f.write(
EXT_FORMATTER.format(
metadata = format_dict(METADATA, depth=2),
particles = format_dict(PARTICLES, depth=2),
)
)
for state in PACKETS.keys():
_make_module(mc_path / f"proto/{state}", { k:"*" for k in PACKETS[state].keys() })
for direction in PACKETS[state].keys():

View file

@ -1,22 +0,0 @@
"""
A super simple MinecraftClient exmaple.
Will connect to a server and print chat messages.
Requires an authorization code to login
"""
import sys
from aiocraft.client import MinecraftClient
from aiocraft.mc.proto import PacketChat
from aiocraft.util.helpers import parse_chat
server = sys.argv[1]
login_code = sys.argv[2] # Check authenticator.py example
app = MinecraftClient(server, login_code=login_code)
@app.on_packet(PacketChat)
async def on_chat(packet: PacketChat):
print(parse_chat(packet.message, ansi_color=True))
app.run()

View file

@ -4,7 +4,6 @@ build-backend = "maturin"
[project]
name = "aiocraft"
version = "0.1.0"
authors = [
{ email = "me@alemi.dev", name = "alemi"},
{ email = "francescotolomei@mail.com", name = "f-tml" },
@ -30,6 +29,7 @@ classifiers = [
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["python", "rust", "mc", "minecraft", "protocol", "async", "asyncio", "definitions"]
dynamic = ["version"]
dependencies = [
"pynbt",

11
src/aiocraft/__init__.py Normal file
View file

@ -0,0 +1,11 @@
"""aiocraft is an asyncio-driven headless minecraft client"""
from .client import AbstractMinecraftClient
from .server import AbstractMinecraftServer
from .types import *
from .auth import MicrosoftAuthenticator, MojangAuthenticator
from .aiocraft import * # TODO why does PyO3 use the Cargo package name as top level name too??
__author__ = "alemidev"
__credits__ = "Thanks to pyCraft, really inspired this"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,17 +1,16 @@
import io
import struct
import asyncio
import json
import uuid
import logging
import pynbt
from typing import List, Tuple, Dict, Any, Union, Optional, Callable, Type as Class
from typing import List, Tuple, Dict, Any, Union, Optional, Callable
from .definitions import Item
from .types import Item
class Context(object):
class Context:
def __init__(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
@ -29,7 +28,7 @@ class Context(object):
values = ( f"{k}={repr(v)}" for k,v in vars(self).items() )
return f"Context({', '.join(values)})"
class Type(object):
class Type:
pytype : Union[type, Callable] = lambda x : x
def write(self, data:Any, buffer:io.BytesIO, ctx:Context) -> None:
@ -113,10 +112,11 @@ class NBTType(Type):
pynbt.NBTFile(value=data).save(buffer)
def read(self, buffer:io.BytesIO, ctx:Context) -> Optional[dict]:
index = buffer.tell()
head = Byte.read(buffer, ctx)
if head == 0x0:
return None
buffer.seek(-1,1) # go back 1 byte
buffer.seek(index) # go back to start and read again
return nbt_to_py(pynbt.NBTFile(io=buffer))
NBTTag = NBTType()
@ -216,20 +216,32 @@ class PositionType(Type):
pytype : type = tuple
MAX_SIZE : int = 8
# TODO THIS IS FOR 1.12.2!!! Make a generic version-less?
def write(self, data:tuple, buffer:io.BytesIO, ctx:Context):
if ctx._proto <= 441:
packed = ((0x3FFFFFF & data[0]) << 38) \
| ((0xFFF & data[1]) << 26) \
| (0x3FFFFFF & data[2])
UnsignedLong.write(packed, buffer, ctx=ctx)
else:
packed = ((0x3FFFFFF & data[0]) << 38) \
| ((0x3FFFFFF & data[2]) << 12) \
| (0xFFF & data[1])
UnsignedLong.write(packed, buffer, ctx=ctx)
pass
def read(self, buffer:io.BytesIO, ctx:Context) -> tuple:
if ctx._proto <= 441:
packed = UnsignedLong.read(buffer, ctx)
x = twos_comp(packed >> 38, 26)
y = (packed >> 26) & 0xFFF
z = twos_comp(packed & 0x3FFFFFF, 26)
return (x, y, z)
else:
packed = UnsignedLong.read(buffer, ctx)
x = twos_comp(packed >> 38, 26)
z = twos_comp((packed >> 12) & 0x3FFFFFF, 26)
y = packed & 0xFFF
return (x, y, z)
Position = PositionType()
@ -290,10 +302,20 @@ class SwitchType(Type):
field : str
mappings : Dict[Any, Type]
def __init__(self, watch:str, mappings:Dict[Any, Type], default:Type = None):
def __init__(self, watch:str, mappings:Dict[Any, Type], default:Type | None = None):
self.field = watch
self.mappings = mappings
self.default = default
# TODO AWFUL FIX, probably because json is weird
self.mappings = {}
for k, v in mappings.items():
if k == 'true':
self.mappings[True] = v
elif k == 'false':
self.mappings[False] = v
else:
# TODO probably breaks for numbers too?
self.mappings[k] = v
# TODO AWFUL FIX, probably because json is weird
def write(self, data:Any, buffer:io.BytesIO, ctx:Context):
watched = getattr(ctx, self.field, None)
@ -346,7 +368,7 @@ class SlotType(Type):
new_way = ctx._proto > 340
check_type = Boolean if new_way else Short
val = check_type.read(buffer, ctx)
if (new_way and val) or val != -1:
if (new_way and val) or (not new_way and val != -1):
if new_way:
slot["id"] = VarInt.read(buffer, ctx)
else:
@ -359,45 +381,29 @@ class SlotType(Type):
Slot = SlotType()
# wiki.vg does not document these anymore. Minecraft 1.12.2 has these as metadata types
_ENTITY_METADATA_TYPES = {
0 : Byte,
1 : VarInt,
2 : Float,
3 : String,
4 : Chat,
5 : Slot,
6 : Boolean,
7 : StructType(("x", Float), ("y", Float), ("z", Float)), # Rotation
8 : Position,
9 : OptionalType(Position),
10 : VarInt, # Direction (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
11 : OptionalType(UUID),
12 : VarInt, # OptBlockID (VarInt) 0 for absent (implies air); otherwise, a block state ID as per the global palette
13 : NBTTag,
}
class ParticleType(Type):
pytype : type = dict
def write(self, data:dict, buffer:io.BytesIO, ctx:Context):
raise NotImplementedError
# TODO this changes across versions!
def read(self, data:dict, buffer:io.BytesIO, ctx:Context):
from aiocraft.proto.ext import ParticlesDefinitions
proto = ctx._proto
while proto not in ParticlesDefinitions._definitions:
proto -= 1
data_id = VarInt.read(buffer, ctx)
if data_id in ParticlesDefinitions._definitions[proto]:
t = ParticlesDefinitions._definitions[proto][data_id]
data = t.read(buffer, ctx)
data["id"] = data_id
else:
data = {"id": data_id}
return data
Particle = ParticleType()
_ENTITY_METADATA_TYPES_NEW = {
0 : Byte,
1 : VarInt,
2 : Float,
3 : String,
4 : Chat,
5 : OptionalType(Chat), # Chat is present if the Boolean is set to true
6 : Slot,
7 : Boolean,
8 : StructType(("x", Float), ("y", Float), ("z", Float)), # Rotation
9 : Position,
10 : OptionalType(Position),
11 : VarInt, # Direction (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
12 : OptionalType(UUID),
13 : VarInt, # OptBlockID (VarInt) 0 for absent (implies air); otherwise, a block state ID as per the global palette
14 : NBTTag,
15 : TrailingData, # Particle, # TODO!
16 : StructType(("type", VarInt), ("profession", VarInt), ("level", VarInt)), # Villager Data
17 : OptionalType(VarInt), # Used for entity IDs.
18 : VarInt, # Pose 0: STANDING, 1: FALL_FLYING, 2: SLEEPING, 3: SWIMMING, 4: SPIN_ATTACK, 5: SNEAKING, 6: LONG_JUMPING, 7: DYING
}
class EntityMetadataType(Type):
pytype : type = dict
@ -407,7 +413,11 @@ class EntityMetadataType(Type):
buffer.write(b'\xFF')
def read(self, buffer:io.BytesIO, ctx:Context) -> Dict[int, Any]:
types_map = _ENTITY_METADATA_TYPES_NEW if ctx._proto > 340 else _ENTITY_METADATA_TYPES
from aiocraft.proto.ext import MetadataDefinitions
proto = ctx._proto
while proto not in MetadataDefinitions._definitions:
proto -= 1
types_map = MetadataDefinitions._definitions[proto]
out : Dict[int, Any] = {}
while True:
index = UnsignedByte.read(buffer, ctx)

74
src/aiocraft/proto/ext.py Normal file
View file

@ -0,0 +1,74 @@
from ..primitives import *
class MetadataDefinitions:
_definitions: dict[int, dict[int, Type]] = {
47 : {0: Byte, 1: Short, 2: Int, 3: Float, 4: String, 5: Slot, 6: StructType(( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ), 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), )},
76 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
107 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
108 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
109 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
110 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
201 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
210 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
304 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
315 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt},
321 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
327 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
331 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
335 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
338 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
340 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
351 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: Slot, 6: Boolean, 7: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 8: Position, 9: OptionalType(Position, ), 10: VarInt, 11: OptionalType(UUID, ), 12: VarInt, 13: NBTTag},
393 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData},
401 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData},
402 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData},
403 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData},
404 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData},
477 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
480 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
490 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
498 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
573 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
575 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
578 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
709 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
734 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
735 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
736 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
751 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
755 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
756 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
757 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
758 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
759 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt},
760 : {0: Byte, 1: VarInt, 2: Float, 3: String, 4: String, 5: OptionalType(String, ), 6: Slot, 7: Boolean, 8: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 9: Position, 10: OptionalType(Position, ), 11: VarInt, 12: OptionalType(UUID, ), 13: VarInt, 14: NBTTag, 15: TrailingData, 16: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 17: TrailingData, 18: VarInt, 19: VarInt, 20: VarInt, 21: OptionalType(String, ), 22: VarInt},
761 : {0: Byte, 1: VarInt, 2: VarLong, 3: Float, 4: String, 5: String, 6: OptionalType(String, ), 7: Slot, 8: Boolean, 9: StructType(( 'pitch', Float ), ( 'yaw', Float ), ( 'roll', Float ), ), 10: Position, 11: OptionalType(Position, ), 12: VarInt, 13: OptionalType(UUID, ), 14: VarInt, 15: NBTTag, 16: TrailingData, 17: StructType(( 'villagerType', VarInt ), ( 'villagerProfession', VarInt ), ( 'level', VarInt ), ), 18: TrailingData, 19: VarInt, 20: VarInt, 21: VarInt, 22: OptionalType(String, ), 23: VarInt}
}
class ParticlesDefinitions:
_definitions: dict[int, dict[int, Type]] = {
393 : {3: StructType(( 'blockState', VarInt ), ), 11: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 20: StructType(( 'blockState', VarInt ), ), 27: StructType(( 'item', Slot ), )},
401 : {3: StructType(( 'blockState', VarInt ), ), 11: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 20: StructType(( 'blockState', VarInt ), ), 27: StructType(( 'item', Slot ), )},
402 : {3: StructType(( 'blockState', VarInt ), ), 11: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 20: StructType(( 'blockState', VarInt ), ), 27: StructType(( 'item', Slot ), )},
403 : {3: StructType(( 'blockState', VarInt ), ), 11: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 20: StructType(( 'blockState', VarInt ), ), 27: StructType(( 'item', Slot ), )},
404 : {3: StructType(( 'blockState', VarInt ), ), 11: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 20: StructType(( 'blockState', VarInt ), ), 27: StructType(( 'item', Slot ), )},
477 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
480 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
490 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
498 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
573 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
575 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
578 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 32: StructType(( 'item', Slot ), )},
709 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 34: StructType(( 'item', Slot ), )},
734 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 34: StructType(( 'item', Slot ), )},
735 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 34: StructType(( 'item', Slot ), )},
736 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 34: StructType(( 'item', Slot ), )},
751 : {3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 23: StructType(( 'blockState', VarInt ), ), 34: StructType(( 'item', Slot ), )},
755 : {4: StructType(( 'blockState', VarInt ), ), 15: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 16: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 25: StructType(( 'blockState', VarInt ), ), 36: StructType(( 'item', Slot ), ), 37: StructType(( 'origin', Position ), ( 'positionType', String ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), )},
756 : {4: StructType(( 'blockState', VarInt ), ), 15: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 16: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 25: StructType(( 'blockState', VarInt ), ), 36: StructType(( 'item', Slot ), ), 37: StructType(( 'origin', Position ), ( 'positionType', String ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), )},
757 : {2: StructType(( 'blockState', VarInt ), ), 3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 15: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 24: StructType(( 'blockState', VarInt ), ), 35: StructType(( 'item', Slot ), ), 36: StructType(( 'origin', Position ), ( 'positionType', String ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), )},
758 : {2: StructType(( 'blockState', VarInt ), ), 3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 15: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 24: StructType(( 'blockState', VarInt ), ), 35: StructType(( 'item', Slot ), ), 36: StructType(( 'origin', Position ), ( 'positionType', String ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), )},
759 : {2: StructType(( 'blockState', VarInt ), ), 3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 15: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 25: StructType(( 'blockState', VarInt ), ), 30: StructType(( 'rotation', Float ), ), 39: StructType(( 'item', Slot ), ), 40: StructType(( 'positionType', String ), ( 'entityId', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'entityEyeHeight', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), ), 92: StructType(( 'delayInTicksBeforeShown', VarInt ), )},
760 : {2: StructType(( 'blockState', VarInt ), ), 3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 15: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 25: StructType(( 'blockState', VarInt ), ), 30: StructType(( 'rotation', Float ), ), 39: StructType(( 'item', Slot ), ), 40: StructType(( 'positionType', String ), ( 'entityId', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'entityEyeHeight', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), ), 92: StructType(( 'delayInTicksBeforeShown', VarInt ), )},
761 : {2: StructType(( 'blockState', VarInt ), ), 3: StructType(( 'blockState', VarInt ), ), 14: StructType(( 'red', Float ), ( 'green', Float ), ( 'blue', Float ), ( 'scale', Float ), ), 15: StructType(( 'fromRed', Float ), ( 'fromGreen', Float ), ( 'fromBlue', Float ), ( 'scale', Float ), ( 'toRed', Float ), ( 'toGreen', Float ), ( 'toBlue', Float ), ), 25: StructType(( 'blockState', VarInt ), ), 30: StructType(( 'rotation', Float ), ), 39: StructType(( 'item', Slot ), ), 40: StructType(( 'positionType', String ), ( 'entityId', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'entityEyeHeight', SwitchType('positionType', { 'minecraft:entity' : VarInt }, None, ) ), ( 'destination', SwitchType('positionType', { 'minecraft:block' : Position, 'minecraft:entity' : VarInt }, None, ) ), ( 'ticks', VarInt ), ), 92: StructType(( 'delayInTicksBeforeShown', VarInt ), )}
}

View file

@ -40,5 +40,9 @@ REGISTRY = {
751 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
755 : { 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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketLegacyServerListPing(Packet):
__slots__ = ( 'id', 'payload' )
payload : int
def __init__(self, proto:int,
payload:int=None,
def __init__(self,
payload:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
payload=payload
)
@ -57,7 +57,11 @@ class PacketLegacyServerListPing(Packet):
751 : 254,
755 : 254,
756 : 254,
757 : 254
757 : 254,
758 : 254,
759 : 254,
760 : 254,
761 : 254
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'payload', Byte ) ],
@ -96,5 +100,9 @@ class PacketLegacyServerListPing(Packet):
751 : [ ( 'payload', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketSetProtocol(Packet):
__slots__ = ( 'id', 'nextState', 'protocolVersion', 'serverHost', 'serverPort' )
@ -13,14 +13,14 @@ class PacketSetProtocol(Packet):
serverHost : str
serverPort : int
def __init__(self, proto:int,
nextState:int=None,
protocolVersion:int=None,
serverHost:str=None,
serverPort:int=None,
def __init__(self,
nextState:int | None = None,
protocolVersion:int | None = None,
serverHost:str | None = None,
serverPort:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
nextState=nextState,
protocolVersion=protocolVersion,
serverHost=serverHost,
@ -66,7 +66,11 @@ class PacketSetProtocol(Packet):
751 : 0,
755 : 0,
756 : 0,
757 : 0
757 : 0,
758 : 0,
759 : 0,
760 : 0,
761 : 0
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
@ -105,5 +109,9 @@ class PacketSetProtocol(Packet):
751 : [ ( '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 ) ],
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,5 +43,9 @@ REGISTRY = {
751 : { 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 },
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCompress(Packet):
__slots__ = ( 'id', 'threshold' )
threshold : int
def __init__(self, proto:int,
threshold:int=None,
def __init__(self,
threshold:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
threshold=threshold
)
@ -57,7 +57,11 @@ class PacketCompress(Packet):
751 : 3,
755 : 3,
756 : 3,
757 : 3
757 : 3,
758 : 3,
759 : 3,
760 : 3,
761 : 3
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'threshold', VarInt ) ],
@ -96,5 +100,9 @@ class PacketCompress(Packet):
751 : [ ( 'threshold', VarInt ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketDisconnect(Packet):
__slots__ = ( 'id', 'reason' )
reason : str
def __init__(self, proto:int,
reason:str=None,
def __init__(self,
reason:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
reason=reason
)
@ -57,7 +57,11 @@ class PacketDisconnect(Packet):
751 : 0,
755 : 0,
756 : 0,
757 : 0
757 : 0,
758 : 0,
759 : 0,
760 : 0,
761 : 0
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'reason', String ) ],
@ -96,5 +100,9 @@ class PacketDisconnect(Packet):
751 : [ ( 'reason', String ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEncryptionBegin(Packet):
__slots__ = ( 'id', 'publicKey', 'serverId', 'verifyToken' )
@ -12,13 +12,13 @@ class PacketEncryptionBegin(Packet):
serverId : str
verifyToken : bytes
def __init__(self, proto:int,
publicKey:bytes=None,
serverId:str=None,
verifyToken:bytes=None,
def __init__(self,
publicKey:bytes | None = None,
serverId:str | None = None,
verifyToken:bytes | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
publicKey=publicKey,
serverId=serverId,
verifyToken=verifyToken
@ -63,7 +63,11 @@ class PacketEncryptionBegin(Packet):
751 : 1,
755 : 1,
756 : 1,
757 : 1
757 : 1,
758 : 1,
759 : 1,
760 : 1,
761 : 1
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
@ -102,5 +106,9 @@ class PacketEncryptionBegin(Packet):
751 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketLoginPluginRequest(Packet):
__slots__ = ( 'id', 'channel', 'data', 'messageId' )
@ -12,13 +12,13 @@ class PacketLoginPluginRequest(Packet):
data : bytes
messageId : int
def __init__(self, proto:int,
channel:str=None,
data:bytes=None,
messageId:int=None,
def __init__(self,
channel:str | None = None,
data:bytes | None = None,
messageId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
channel=channel,
data=data,
messageId=messageId
@ -46,7 +46,11 @@ class PacketLoginPluginRequest(Packet):
751 : 4,
755 : 4,
756 : 4,
757 : 4
757 : 4,
758 : 4,
759 : 4,
760 : 4,
761 : 4
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
@ -68,5 +72,9 @@ class PacketLoginPluginRequest(Packet):
751 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
755 : [ ( '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,21 +2,24 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketSuccess(Packet):
__slots__ = ( 'id', 'username', 'uuid' )
__slots__ = ( 'id', 'properties', 'username', 'uuid' )
properties : list
username : str
uuid : str
def __init__(self, proto:int,
username:str=None,
uuid:str=None,
def __init__(self,
properties:list | None = None,
username:str | None = None,
uuid:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
properties=properties,
username=username,
uuid=uuid
)
@ -60,7 +63,11 @@ class PacketSuccess(Packet):
751 : 2,
755 : 2,
756 : 2,
757 : 2
757 : 2,
758 : 2,
759 : 2,
760 : 2,
761 : 2
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'uuid', String ), ( 'username', String ) ],
@ -99,5 +106,9 @@ class PacketSuccess(Packet):
751 : [ ( 'uuid', UUID ), ( 'username', String ) ],
755 : [ ( '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,5 +41,9 @@ REGISTRY = {
751 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
755 : { 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,21 +2,27 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEncryptionBegin(Packet):
__slots__ = ( 'id', 'sharedSecret', 'verifyToken' )
__slots__ = ( 'id', 'crypto', 'hasVerifyToken', 'sharedSecret', 'verifyToken' )
crypto : Union[None, dict]
hasVerifyToken : bool
sharedSecret : bytes
verifyToken : bytes
def __init__(self, proto:int,
sharedSecret:bytes=None,
verifyToken:bytes=None,
def __init__(self,
crypto:Union[None, dict] | None = None,
hasVerifyToken:bool | None = None,
sharedSecret:bytes | None = None,
verifyToken:bytes | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
crypto=crypto,
hasVerifyToken=hasVerifyToken,
sharedSecret=sharedSecret,
verifyToken=verifyToken
)
@ -60,7 +66,11 @@ class PacketEncryptionBegin(Packet):
751 : 1,
755 : 1,
756 : 1,
757 : 1
757 : 1,
758 : 1,
759 : 1,
760 : 1,
761 : 1
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
@ -99,5 +109,9 @@ class PacketEncryptionBegin(Packet):
751 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketLoginPluginResponse(Packet):
__slots__ = ( 'id', 'data', 'messageId' )
@ -11,12 +11,12 @@ class PacketLoginPluginResponse(Packet):
data : tuple
messageId : int
def __init__(self, proto:int,
data:tuple=None,
messageId:int=None,
def __init__(self,
data:tuple | None = None,
messageId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
data=data,
messageId=messageId
)
@ -43,7 +43,11 @@ class PacketLoginPluginResponse(Packet):
751 : 2,
755 : 2,
756 : 2,
757 : 2
757 : 2,
758 : 2,
759 : 2,
760 : 2,
761 : 2
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
393 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
@ -65,5 +69,9 @@ class PacketLoginPluginResponse(Packet):
751 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
755 : [ ( '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,19 +2,25 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketLoginStart(Packet):
__slots__ = ( 'id', 'username' )
__slots__ = ( 'id', 'playerUUID', 'signature', 'username' )
playerUUID : tuple
signature : tuple
username : str
def __init__(self, proto:int,
username:str=None,
def __init__(self,
playerUUID:tuple | None = None,
signature:tuple | None = None,
username:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
playerUUID=playerUUID,
signature=signature,
username=username
)
@ -57,7 +63,11 @@ class PacketLoginStart(Packet):
751 : 0,
755 : 0,
756 : 0,
757 : 0
757 : 0,
758 : 0,
759 : 0,
760 : 0,
761 : 0
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'username', String ) ],
@ -96,5 +106,9 @@ class PacketLoginStart(Packet):
751 : [ ( 'username', String ) ],
755 : [ ( '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,7 +118,18 @@ from .packet_set_title_subtitle import PacketSetTitleSubtitle
from .packet_set_title_text import PacketSetTitleText
from .packet_set_title_time import PacketSetTitleTime
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_profileless_chat import PacketProfilelessChat
from .packet_player_remove import PacketPlayerRemove
from .packet_feature_flags import PacketFeatureFlags
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 },
@ -157,5 +168,9 @@ 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 },
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 },
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAbilities(Packet):
__slots__ = ( 'id', 'flags', 'flyingSpeed', 'walkingSpeed' )
@ -12,13 +12,13 @@ class PacketAbilities(Packet):
flyingSpeed : float
walkingSpeed : float
def __init__(self, proto:int,
flags:int=None,
flyingSpeed:float=None,
walkingSpeed:float=None,
def __init__(self,
flags:int | None = None,
flyingSpeed:float | None = None,
walkingSpeed:float | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
flags=flags,
flyingSpeed=flyingSpeed,
walkingSpeed=walkingSpeed
@ -63,7 +63,11 @@ class PacketAbilities(Packet):
751 : 48,
755 : 50,
756 : 50,
757 : 50
757 : 50,
758 : 50,
759 : 47,
760 : 49,
761 : 48
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
@ -102,5 +106,9 @@ class PacketAbilities(Packet):
751 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
755 : [ ( '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,27 +2,30 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAcknowledgePlayerDigging(Packet):
__slots__ = ( 'id', 'block', 'location', 'status', 'successful' )
__slots__ = ( 'id', 'block', 'location', 'sequenceId', 'status', 'successful' )
block : int
location : tuple
sequenceId : int
status : int
successful : bool
def __init__(self, proto:int,
block:int=None,
location:tuple=None,
status:int=None,
successful:bool=None,
def __init__(self,
block:int | None = None,
location:tuple | None = None,
sequenceId:int | None = None,
status:int | None = None,
successful:bool | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
block=block,
location=location,
sequenceId=sequenceId,
status=status,
successful=successful
)
@ -41,7 +44,11 @@ class PacketAcknowledgePlayerDigging(Packet):
751 : 7,
755 : 8,
756 : 8,
757 : 8
757 : 8,
758 : 8,
759 : 5,
760 : 5,
761 : 5
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
498 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
@ -55,5 +62,9 @@ class PacketAcknowledgePlayerDigging(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketActionBar(Packet):
__slots__ = ( 'id', 'text' )
text : str
def __init__(self, proto:int,
text:str=None,
def __init__(self,
text:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
text=text
)
@ -23,10 +23,18 @@ class PacketActionBar(Packet):
_ids : Dict[int, int] = {
755 : 65,
756 : 65,
757 : 65
757 : 65,
758 : 65,
759 : 64,
760 : 67,
761 : 66
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAdvancementProgress(Packet):
__slots__ = ( 'id', 'id' )
id : tuple
def __init__(self, proto:int,
id:tuple=None,
def __init__(self,
id:tuple | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
id=id
)

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAdvancements(Packet):
__slots__ = ( 'id', 'advancementMapping', 'identifiers', 'progressMapping', 'reset' )
@ -13,14 +13,14 @@ class PacketAdvancements(Packet):
progressMapping : list
reset : bool
def __init__(self, proto:int,
advancementMapping:list=None,
identifiers:list=None,
progressMapping:list=None,
reset:bool=None,
def __init__(self,
advancementMapping:list | None = None,
identifiers:list | None = None,
progressMapping:list | None = None,
reset:bool | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
advancementMapping=advancementMapping,
identifiers=identifiers,
progressMapping=progressMapping,
@ -56,7 +56,11 @@ class PacketAdvancements(Packet):
751 : 87,
755 : 98,
756 : 98,
757 : 99
757 : 99,
758 : 99,
759 : 100,
760 : 103,
761 : 101
}
_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, ) ) ],
@ -85,5 +89,9 @@ 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, ) ) ],
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAnimation(Packet):
__slots__ = ( 'id', 'animation', 'entityId' )
@ -11,12 +11,12 @@ class PacketAnimation(Packet):
animation : int
entityId : int
def __init__(self, proto:int,
animation:int=None,
entityId:int=None,
def __init__(self,
animation:int | None = None,
entityId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
animation=animation,
entityId=entityId
)
@ -60,7 +60,11 @@ class PacketAnimation(Packet):
751 : 5,
755 : 6,
756 : 6,
757 : 6
757 : 6,
758 : 6,
759 : 3,
760 : 3,
761 : 3
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
@ -99,5 +103,9 @@ class PacketAnimation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketAttachEntity(Packet):
__slots__ = ( 'id', 'entityId', 'leash', 'vehicleId' )
@ -12,13 +12,13 @@ class PacketAttachEntity(Packet):
leash : bool
vehicleId : int
def __init__(self, proto:int,
entityId:int=None,
leash:bool=None,
vehicleId:int=None,
def __init__(self,
entityId:int | None = None,
leash:bool | None = None,
vehicleId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
leash=leash,
vehicleId=vehicleId
@ -63,7 +63,11 @@ class PacketAttachEntity(Packet):
751 : 69,
755 : 78,
756 : 78,
757 : 78
757 : 78,
758 : 78,
759 : 78,
760 : 81,
761 : 79
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'vehicleId', Int ), ( 'leash', Boolean ) ],
@ -102,5 +106,9 @@ class PacketAttachEntity(Packet):
751 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketBed(Packet):
__slots__ = ( 'id', 'entityId', 'location' )
@ -11,12 +11,12 @@ class PacketBed(Packet):
entityId : int
location : tuple
def __init__(self, proto:int,
entityId:int=None,
location:tuple=None,
def __init__(self,
entityId:int | None = None,
location:tuple | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
location=location
)

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketBlockAction(Packet):
__slots__ = ( 'id', 'blockId', 'byte1', 'byte2', 'location' )
@ -13,14 +13,14 @@ class PacketBlockAction(Packet):
byte2 : int
location : tuple
def __init__(self, proto:int,
blockId:int=None,
byte1:int=None,
byte2:int=None,
location:tuple=None,
def __init__(self,
blockId:int | None = None,
byte1:int | None = None,
byte2:int | None = None,
location:tuple | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
blockId=blockId,
byte1=byte1,
byte2=byte2,
@ -66,7 +66,11 @@ class PacketBlockAction(Packet):
751 : 10,
755 : 11,
756 : 11,
757 : 11
757 : 11,
758 : 11,
759 : 8,
760 : 8,
761 : 8
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
@ -105,5 +109,9 @@ class PacketBlockAction(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketBlockBreakAnimation(Packet):
__slots__ = ( 'id', 'destroyStage', 'entityId', 'location' )
@ -12,13 +12,13 @@ class PacketBlockBreakAnimation(Packet):
entityId : int
location : tuple
def __init__(self, proto:int,
destroyStage:int=None,
entityId:int=None,
location:tuple=None,
def __init__(self,
destroyStage:int | None = None,
entityId:int | None = None,
location:tuple | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
destroyStage=destroyStage,
entityId=entityId,
location=location
@ -63,7 +63,11 @@ class PacketBlockBreakAnimation(Packet):
751 : 8,
755 : 9,
756 : 9,
757 : 9
757 : 9,
758 : 9,
759 : 6,
760 : 6,
761 : 6
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
@ -102,5 +106,9 @@ class PacketBlockBreakAnimation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketBlockChange(Packet):
__slots__ = ( 'id', 'location', 'type' )
@ -11,12 +11,12 @@ class PacketBlockChange(Packet):
location : tuple
type : int
def __init__(self, proto:int,
location:tuple=None,
type:int=None,
def __init__(self,
location:tuple | None = None,
type:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
location=location,
type=type
)
@ -60,7 +60,11 @@ class PacketBlockChange(Packet):
751 : 11,
755 : 12,
756 : 12,
757 : 12
757 : 12,
758 : 12,
759 : 9,
760 : 9,
761 : 9
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'location', Position ), ( 'type', VarInt ) ],
@ -99,5 +103,9 @@ class PacketBlockChange(Packet):
751 : [ ( 'location', Position ), ( 'type', VarInt ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketBossBar(Packet):
__slots__ = ( 'id', 'action', 'color', 'dividers', 'entityUUID', 'flags', 'health', 'title' )
@ -16,17 +16,17 @@ class PacketBossBar(Packet):
health : Union[None, float]
title : Union[None, str]
def __init__(self, proto:int,
action:int=None,
color:Union[None, int]=None,
dividers:Union[None, int]=None,
entityUUID:str=None,
flags:Union[None, int]=None,
health:Union[None, float]=None,
title:Union[None, str]=None,
def __init__(self,
action:int | None = None,
color:Union[None, int] | None = None,
dividers:Union[None, int] | None = None,
entityUUID:str | None = None,
flags:Union[None, int] | None = None,
health:Union[None, float] | None = None,
title:Union[None, str] | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
action=action,
color=color,
dividers=dividers,
@ -74,7 +74,11 @@ class PacketBossBar(Packet):
751 : 12,
755 : 13,
756 : 13,
757 : 13
757 : 13,
758 : 13,
759 : 10,
760 : 10,
761 : 10
}
_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, ) ) ],
@ -112,5 +116,9 @@ 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, ) ) ],
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCamera(Packet):
__slots__ = ( 'id', 'cameraId' )
cameraId : int
def __init__(self, proto:int,
cameraId:int=None,
def __init__(self,
cameraId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
cameraId=cameraId
)
@ -57,7 +57,11 @@ class PacketCamera(Packet):
751 : 62,
755 : 71,
756 : 71,
757 : 71
757 : 71,
758 : 71,
759 : 70,
760 : 73,
761 : 72
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'cameraId', VarInt ) ],
@ -96,5 +100,9 @@ class PacketCamera(Packet):
751 : [ ( 'cameraId', VarInt ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketChat(Packet):
__slots__ = ( 'id', 'message', 'position', 'sender' )
@ -12,13 +12,13 @@ class PacketChat(Packet):
position : int
sender : str
def __init__(self, proto:int,
message:str=None,
position:int=None,
sender:str=None,
def __init__(self,
message:str | None = None,
position:int | None = None,
sender:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
message=message,
position=position,
sender=sender
@ -63,7 +63,8 @@ class PacketChat(Packet):
751 : 14,
755 : 15,
756 : 15,
757 : 15
757 : 15,
758 : 15
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'message', String ), ( 'position', Byte ) ],
@ -102,5 +103,6 @@ class PacketChat(Packet):
751 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
755 : [ ( '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

@ -0,0 +1,33 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketChatPreview(Packet):
__slots__ = ( 'id', 'message', 'queryId' )
message : tuple
queryId : int
def __init__(self,
message:tuple | None = None,
queryId:int | None = None,
**kwargs
):
super().__init__(
message=message,
queryId=queryId
)
_state : int = 3
_ids : Dict[int, int] = {
759 : 12,
760 : 12
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
759 : [ ( 'queryId', Int ), ( 'message', OptionalType(String, ) ) ],
760 : [ ( 'queryId', Int ), ( 'message', OptionalType(String, ) ) ]
}

View file

@ -0,0 +1,33 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketChatSuggestions(Packet):
__slots__ = ( 'id', 'action', 'entries' )
action : int
entries : list
def __init__(self,
action:int | None = None,
entries:list | None = None,
**kwargs
):
super().__init__(
action=action,
entries=entries
)
_state : int = 3
_ids : Dict[int, int] = {
760 : 21,
761 : 20
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
760 : [ ( 'action', VarInt ), ( 'entries', ArrayType(String, VarInt, ) ) ],
761 : [ ( 'action', VarInt ), ( 'entries', ArrayType(String, VarInt, ) ) ]
}

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketClearTitles(Packet):
__slots__ = ( 'id', 'reset' )
reset : bool
def __init__(self, proto:int,
reset:bool=None,
def __init__(self,
reset:bool | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
reset=reset
)
@ -23,10 +23,18 @@ class PacketClearTitles(Packet):
_ids : Dict[int, int] = {
755 : 16,
756 : 16,
757 : 16
757 : 16,
758 : 16,
759 : 13,
760 : 13,
761 : 12
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCloseWindow(Packet):
__slots__ = ( 'id', 'windowId' )
windowId : int
def __init__(self, proto:int,
windowId:int=None,
def __init__(self,
windowId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
windowId=windowId
)
@ -57,7 +57,11 @@ class PacketCloseWindow(Packet):
751 : 18,
755 : 19,
756 : 19,
757 : 19
757 : 19,
758 : 19,
759 : 16,
760 : 16,
761 : 15
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'windowId', Byte ) ],
@ -96,5 +100,9 @@ class PacketCloseWindow(Packet):
751 : [ ( 'windowId', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCollect(Packet):
__slots__ = ( 'id', 'collectedEntityId', 'collectorEntityId', 'pickupItemCount' )
@ -12,13 +12,13 @@ class PacketCollect(Packet):
collectorEntityId : int
pickupItemCount : int
def __init__(self, proto:int,
collectedEntityId:int=None,
collectorEntityId:int=None,
pickupItemCount:int=None,
def __init__(self,
collectedEntityId:int | None = None,
collectorEntityId:int | None = None,
pickupItemCount:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
collectedEntityId=collectedEntityId,
collectorEntityId=collectorEntityId,
pickupItemCount=pickupItemCount
@ -63,7 +63,11 @@ class PacketCollect(Packet):
751 : 85,
755 : 96,
756 : 96,
757 : 97
757 : 97,
758 : 97,
759 : 98,
760 : 101,
761 : 99
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ) ],
@ -102,5 +106,9 @@ class PacketCollect(Packet):
751 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCombatEvent(Packet):
__slots__ = ( 'id', 'duration', 'entityId', 'event', 'message', 'playerId' )
@ -14,15 +14,15 @@ class PacketCombatEvent(Packet):
message : Union[None, str]
playerId : Union[None, int]
def __init__(self, proto:int,
duration:Union[None, int]=None,
entityId:Union[None, int]=None,
event:int=None,
message:Union[None, str]=None,
playerId:Union[None, int]=None,
def __init__(self,
duration:Union[None, int] | None = None,
entityId:Union[None, int] | None = None,
event:int | None = None,
message:Union[None, str] | None = None,
playerId:Union[None, int] | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
duration=duration,
entityId=entityId,
event=event,

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCraftProgressBar(Packet):
__slots__ = ( 'id', 'property', 'value', 'windowId' )
@ -12,13 +12,13 @@ class PacketCraftProgressBar(Packet):
value : int
windowId : int
def __init__(self, proto:int,
property:int=None,
value:int=None,
windowId:int=None,
def __init__(self,
property:int | None = None,
value:int | None = None,
windowId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
property=property,
value=value,
windowId=windowId
@ -63,7 +63,11 @@ class PacketCraftProgressBar(Packet):
751 : 20,
755 : 21,
756 : 21,
757 : 21
757 : 21,
758 : 21,
759 : 18,
760 : 18,
761 : 17
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
@ -102,5 +106,9 @@ class PacketCraftProgressBar(Packet):
751 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCraftRecipeResponse(Packet):
__slots__ = ( 'id', 'recipe', 'windowId' )
@ -11,12 +11,12 @@ class PacketCraftRecipeResponse(Packet):
recipe : Union[int,str]
windowId : int
def __init__(self, proto:int,
recipe:Union[int,str]=None,
windowId:int=None,
def __init__(self,
recipe:Union[int,str] | None = None,
windowId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
recipe=recipe,
windowId=windowId
)
@ -46,7 +46,11 @@ class PacketCraftRecipeResponse(Packet):
751 : 47,
755 : 49,
756 : 49,
757 : 49
757 : 49,
758 : 49,
759 : 46,
760 : 48,
761 : 47
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
338 : [ ( 'windowId', Byte ), ( 'recipe', VarInt ) ],
@ -71,5 +75,9 @@ class PacketCraftRecipeResponse(Packet):
751 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketCustomPayload(Packet):
__slots__ = ( 'id', 'channel', 'data' )
@ -11,12 +11,12 @@ class PacketCustomPayload(Packet):
channel : str
data : bytes
def __init__(self, proto:int,
channel:str=None,
data:bytes=None,
def __init__(self,
channel:str | None = None,
data:bytes | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
channel=channel,
data=data
)
@ -60,7 +60,11 @@ class PacketCustomPayload(Packet):
751 : 23,
755 : 24,
756 : 24,
757 : 24
757 : 24,
758 : 24,
759 : 21,
760 : 22,
761 : 21
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
@ -99,5 +103,9 @@ class PacketCustomPayload(Packet):
751 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketDeathCombatEvent(Packet):
__slots__ = ( 'id', 'entityId', 'message', 'playerId' )
@ -12,13 +12,13 @@ class PacketDeathCombatEvent(Packet):
message : str
playerId : int
def __init__(self, proto:int,
entityId:int=None,
message:str=None,
playerId:int=None,
def __init__(self,
entityId:int | None = None,
message:str | None = None,
playerId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
message=message,
playerId=playerId
@ -29,10 +29,18 @@ class PacketDeathCombatEvent(Packet):
_ids : Dict[int, int] = {
755 : 53,
756 : 53,
757 : 53
757 : 53,
758 : 53,
759 : 51,
760 : 54,
761 : 52
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( '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,79 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketDeclareCommands(Packet):
__slots__ = ( 'id', 'nodes', 'rootIndex' )
nodes : list
rootIndex : int
def __init__(self,
nodes:list | None = None,
rootIndex:int | None = None,
**kwargs
):
super().__init__(
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,
758 : 18,
759 : 15,
760 : 15,
761 : 14
}
_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(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
401 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
402 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
403 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
404 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
477 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
480 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
490 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
498 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
573 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
575 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
578 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
709 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
734 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
735 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
736 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
751 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
755 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
756 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
757 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
758 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
759 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
760 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ],
761 : [ ( 'nodes', ArrayType(TrailingData, VarInt, ) ), ( 'rootIndex', VarInt ) ]
}

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketDeclareRecipes(Packet):
__slots__ = ( 'id', 'recipes' )
recipes : list
def __init__(self, proto:int,
recipes:list=None,
def __init__(self,
recipes:list | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
recipes=recipes
)
@ -41,7 +41,11 @@ class PacketDeclareRecipes(Packet):
751 : 90,
755 : 101,
756 : 101,
757 : 102
757 : 102,
758 : 102,
759 : 103,
760 : 106,
761 : 105
}
_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, ) ) ],
@ -64,5 +68,9 @@ 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, ) ) ],
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketDestroyEntity(Packet):
__slots__ = ( 'id', 'entityId' )
entityId : int
def __init__(self, proto:int,
entityId:int=None,
def __init__(self,
entityId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId
)

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketDifficulty(Packet):
__slots__ = ( 'id', 'difficulty', 'difficultyLocked' )
@ -11,12 +11,12 @@ class PacketDifficulty(Packet):
difficulty : int
difficultyLocked : bool
def __init__(self, proto:int,
difficulty:int=None,
difficultyLocked:bool=None,
def __init__(self,
difficulty:int | None = None,
difficultyLocked:bool | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
difficulty=difficulty,
difficultyLocked=difficultyLocked
)
@ -60,7 +60,11 @@ class PacketDifficulty(Packet):
751 : 13,
755 : 14,
756 : 14,
757 : 14
757 : 14,
758 : 14,
759 : 11,
760 : 11,
761 : 11
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'difficulty', Byte ) ],
@ -99,5 +103,9 @@ class PacketDifficulty(Packet):
751 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEndCombatEvent(Packet):
__slots__ = ( 'id', 'duration', 'entityId' )
@ -11,12 +11,12 @@ class PacketEndCombatEvent(Packet):
duration : int
entityId : int
def __init__(self, proto:int,
duration:int=None,
entityId:int=None,
def __init__(self,
duration:int | None = None,
entityId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
duration=duration,
entityId=entityId
)
@ -26,10 +26,18 @@ class PacketEndCombatEvent(Packet):
_ids : Dict[int, int] = {
755 : 51,
756 : 51,
757 : 51
757 : 51,
758 : 51,
759 : 49,
760 : 52,
761 : 50
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEnterCombatEvent(Packet):
__slots__ = ( 'id' )
def __init__(self, proto:int,
def __init__(self,
**kwargs
):
super().__init__(proto,
super().__init__(
)
@ -22,10 +22,18 @@ class PacketEnterCombatEvent(Packet):
_ids : Dict[int, int] = {
755 : 52,
756 : 52,
757 : 52
757 : 52,
758 : 52,
759 : 50,
760 : 53,
761 : 51
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
755 : [ ],
756 : [ ],
757 : [ ]
757 : [ ],
758 : [ ],
759 : [ ],
760 : [ ],
761 : [ ]
}

View file

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

View file

@ -2,19 +2,19 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityDestroy(Packet):
__slots__ = ( 'id', 'entityIds' )
entityIds : list
def __init__(self, proto:int,
entityIds:list=None,
def __init__(self,
entityIds:list | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityIds=entityIds
)
@ -56,7 +56,11 @@ class PacketEntityDestroy(Packet):
736 : 55,
751 : 54,
756 : 58,
757 : 58
757 : 58,
758 : 58,
759 : 56,
760 : 59,
761 : 58
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
@ -94,5 +98,9 @@ class PacketEntityDestroy(Packet):
736 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
751 : [ ( '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,31 +2,34 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityEffect(Packet):
__slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'hideParticles' )
__slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'factorCodec', 'hideParticles' )
amplifier : int
duration : int
effectId : int
entityId : int
factorCodec : tuple
hideParticles : Union[bool,int]
def __init__(self, proto:int,
amplifier:int=None,
duration:int=None,
effectId:int=None,
entityId:int=None,
hideParticles:Union[bool,int]=None,
def __init__(self,
amplifier:int | None = None,
duration:int | None = None,
effectId:int | None = None,
entityId:int | None = None,
factorCodec:tuple | None = None,
hideParticles:Union[bool,int] | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
amplifier=amplifier,
duration=duration,
effectId=effectId,
entityId=entityId,
factorCodec=factorCodec,
hideParticles=hideParticles
)
@ -69,7 +72,11 @@ class PacketEntityEffect(Packet):
751 : 89,
755 : 100,
756 : 100,
757 : 101
757 : 101,
758 : 101,
759 : 102,
760 : 105,
761 : 104
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Boolean ) ],
@ -108,5 +115,9 @@ class PacketEntityEffect(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityEquipment(Packet):
__slots__ = ( 'id', 'entityId', 'equipments', 'item', 'slot' )
@ -13,14 +13,14 @@ class PacketEntityEquipment(Packet):
item : Item
slot : int
def __init__(self, proto:int,
entityId:int=None,
equipments:bytes=None,
item:Item=None,
slot:int=None,
def __init__(self,
entityId:int | None = None,
equipments:bytes | None = None,
item:Item | None = None,
slot:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
equipments=equipments,
item=item,
@ -66,7 +66,11 @@ class PacketEntityEquipment(Packet):
751 : 71,
755 : 80,
756 : 80,
757 : 80
757 : 80,
758 : 80,
759 : 80,
760 : 83,
761 : 81
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'slot', Short ), ( 'item', Slot ) ],
@ -105,5 +109,9 @@ class PacketEntityEquipment(Packet):
751 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityHeadRotation(Packet):
__slots__ = ( 'id', 'entityId', 'headYaw' )
@ -11,12 +11,12 @@ class PacketEntityHeadRotation(Packet):
entityId : int
headYaw : int
def __init__(self, proto:int,
entityId:int=None,
headYaw:int=None,
def __init__(self,
entityId:int | None = None,
headYaw:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
headYaw=headYaw
)
@ -60,7 +60,11 @@ class PacketEntityHeadRotation(Packet):
751 : 58,
755 : 62,
756 : 62,
757 : 62
757 : 62,
758 : 62,
759 : 60,
760 : 63,
761 : 62
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
@ -99,5 +103,9 @@ class PacketEntityHeadRotation(Packet):
751 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityLook(Packet):
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'yaw' )
@ -13,14 +13,14 @@ class PacketEntityLook(Packet):
pitch : int
yaw : int
def __init__(self, proto:int,
entityId:int=None,
onGround:bool=None,
pitch:int=None,
yaw:int=None,
def __init__(self,
entityId:int | None = None,
onGround:bool | None = None,
pitch:int | None = None,
yaw:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
onGround=onGround,
pitch=pitch,
@ -66,7 +66,11 @@ class PacketEntityLook(Packet):
751 : 41,
755 : 43,
756 : 43,
757 : 43
757 : 43,
758 : 43,
759 : 40,
760 : 42,
761 : 41
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -105,5 +109,9 @@ class PacketEntityLook(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityMetadata(Packet):
__slots__ = ( 'id', 'entityId', 'metadata' )
@ -11,12 +11,12 @@ class PacketEntityMetadata(Packet):
entityId : int
metadata : dict
def __init__(self, proto:int,
entityId:int=None,
metadata:dict=None,
def __init__(self,
entityId:int | None = None,
metadata:dict | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
metadata=metadata
)
@ -60,7 +60,11 @@ class PacketEntityMetadata(Packet):
751 : 68,
755 : 77,
756 : 77,
757 : 77
757 : 77,
758 : 77,
759 : 77,
760 : 80,
761 : 78
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
@ -99,5 +103,9 @@ class PacketEntityMetadata(Packet):
751 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityMoveLook(Packet):
__slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround', 'pitch', 'yaw' )
@ -16,17 +16,17 @@ class PacketEntityMoveLook(Packet):
pitch : int
yaw : int
def __init__(self, proto:int,
dX:int=None,
dY:int=None,
dZ:int=None,
entityId:int=None,
onGround:bool=None,
pitch:int=None,
yaw:int=None,
def __init__(self,
dX:int | None = None,
dY:int | None = None,
dZ:int | None = None,
entityId:int | None = None,
onGround:bool | None = None,
pitch:int | None = None,
yaw:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
dX=dX,
dY=dY,
dZ=dZ,
@ -75,7 +75,11 @@ class PacketEntityMoveLook(Packet):
751 : 40,
755 : 42,
756 : 42,
757 : 42
757 : 42,
758 : 42,
759 : 39,
760 : 41,
761 : 40
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -114,5 +118,9 @@ class PacketEntityMoveLook(Packet):
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 ) ],
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,30 +2,36 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntitySoundEffect(Packet):
__slots__ = ( 'id', 'entityId', 'pitch', 'soundCategory', 'soundId', 'volume' )
__slots__ = ( 'id', 'entityId', 'pitch', 'seed', 'soundCategory', 'soundEvent', 'soundId', 'volume' )
entityId : int
pitch : float
seed : int
soundCategory : int
soundEvent : Union[None, dict]
soundId : int
volume : float
def __init__(self, proto:int,
entityId:int=None,
pitch:float=None,
soundCategory:int=None,
soundId:int=None,
volume:float=None,
def __init__(self,
entityId:int | None = None,
pitch:float | None = None,
seed:int | None = None,
soundCategory:int | None = None,
soundEvent:Union[None, dict] | None = None,
soundId:int | None = None,
volume:float | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
pitch=pitch,
seed=seed,
soundCategory=soundCategory,
soundEvent=soundEvent,
soundId=soundId,
volume=volume
)
@ -47,7 +53,11 @@ class PacketEntitySoundEffect(Packet):
751 : 80,
755 : 91,
756 : 91,
757 : 92
757 : 92,
758 : 92,
759 : 92,
760 : 95,
761 : 93
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
477 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
@ -64,5 +74,9 @@ class PacketEntitySoundEffect(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityStatus(Packet):
__slots__ = ( 'id', 'entityId', 'entityStatus' )
@ -11,12 +11,12 @@ class PacketEntityStatus(Packet):
entityId : int
entityStatus : int
def __init__(self, proto:int,
entityId:int=None,
entityStatus:int=None,
def __init__(self,
entityId:int | None = None,
entityStatus:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
entityStatus=entityStatus
)
@ -60,7 +60,11 @@ class PacketEntityStatus(Packet):
751 : 26,
755 : 27,
756 : 27,
757 : 27
757 : 27,
758 : 27,
759 : 24,
760 : 26,
761 : 25
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
@ -99,5 +103,9 @@ class PacketEntityStatus(Packet):
751 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityTeleport(Packet):
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'x', 'y', 'yaw', 'z' )
@ -16,17 +16,17 @@ class PacketEntityTeleport(Packet):
yaw : int
z : Union[float,int]
def __init__(self, proto:int,
entityId:int=None,
onGround:bool=None,
pitch:int=None,
x:Union[float,int]=None,
y:Union[float,int]=None,
yaw:int=None,
z:Union[float,int]=None,
def __init__(self,
entityId:int | None = None,
onGround:bool | None = None,
pitch:int | None = None,
x:Union[float,int] | None = None,
y:Union[float,int] | None = None,
yaw:int | None = None,
z:Union[float,int] | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
onGround=onGround,
pitch=pitch,
@ -75,7 +75,11 @@ class PacketEntityTeleport(Packet):
751 : 86,
755 : 97,
756 : 97,
757 : 98
757 : 98,
758 : 98,
759 : 99,
760 : 102,
761 : 100
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
@ -114,5 +118,9 @@ class PacketEntityTeleport(Packet):
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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityUpdateAttributes(Packet):
__slots__ = ( 'id', 'entityId', 'properties' )
@ -11,12 +11,12 @@ class PacketEntityUpdateAttributes(Packet):
entityId : int
properties : list
def __init__(self, proto:int,
entityId:int=None,
properties:list=None,
def __init__(self,
entityId:int | None = None,
properties:list | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
properties=properties
)
@ -58,7 +58,11 @@ class PacketEntityUpdateAttributes(Packet):
751 : 88,
755 : 99,
756 : 99,
757 : 100
757 : 100,
758 : 100,
759 : 101,
760 : 104,
761 : 102
}
_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, ) ) ],
@ -95,5 +99,9 @@ class PacketEntityUpdateAttributes(Packet):
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketEntityVelocity(Packet):
__slots__ = ( 'id', 'entityId', 'velocityX', 'velocityY', 'velocityZ' )
@ -13,14 +13,14 @@ class PacketEntityVelocity(Packet):
velocityY : int
velocityZ : int
def __init__(self, proto:int,
entityId:int=None,
velocityX:int=None,
velocityY:int=None,
velocityZ:int=None,
def __init__(self,
entityId:int | None = None,
velocityX:int | None = None,
velocityY:int | None = None,
velocityZ:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
velocityX=velocityX,
velocityY=velocityY,
@ -66,7 +66,11 @@ class PacketEntityVelocity(Packet):
751 : 70,
755 : 79,
756 : 79,
757 : 79
757 : 79,
758 : 79,
759 : 79,
760 : 82,
761 : 80
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
@ -105,5 +109,9 @@ class PacketEntityVelocity(Packet):
751 : [ ( '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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketExperience(Packet):
__slots__ = ( 'id', 'experienceBar', 'level', 'totalExperience' )
@ -12,13 +12,13 @@ class PacketExperience(Packet):
level : int
totalExperience : int
def __init__(self, proto:int,
experienceBar:float=None,
level:int=None,
totalExperience:int=None,
def __init__(self,
experienceBar:float | None = None,
level:int | None = None,
totalExperience:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
experienceBar=experienceBar,
level=level,
totalExperience=totalExperience
@ -63,7 +63,11 @@ class PacketExperience(Packet):
751 : 72,
755 : 81,
756 : 81,
757 : 81
757 : 81,
758 : 81,
759 : 81,
760 : 84,
761 : 82
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
@ -102,5 +106,9 @@ class PacketExperience(Packet):
751 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketExplosion(Packet):
__slots__ = ( 'id', 'affectedBlockOffsets', 'playerMotionX', 'playerMotionY', 'playerMotionZ', 'radius', 'x', 'y', 'z' )
@ -17,18 +17,18 @@ class PacketExplosion(Packet):
y : float
z : float
def __init__(self, proto:int,
affectedBlockOffsets:list=None,
playerMotionX:float=None,
playerMotionY:float=None,
playerMotionZ:float=None,
radius:float=None,
x:float=None,
y:float=None,
z:float=None,
def __init__(self,
affectedBlockOffsets:list | None = None,
playerMotionX:float | None = None,
playerMotionY:float | None = None,
playerMotionZ:float | None = None,
radius:float | None = None,
x:float | None = None,
y:float | None = None,
z:float | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
affectedBlockOffsets=affectedBlockOffsets,
playerMotionX=playerMotionX,
playerMotionY=playerMotionY,
@ -78,7 +78,11 @@ class PacketExplosion(Packet):
751 : 27,
755 : 28,
756 : 28,
757 : 28
757 : 28,
758 : 28,
759 : 25,
760 : 27,
761 : 26
}
_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 ) ],
@ -117,5 +121,9 @@ 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 ) ],
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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketFacePlayer(Packet):
__slots__ = ( 'id', 'entityId', 'entity_feet_eyes', 'feet_eyes', 'isEntity', 'x', 'y', 'z' )
@ -16,17 +16,17 @@ class PacketFacePlayer(Packet):
y : float
z : float
def __init__(self, proto:int,
entityId:Union[None, int]=None,
entity_feet_eyes:Union[None, str]=None,
feet_eyes:int=None,
isEntity:bool=None,
x:float=None,
y:float=None,
z:float=None,
def __init__(self,
entityId:Union[None, int] | None = None,
entity_feet_eyes:Union[None, str] | None = None,
feet_eyes:int | None = None,
isEntity:bool | None = None,
x:float | None = None,
y:float | None = None,
z:float | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
entityId=entityId,
entity_feet_eyes=entity_feet_eyes,
feet_eyes=feet_eyes,
@ -58,7 +58,11 @@ class PacketFacePlayer(Packet):
751 : 51,
755 : 55,
756 : 55,
757 : 55
757 : 55,
758 : 55,
759 : 53,
760 : 56,
761 : 55
}
_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, ) ) ],
@ -80,5 +84,9 @@ 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, ) ) ],
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, ) ) ],
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

@ -0,0 +1,28 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketFeatureFlags(Packet):
__slots__ = ( 'id', 'features' )
features : list
def __init__(self,
features:list | None = None,
**kwargs
):
super().__init__(
features=features
)
_state : int = 3
_ids : Dict[int, int] = {
761 : 103
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
761 : [ ( 'features', ArrayType(String, VarInt, ) ) ]
}

View file

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

@ -0,0 +1,33 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketHideMessage(Packet):
__slots__ = ( 'id', 'id', 'signature' )
id : int
signature : Union[Union[None, bytes],bytes]
def __init__(self,
id:int | None = None,
signature:Union[Union[None, bytes],bytes] | None = None,
**kwargs
):
super().__init__(
id=id,
signature=signature
)
_state : int = 3
_ids : Dict[int, int] = {
760 : 24,
761 : 22
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
760 : [ ( 'signature', ByteArray ) ],
761 : [ ( 'id', VarInt ), ( 'signature', SwitchType('id', { 0 : ByteArray }, None, ) ) ]
}

View file

@ -2,8 +2,8 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketInitializeWorldBorder(Packet):
__slots__ = ( 'id', 'newDiameter', 'oldDiameter', 'portalTeleportBoundary', 'speed', 'warningBlocks', 'warningTime', 'x', 'z' )
@ -17,18 +17,18 @@ class PacketInitializeWorldBorder(Packet):
x : float
z : float
def __init__(self, proto:int,
newDiameter:float=None,
oldDiameter:float=None,
portalTeleportBoundary:int=None,
speed:int=None,
warningBlocks:int=None,
warningTime:int=None,
x:float=None,
z:float=None,
def __init__(self,
newDiameter:float | None = None,
oldDiameter:float | None = None,
portalTeleportBoundary:int | None = None,
speed:int | None = None,
warningBlocks:int | None = None,
warningTime:int | None = None,
x:float | None = None,
z:float | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
newDiameter=newDiameter,
oldDiameter=oldDiameter,
portalTeleportBoundary=portalTeleportBoundary,
@ -44,10 +44,18 @@ class PacketInitializeWorldBorder(Packet):
_ids : Dict[int, int] = {
755 : 32,
756 : 32,
757 : 32
757 : 32,
758 : 32,
759 : 29,
760 : 31,
761 : 30
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
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', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
757 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarInt ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ]
755 : [ ( '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', VarLong ), ( 'portalTeleportBoundary', VarInt ), ( 'warningBlocks', VarInt ), ( 'warningTime', VarInt ) ],
757 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', VarLong ), ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketKeepAlive(Packet):
__slots__ = ( 'id', 'keepAliveId' )
keepAliveId : int
def __init__(self, proto:int,
keepAliveId:int=None,
def __init__(self,
keepAliveId:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
keepAliveId=keepAliveId
)
@ -57,7 +57,11 @@ class PacketKeepAlive(Packet):
751 : 31,
755 : 33,
756 : 33,
757 : 33
757 : 33,
758 : 33,
759 : 30,
760 : 32,
761 : 31
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'keepAliveId', VarInt ) ],
@ -96,5 +100,9 @@ class PacketKeepAlive(Packet):
751 : [ ( 'keepAliveId', Long ) ],
755 : [ ( '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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketKickDisconnect(Packet):
__slots__ = ( 'id', 'reason' )
reason : str
def __init__(self, proto:int,
reason:str=None,
def __init__(self,
reason:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
reason=reason
)
@ -57,7 +57,11 @@ class PacketKickDisconnect(Packet):
751 : 25,
755 : 26,
756 : 26,
757 : 26
757 : 26,
758 : 26,
759 : 23,
760 : 25,
761 : 23
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'reason', String ) ],
@ -96,5 +100,9 @@ class PacketKickDisconnect(Packet):
751 : [ ( 'reason', String ) ],
755 : [ ( '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,12 +2,13 @@
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketLogin(Packet):
__slots__ = ( 'id', 'difficulty', 'dimension', 'dimensionCodec', 'enableRespawnScreen', 'entityId', 'gameMode', 'hashedSeed', 'isDebug', 'isFlat', 'isHardcore', 'levelType', 'maxPlayers', 'previousGameMode', 'reducedDebugInfo', 'simulationDistance', 'viewDistance', 'worldName', 'worldNames' )
__slots__ = ( 'id', 'death', 'difficulty', 'dimension', 'dimensionCodec', 'enableRespawnScreen', 'entityId', 'gameMode', 'hashedSeed', 'isDebug', 'isFlat', 'isHardcore', 'levelType', 'maxPlayers', 'previousGameMode', 'reducedDebugInfo', 'simulationDistance', 'viewDistance', 'worldName', 'worldNames', 'worldType' )
death : tuple
difficulty : int
dimension : Union[dict,int,str]
dimensionCodec : dict
@ -26,29 +27,33 @@ class PacketLogin(Packet):
viewDistance : int
worldName : str
worldNames : list
worldType : str
def __init__(self, proto:int,
difficulty:int=None,
dimension:Union[dict,int,str]=None,
dimensionCodec:dict=None,
enableRespawnScreen:bool=None,
entityId:int=None,
gameMode:int=None,
hashedSeed:int=None,
isDebug:bool=None,
isFlat:bool=None,
isHardcore:bool=None,
levelType:str=None,
maxPlayers:int=None,
previousGameMode:int=None,
reducedDebugInfo:bool=None,
simulationDistance:int=None,
viewDistance:int=None,
worldName:str=None,
worldNames:list=None,
def __init__(self,
death:tuple | None = None,
difficulty:int | None = None,
dimension:Union[dict,int,str] | None = None,
dimensionCodec:dict | None = None,
enableRespawnScreen:bool | None = None,
entityId:int | None = None,
gameMode:int | None = None,
hashedSeed:int | None = None,
isDebug:bool | None = None,
isFlat:bool | None = None,
isHardcore:bool | None = None,
levelType:str | None = None,
maxPlayers:int | None = None,
previousGameMode:int | None = None,
reducedDebugInfo:bool | None = None,
simulationDistance:int | None = None,
viewDistance:int | None = None,
worldName:str | None = None,
worldNames:list | None = None,
worldType:str | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
death=death,
difficulty=difficulty,
dimension=dimension,
dimensionCodec=dimensionCodec,
@ -66,7 +71,8 @@ class PacketLogin(Packet):
simulationDistance=simulationDistance,
viewDistance=viewDistance,
worldName=worldName,
worldNames=worldNames
worldNames=worldNames,
worldType=worldType
)
_state : int = 3
@ -108,7 +114,11 @@ class PacketLogin(Packet):
751 : 36,
755 : 38,
756 : 38,
757 : 38
757 : 38,
758 : 38,
759 : 35,
760 : 37,
761 : 36
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'entityId', Int ), ( 'gameMode', Byte ), ( 'dimension', Byte ), ( 'difficulty', Byte ), ( 'maxPlayers', Byte ), ( 'levelType', String ), ( 'reducedDebugInfo', Boolean ) ],
@ -147,5 +157,9 @@ 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 ) ],
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 ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketMap(Packet):
__slots__ = ( 'id', 'columns', 'data', 'icons', 'itemDamage', 'locked', 'rows', 'scale', 'trackingPosition', 'x', 'y' )
@ -19,20 +19,20 @@ class PacketMap(Packet):
x : Union[None, int]
y : Union[None, int]
def __init__(self, proto:int,
columns:int=None,
data:Union[None, bytes]=None,
icons:Union[list,tuple]=None,
itemDamage:int=None,
locked:bool=None,
rows:Union[None, int]=None,
scale:int=None,
trackingPosition:bool=None,
x:Union[None, int]=None,
y:Union[None, int]=None,
def __init__(self,
columns:int | None = None,
data:Union[None, bytes] | None = None,
icons:Union[list,tuple] | None = None,
itemDamage:int | None = None,
locked:bool | None = None,
rows:Union[None, int] | None = None,
scale:int | None = None,
trackingPosition:bool | None = None,
x:Union[None, int] | None = None,
y:Union[None, int] | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
columns=columns,
data=data,
icons=icons,
@ -84,7 +84,11 @@ class PacketMap(Packet):
751 : 37,
755 : 39,
756 : 39,
757 : 39
757 : 39,
758 : 39,
759 : 36,
760 : 38,
761 : 37
}
_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, ) ) ],
@ -123,5 +127,9 @@ 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, ) ) ],
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketMapChunk(Packet):
__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
z : int
def __init__(self, proto:int,
biomes:Union[Union[None, list],list]=None,
bitMap:Union[int,list]=None,
blockEntities:list=None,
blockLight:list=None,
blockLightMask:list=None,
chunkData:bytes=None,
emptyBlockLightMask:list=None,
emptySkyLightMask:list=None,
groundUp:bool=None,
heightmaps:dict=None,
ignoreOldData:bool=None,
skyLight:list=None,
skyLightMask:list=None,
trustEdges:bool=None,
x:int=None,
z:int=None,
def __init__(self,
biomes:Union[Union[None, list],list] | None = None,
bitMap:Union[int,list] | None = None,
blockEntities:list | None = None,
blockLight:list | None = None,
blockLightMask:list | None = None,
chunkData:bytes | None = None,
emptyBlockLightMask:list | None = None,
emptySkyLightMask:list | None = None,
groundUp:bool | None = None,
heightmaps:dict | None = None,
ignoreOldData:bool | None = None,
skyLight:list | None = None,
skyLightMask:list | None = None,
trustEdges:bool | None = None,
x:int | None = None,
z:int | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
biomes=biomes,
bitMap=bitMap,
blockEntities=blockEntities,
@ -102,7 +102,11 @@ class PacketMapChunk(Packet):
751 : 32,
755 : 34,
756 : 34,
757 : 34
757 : 34,
758 : 34,
759 : 31,
760 : 33,
761 : 32
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
47 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', UnsignedShort ), ( 'chunkData', ByteArray ) ],
@ -141,5 +145,9 @@ 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, ) ) ],
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, ) ) ],
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 ....packet import Packet
from ....definitions import *
from ....types import *
from ....primitives import *
class PacketMapChunkBulk(Packet):
__slots__ = ( 'id', 'data', 'meta', 'skyLightSent' )
@ -12,13 +12,13 @@ class PacketMapChunkBulk(Packet):
meta : list
skyLightSent : bool
def __init__(self, proto:int,
data:bytes=None,
meta:list=None,
skyLightSent:bool=None,
def __init__(self,
data:bytes | None = None,
meta:list | None = None,
skyLightSent:bool | None = None,
**kwargs
):
super().__init__(proto,
super().__init__(
data=data,
meta=meta,
skyLightSent=skyLightSent

View file

@ -0,0 +1,37 @@
"""[!] This file is autogenerated"""
from typing import Tuple, List, Dict, Union, Optional
from ....packet import Packet
from ....types import *
from ....primitives import *
class PacketMessageHeader(Packet):
__slots__ = ( 'id', 'messageHash', 'previousSignature', 'senderUuid', 'signature' )
messageHash : bytes
previousSignature : tuple
senderUuid : str
signature : bytes
def __init__(self,
messageHash:bytes | None = None,
previousSignature:tuple | None = None,
senderUuid:str | None = None,
signature:bytes | None = None,
**kwargs
):
super().__init__(
messageHash=messageHash,
previousSignature=previousSignature,
senderUuid=senderUuid,
signature=signature
)
_state : int = 3
_ids : Dict[int, int] = {
760 : 50
}
_definitions : Dict[int, List[Tuple[str, Type]]] = {
760 : [ ( 'previousSignature', OptionalType(ByteArray, ) ), ( 'senderUuid', UUID ), ( 'signature', ByteArray ), ( 'messageHash', ByteArray ) ]
}

View file

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

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