Compare commits
34 commits
Author | SHA1 | Date | |
---|---|---|---|
47bea5fa5b | |||
0e4d59ec51 | |||
f5ae50bfd7 | |||
5e570eb30f | |||
b3c641678a | |||
13475e65e8 | |||
338f6c91cc | |||
f295e31cce | |||
eef8bf3d26 | |||
63a272858a | |||
51f4d09898 | |||
c1f9f7f262 | |||
1712826942 | |||
63da8ddcd5 | |||
42a03b0e57 | |||
97870d0b10 | |||
f0be394458 | |||
e74da435ea | |||
eb934a5a06 | |||
7327d4764d | |||
10684be970 | |||
9567201129 | |||
9928ea7a46 | |||
152dda2f2c | |||
49e85d47d1 | |||
66f0b46503 | |||
717ca56f17 | |||
28dac56fc7 | |||
46b10711f9 | |||
cef2fe19ee | |||
e3bde342d3 | |||
d6e5e7a6f6 | |||
6448e7bad4 | |||
2190554f71 |
247 changed files with 4870 additions and 2900 deletions
|
@ -1,11 +1,11 @@
|
||||||
[package]
|
[package]
|
||||||
name = "aiocraft"
|
name = "aiocraft"
|
||||||
version = "1.0.0"
|
version = "0.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "aiocraft"
|
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"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
46
README.md
46
README.md
|
@ -1,2 +1,46 @@
|
||||||
# aiocraft
|
# 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
|
||||||
|
|
||||||
|
|
|
@ -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"
|
|
|
@ -1,2 +0,0 @@
|
||||||
from .packet import Packet
|
|
||||||
from .definitions import *
|
|
|
@ -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
|
|
|
@ -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 ) ]
|
|
||||||
}
|
|
|
@ -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, ) ) ]
|
|
||||||
}
|
|
|
@ -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 ) ]
|
|
||||||
}
|
|
|
@ -5,10 +5,7 @@ import keyword
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple, List, Dict, Union, Set, Type as Class
|
from typing import Any
|
||||||
|
|
||||||
from aiocraft.mc.types import *
|
|
||||||
from aiocraft.mc.definitions import Item
|
|
||||||
|
|
||||||
# TODO de-spaghetti this file sometime!
|
# TODO de-spaghetti this file sometime!
|
||||||
|
|
||||||
|
@ -16,8 +13,8 @@ DIR_MAP = {"toClient": "clientbound", "toServer": "serverbound"}
|
||||||
PREFACE = """\"\"\"[!] This file is autogenerated\"\"\"\n\n"""
|
PREFACE = """\"\"\"[!] This file is autogenerated\"\"\"\n\n"""
|
||||||
IMPORTS = """from typing import Tuple, List, Dict, Union, Optional
|
IMPORTS = """from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
from ....types import *
|
||||||
from ....types import *\n"""
|
from ....primitives import *\n"""
|
||||||
IMPORT_ALL = """__all__ = [\n\t{all}\n]\n"""
|
IMPORT_ALL = """__all__ = [\n\t{all}\n]\n"""
|
||||||
REGISTRY_ENTRY = """
|
REGISTRY_ENTRY = """
|
||||||
REGISTRY = {entries}\n"""
|
REGISTRY = {entries}\n"""
|
||||||
|
@ -26,8 +23,8 @@ class {name}(Packet):
|
||||||
__slots__ = {slots}
|
__slots__ = {slots}
|
||||||
{fields}
|
{fields}
|
||||||
|
|
||||||
def __init__(self, proto:int,{constructor}):
|
def __init__(self, {constructor}):
|
||||||
super().__init__(proto,{constructed})
|
super().__init__({constructed})
|
||||||
|
|
||||||
_state : int = {state}
|
_state : int = {state}
|
||||||
|
|
||||||
|
@ -35,6 +32,15 @@ class {name}(Packet):
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {definitions}
|
_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:
|
class Ref:
|
||||||
name : str
|
name : str
|
||||||
args : tuple
|
args : tuple
|
||||||
|
@ -71,6 +77,7 @@ class Ref:
|
||||||
|
|
||||||
TYPE_MAP = {
|
TYPE_MAP = {
|
||||||
"varint": Ref('VarInt'),
|
"varint": Ref('VarInt'),
|
||||||
|
"varlong": Ref('VarLong'),
|
||||||
"u8": Ref('Byte'),
|
"u8": Ref('Byte'),
|
||||||
"i8": Ref('Byte'),
|
"i8": Ref('Byte'),
|
||||||
"u16": Ref('UnsignedShort'),
|
"u16": Ref('UnsignedShort'),
|
||||||
|
@ -96,6 +103,7 @@ TYPE_MAP = {
|
||||||
|
|
||||||
HINT_MAP = {
|
HINT_MAP = {
|
||||||
"varint": 'int',
|
"varint": 'int',
|
||||||
|
"varlong": 'int',
|
||||||
"u8": 'int',
|
"u8": 'int',
|
||||||
"i8": 'int',
|
"i8": 'int',
|
||||||
"u16": '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:
|
def format_list(l:list, depth:int=0) -> str:
|
||||||
return "[" + _format_line(l, depth) + "]"
|
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) + ")"
|
return "(" + _format_line(l, depth) + ")"
|
||||||
|
|
||||||
def mctype(slot_type:Any) -> Ref:
|
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,
|
mctype(v["default"]) if "default" in v and v['default'] != 'void' else None,
|
||||||
)
|
)
|
||||||
elif t == "bitfield":
|
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": # ????
|
# elif t == "mapper": # ????
|
||||||
# return TrailingData
|
# return TrailingData
|
||||||
else:
|
else:
|
||||||
|
@ -191,6 +205,8 @@ def mchint(slot_type:Any) -> Ref:
|
||||||
else:
|
else:
|
||||||
possibilities.add(Ref('None'))
|
possibilities.add(Ref('None'))
|
||||||
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
|
return Ref(f'Union[{", ".join(str(s) for s in sorted(possibilities))}]')
|
||||||
|
elif t == "bitfield":
|
||||||
|
return Ref('int')
|
||||||
# elif t == "mapper": # ????
|
# elif t == "mapper": # ????
|
||||||
# return TrailingData
|
# return TrailingData
|
||||||
logging.error("Unknown type %s, using 'bytes' as hint", str(slot_type))
|
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:
|
class PacketClassWriter:
|
||||||
name : str
|
name : str
|
||||||
attrs : Set[str]
|
attrs : set[str]
|
||||||
types : Dict[str, List[Type]]
|
types : dict[str, set[Ref]]
|
||||||
hints : Dict[str, List[Type]]
|
hints : dict[str, set[Ref]]
|
||||||
ids : Dict[int, int]
|
ids : dict[int, int]
|
||||||
definitions : Dict[int, List[Tuple[str, Type]]]
|
definitions : dict[int, list[tuple[str, Ref]]]
|
||||||
state : int
|
state : int
|
||||||
|
|
||||||
def __init__(self, pkt:dict, state:int):
|
def __init__(self, pkt:dict, state:int):
|
||||||
|
@ -243,7 +259,7 @@ class PacketClassWriter:
|
||||||
if "name" not in field:
|
if "name" not in field:
|
||||||
logging.error("Skipping anonymous field %s", str(field))
|
logging.error("Skipping anonymous field %s", str(field))
|
||||||
continue
|
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.attrs.add(field_name)
|
||||||
self.definitions[v].append((field_name, mctype(field["type"])))
|
self.definitions[v].append((field_name, mctype(field["type"])))
|
||||||
if field_name not in self.types:
|
if field_name not in self.types:
|
||||||
|
@ -259,11 +275,11 @@ class PacketClassWriter:
|
||||||
OBJECT.format(
|
OBJECT.format(
|
||||||
name=self.name,
|
name=self.name,
|
||||||
ids=format_dict(self.ids, depth=2),
|
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
|
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)),
|
fields="\n\t" + "\n\t".join(f"{a} : {pytype(sorted(self.hints[a]))}" for a in sorted(self.attrs)),
|
||||||
state=self.state,
|
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),
|
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
|
from urllib.request import urlretrieve
|
||||||
|
|
||||||
base_path = Path(os.getcwd())
|
base_path = Path(os.getcwd())
|
||||||
mc_path = base_path / 'aiocraft' / 'mc'
|
mc_path = base_path / 'aiocraft'
|
||||||
|
|
||||||
# Retrieve proto definitions from PrismarineJS/minecraft-data
|
# Retrieve proto definitions from PrismarineJS/minecraft-data
|
||||||
urlretrieve("https://github.com/PrismarineJS/minecraft-data/zipball/master", mc_path / "minecraft-data.zip")
|
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 = os.listdir(mc_path / f'{folder_name}/data/pc/')
|
||||||
all_versions.remove("common")
|
all_versions.remove("common")
|
||||||
all_proto_numbers = []
|
all_proto_numbers = []
|
||||||
|
@ -350,14 +369,23 @@ def compile():
|
||||||
with open(mc_path / f'{folder_name}/data/pc/{v}/version.json') as f:
|
with open(mc_path / f'{folder_name}/data/pc/{v}/version.json') as f:
|
||||||
proto_version = json.load(f)['version']
|
proto_version = json.load(f)['version']
|
||||||
|
|
||||||
if proto_version < 47 or proto_version > 1000:
|
if proto_version < 47 or proto_version > 761:
|
||||||
continue # avoid versions before 1.8
|
continue # avoid versions before 1.8 and past 1.19
|
||||||
|
|
||||||
all_proto_numbers.append(proto_version)
|
all_proto_numbers.append(proto_version)
|
||||||
|
|
||||||
with open(mc_path / f'{folder_name}/data/pc/{v}/protocol.json') as f:
|
with open(mc_path / f'{folder_name}/data/pc/{v}/protocol.json') as f:
|
||||||
data = json.load(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
|
# Build data structure containing all packets with all their definitions for different versions
|
||||||
for state in ("handshaking", "status", "login", "play"):
|
for state in ("handshaking", "status", "login", "play"):
|
||||||
for _direction in ("toClient", "toServer"):
|
for _direction in ("toClient", "toServer"):
|
||||||
|
@ -392,6 +420,15 @@ def compile():
|
||||||
_STATE_MAP = {"handshaking": 0, "status":1, "login":2, "play":3}
|
_STATE_MAP = {"handshaking": 0, "status":1, "login":2, "play":3}
|
||||||
|
|
||||||
_make_module(mc_path / 'proto', { k:"*" for k in PACKETS.keys() })
|
_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():
|
for state in PACKETS.keys():
|
||||||
_make_module(mc_path / f"proto/{state}", { k:"*" for k in PACKETS[state].keys() })
|
_make_module(mc_path / f"proto/{state}", { k:"*" for k in PACKETS[state].keys() })
|
||||||
for direction in PACKETS[state].keys():
|
for direction in PACKETS[state].keys():
|
||||||
|
|
|
@ -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()
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ build-backend = "maturin"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "aiocraft"
|
name = "aiocraft"
|
||||||
version = "0.1.0"
|
|
||||||
authors = [
|
authors = [
|
||||||
{ email = "me@alemi.dev", name = "alemi"},
|
{ email = "me@alemi.dev", name = "alemi"},
|
||||||
{ email = "francescotolomei@mail.com", name = "f-tml" },
|
{ email = "francescotolomei@mail.com", name = "f-tml" },
|
||||||
|
@ -30,6 +29,7 @@ classifiers = [
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
keywords = ["python", "rust", "mc", "minecraft", "protocol", "async", "asyncio", "definitions"]
|
keywords = ["python", "rust", "mc", "minecraft", "protocol", "async", "asyncio", "definitions"]
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pynbt",
|
"pynbt",
|
||||||
|
|
11
src/aiocraft/__init__.py
Normal file
11
src/aiocraft/__init__.py
Normal 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"
|
|
@ -6,7 +6,7 @@ from typing import Optional, Dict, Any
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
|
|
||||||
from ..definitions import GameProfile
|
from ..types import GameProfile
|
||||||
|
|
||||||
logger = logging.getLogger(__file__)
|
logger = logging.getLogger(__file__)
|
||||||
|
|
||||||
|
@ -26,10 +26,14 @@ class AuthException(Exception):
|
||||||
class AuthInterface:
|
class AuthInterface:
|
||||||
accessToken : str
|
accessToken : str
|
||||||
selectedProfile : GameProfile
|
selectedProfile : GameProfile
|
||||||
|
session_server_override : str | None = None
|
||||||
|
|
||||||
SESSION_SERVER = "https://sessionserver.mojang.com/session/minecraft"
|
SESSION_SERVER = "https://sessionserver.mojang.com/session/minecraft"
|
||||||
TIMEOUT = aiohttp.ClientTimeout(total=3)
|
TIMEOUT = aiohttp.ClientTimeout(total=3)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
async def login(self) -> 'AuthInterface':
|
async def login(self) -> 'AuthInterface':
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@ -45,27 +49,29 @@ class AuthInterface:
|
||||||
def deserialize(self, data:Dict[str, Any]):
|
def deserialize(self, data:Dict[str, Any]):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@property
|
||||||
|
def session_server(self) -> str:
|
||||||
|
return self.session_server_override or self.SESSION_SERVER
|
||||||
|
|
||||||
async def join(self, server_id) -> dict:
|
async def join(self, server_id) -> dict:
|
||||||
return await self._post(
|
return await self._post(
|
||||||
self.SESSION_SERVER + "/join",
|
self.session_server + "/join",
|
||||||
headers={"content-type":"application/json"},
|
headers={"content-type":"application/json"},
|
||||||
json={
|
json={
|
||||||
"serverId": server_id,
|
"serverId": server_id,
|
||||||
"accessToken": self.accessToken,
|
"accessToken": self.accessToken,
|
||||||
"selectedProfile": self.selectedProfile.serialize()
|
"selectedProfile": self.selectedProfile.id,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod # TODO more love for server side!
|
async def server_join(self, username:str, serverId:str, ip:Optional[str] = None):
|
||||||
async def server_join(cls, username:str, serverId:str, ip:Optional[str] = None):
|
|
||||||
params = {"username":username, "serverId":serverId}
|
params = {"username":username, "serverId":serverId}
|
||||||
if ip:
|
if ip:
|
||||||
params["ip"] = ip
|
params["ip"] = ip
|
||||||
return await cls._get(cls.SESSION_SERVER + "/hasJoined", params=params)
|
return await self._get(self.session_server + "/hasJoined", params=params)
|
||||||
|
|
||||||
@classmethod
|
async def _post(self, endpoint:str, **kwargs) -> Dict[str, Any]:
|
||||||
async def _post(cls, endpoint:str, **kwargs) -> Dict[str, Any]:
|
async with aiohttp.ClientSession(timeout=self.TIMEOUT) as session:
|
||||||
async with aiohttp.ClientSession(timeout=cls.TIMEOUT) as session:
|
|
||||||
try:
|
try:
|
||||||
async with session.post(endpoint, **kwargs) as res:
|
async with session.post(endpoint, **kwargs) as res:
|
||||||
try:
|
try:
|
||||||
|
@ -79,9 +85,8 @@ class AuthInterface:
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs)
|
raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs)
|
||||||
|
|
||||||
@classmethod
|
async def _get(self, endpoint:str, **kwargs) -> Dict[str, Any]:
|
||||||
async def _get(cls, endpoint:str, **kwargs) -> Dict[str, Any]:
|
async with aiohttp.ClientSession(timeout=self.TIMEOUT) as session:
|
||||||
async with aiohttp.ClientSession(timeout=cls.TIMEOUT) as session:
|
|
||||||
try:
|
try:
|
||||||
async with session.get(endpoint, **kwargs) as res:
|
async with session.get(endpoint, **kwargs) as res:
|
||||||
try:
|
try:
|
|
@ -1,14 +1,9 @@
|
||||||
import re
|
|
||||||
import uuid
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from typing import Dict, List, Optional, Any
|
from typing import Any
|
||||||
|
|
||||||
from yarl import URL
|
from ..types import GameProfile
|
||||||
import aiohttp
|
|
||||||
|
|
||||||
from ..definitions import GameProfile
|
|
||||||
from .interface import AuthInterface, AuthException
|
from .interface import AuthInterface, AuthException
|
||||||
|
|
||||||
class InvalidStateError(Exception):
|
class InvalidStateError(Exception):
|
||||||
|
@ -18,11 +13,11 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
client_id : str
|
client_id : str
|
||||||
client_secret : str
|
client_secret : str
|
||||||
redirect_uri : str
|
redirect_uri : str
|
||||||
code : Optional[str]
|
code : str | None
|
||||||
|
|
||||||
accessToken : str
|
accessToken : str
|
||||||
selectedProfile : GameProfile
|
selectedProfile : GameProfile
|
||||||
refreshToken : Optional[str]
|
refreshToken : str | None
|
||||||
|
|
||||||
MINECRAFT_CLIENT_ID = "00000000402b5328"
|
MINECRAFT_CLIENT_ID = "00000000402b5328"
|
||||||
OAUTH_LOGIN = "https://login.live.com/oauth20"
|
OAUTH_LOGIN = "https://login.live.com/oauth20"
|
||||||
|
@ -34,7 +29,7 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
client_id:str,
|
client_id:str,
|
||||||
client_secret:str,
|
client_secret:str,
|
||||||
redirect_uri:str="http://localhost",
|
redirect_uri:str="http://localhost",
|
||||||
code:Optional[str]=None
|
code:str|None = None
|
||||||
):
|
):
|
||||||
self.client_id = client_id
|
self.client_id = client_id
|
||||||
self.client_secret = client_secret
|
self.client_secret = client_secret
|
||||||
|
@ -44,14 +39,14 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
self.accessToken = ''
|
self.accessToken = ''
|
||||||
self.selectedProfile = GameProfile(id='', name='')
|
self.selectedProfile = GameProfile(id='', name='')
|
||||||
|
|
||||||
def serialize(self) -> Dict[str, Any]:
|
def serialize(self) -> dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
'accessToken': self.accessToken,
|
'accessToken': self.accessToken,
|
||||||
'refreshToken': self.refreshToken,
|
'refreshToken': self.refreshToken,
|
||||||
'selectedProfile': self.selectedProfile.serialize(),
|
'selectedProfile': self.selectedProfile.serialize(),
|
||||||
}
|
}
|
||||||
|
|
||||||
def deserialize(self, data:Dict[str, Any]):
|
def deserialize(self, data:dict[str, Any]):
|
||||||
self.accessToken = data['accessToken']
|
self.accessToken = data['accessToken']
|
||||||
self.refreshToken = data['refreshToken']
|
self.refreshToken = data['refreshToken']
|
||||||
self.selectedProfile = GameProfile(**data['selectedProfile'])
|
self.selectedProfile = GameProfile(**data['selectedProfile'])
|
||||||
|
@ -65,9 +60,9 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
return (
|
return (
|
||||||
self.OAUTH_LOGIN + "_authorize.srf" +
|
self.OAUTH_LOGIN + "_authorize.srf" +
|
||||||
f"?client_id={self.client_id}" +
|
f"?client_id={self.client_id}" +
|
||||||
f"&response_type=code" +
|
"&response_type=code" +
|
||||||
f"&redirect_uri={self.redirect_uri}" +
|
f"&redirect_uri={self.redirect_uri}" +
|
||||||
f"&scope=XboxLive.signin%20offline_access" +
|
"&scope=XboxLive.signin%20offline_access" +
|
||||||
f"&state={state}"
|
f"&state={state}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -181,7 +176,7 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
)
|
)
|
||||||
return auth_response['access_token']
|
return auth_response['access_token']
|
||||||
|
|
||||||
async def fetch_mcstore(self) -> Dict[str, Any]:
|
async def fetch_mcstore(self) -> dict[str, Any]:
|
||||||
"""Get the store information"""
|
"""Get the store information"""
|
||||||
logging.debug("Fetching MC Store")
|
logging.debug("Fetching MC Store")
|
||||||
return await self._get(
|
return await self._get(
|
||||||
|
@ -189,7 +184,7 @@ class MicrosoftAuthenticator(AuthInterface):
|
||||||
headers={ "Authorization": f"Bearer {self.accessToken}" },
|
headers={ "Authorization": f"Bearer {self.accessToken}" },
|
||||||
)
|
)
|
||||||
|
|
||||||
async def fetch_profile(self) -> Dict[str, Any]:
|
async def fetch_profile(self) -> dict[str, Any]:
|
||||||
"""Get player profile"""
|
"""Get player profile"""
|
||||||
logging.debug("Fetching profile")
|
logging.debug("Fetching profile")
|
||||||
return await self._get(
|
return await self._get(
|
|
@ -1,23 +1,20 @@
|
||||||
"""Minecraft identity utilities."""
|
"""Minecraft identity utilities."""
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import logging
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Optional, Dict, Any
|
from typing import Optional, Dict, Any
|
||||||
|
|
||||||
import aiohttp
|
|
||||||
|
|
||||||
from .interface import AuthInterface, AuthException
|
from .interface import AuthInterface, AuthException
|
||||||
from ..definitions import GameProfile
|
from ..types import GameProfile
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MojangAuthenticator(AuthInterface):
|
class MojangAuthenticator(AuthInterface):
|
||||||
username : str
|
username : str
|
||||||
password : Optional[str]
|
password : Optional[str]
|
||||||
accessToken : str
|
|
||||||
clientToken : str
|
clientToken : str
|
||||||
selectedProfile : GameProfile
|
auth_server_override : str | None = None
|
||||||
|
|
||||||
AGENT_NAME = "Minecraft"
|
AGENT_NAME = "Minecraft"
|
||||||
AGENT_VERSION = 1
|
AGENT_VERSION = 1
|
||||||
|
@ -25,12 +22,19 @@ class MojangAuthenticator(AuthInterface):
|
||||||
CONTENT_TYPE = "application/json"
|
CONTENT_TYPE = "application/json"
|
||||||
HEADERS = {"content-type": CONTENT_TYPE}
|
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.username = username
|
||||||
self.password = password
|
self.password = password
|
||||||
self.accessToken = ""
|
self.accessToken = ""
|
||||||
self.clientToken = ""
|
self.clientToken = ""
|
||||||
self.selectedProfile = GameProfile("", username)
|
self.selectedProfile = GameProfile("", username)
|
||||||
|
self.session_server_override = session_server_override
|
||||||
|
self.auth_server_override = auth_server_override
|
||||||
|
|
||||||
def __equals__(self, other) -> bool:
|
def __equals__(self, other) -> bool:
|
||||||
if not isinstance(other, self.__class__):
|
if not isinstance(other, self.__class__):
|
||||||
|
@ -48,6 +52,16 @@ class MojangAuthenticator(AuthInterface):
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return repr(self)
|
return repr(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def auth_server(self) -> str:
|
||||||
|
return self.auth_server_override or self.AUTH_SERVER
|
||||||
|
|
||||||
|
@property
|
||||||
|
def code(self) -> str:
|
||||||
|
if self.username and self.password:
|
||||||
|
return self.username
|
||||||
|
return ""
|
||||||
|
|
||||||
def serialize(self) -> Dict[str, Any]:
|
def serialize(self) -> Dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"username":self.username,
|
"username":self.username,
|
||||||
|
@ -75,7 +89,7 @@ class MojangAuthenticator(AuthInterface):
|
||||||
|
|
||||||
payload["clientToken"] = uuid.uuid4().hex # don't include this to invalidate all other sessions
|
payload["clientToken"] = uuid.uuid4().hex # don't include this to invalidate all other sessions
|
||||||
|
|
||||||
res = await self._post(self.AUTH_SERVER + "/authenticate", json=payload)
|
res = await self._post(self.auth_server + "/authenticate", json=payload)
|
||||||
|
|
||||||
self.accessToken=res["accessToken"]
|
self.accessToken=res["accessToken"]
|
||||||
self.clientToken=res["clientToken"]
|
self.clientToken=res["clientToken"]
|
||||||
|
@ -83,11 +97,10 @@ class MojangAuthenticator(AuthInterface):
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@classmethod
|
async def sign_out(self, username:str, password:str) -> dict:
|
||||||
async def sign_out(cls, username:str, password:str) -> dict:
|
return await self._post(
|
||||||
return await cls._post(
|
self.auth_server + "/signout",
|
||||||
cls.AUTH_SERVER + "/signout",
|
headers=self.HEADERS,
|
||||||
headers=cls.HEADERS,
|
|
||||||
json={
|
json={
|
||||||
"username": username,
|
"username": username,
|
||||||
"password": password
|
"password": password
|
||||||
|
@ -98,7 +111,7 @@ class MojangAuthenticator(AuthInterface):
|
||||||
if not self.accessToken or not self.clientToken:
|
if not self.accessToken or not self.clientToken:
|
||||||
raise AuthException("/refresh", 0, {"message":"No access token or client token"}, {})
|
raise AuthException("/refresh", 0, {"message":"No access token or client token"}, {})
|
||||||
res = await self._post(
|
res = await self._post(
|
||||||
self.AUTH_SERVER + "/refresh",
|
self.auth_server + "/refresh",
|
||||||
headers=self.HEADERS,
|
headers=self.HEADERS,
|
||||||
json={
|
json={
|
||||||
"accessToken": self.accessToken,
|
"accessToken": self.accessToken,
|
||||||
|
@ -110,7 +123,7 @@ class MojangAuthenticator(AuthInterface):
|
||||||
self.clientToken = res["clientToken"]
|
self.clientToken = res["clientToken"]
|
||||||
self.selectedProfile = GameProfile(**res["selectedProfile"])
|
self.selectedProfile = GameProfile(**res["selectedProfile"])
|
||||||
|
|
||||||
if "user" in res:
|
if "user" in res and res["user"]:
|
||||||
self.username = res["user"]["username"]
|
self.username = res["user"]["username"]
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
@ -122,7 +135,7 @@ class MojangAuthenticator(AuthInterface):
|
||||||
if clientToken:
|
if clientToken:
|
||||||
payload["clientToken"] = self.clientToken
|
payload["clientToken"] = self.clientToken
|
||||||
await self._post(
|
await self._post(
|
||||||
self.AUTH_SERVER + "/validate",
|
self.auth_server + "/validate",
|
||||||
headers=self.HEADERS,
|
headers=self.HEADERS,
|
||||||
json=payload,
|
json=payload,
|
||||||
)
|
)
|
||||||
|
@ -130,7 +143,7 @@ class MojangAuthenticator(AuthInterface):
|
||||||
|
|
||||||
async def invalidate(self) -> AuthInterface:
|
async def invalidate(self) -> AuthInterface:
|
||||||
await self._post(
|
await self._post(
|
||||||
self.AUTH_SERVER + "/invalidate",
|
self.auth_server + "/invalidate",
|
||||||
headers=self.HEADERS,
|
headers=self.HEADERS,
|
||||||
json= {
|
json= {
|
||||||
"accessToken": self.accessToken,
|
"accessToken": self.accessToken,
|
|
@ -1,77 +1,74 @@
|
||||||
import asyncio
|
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
import uuid
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from asyncio import Task
|
from asyncio import Task
|
||||||
from enum import Enum
|
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from typing import Dict, List, Callable, Type, Optional, Tuple, AsyncIterator, Any, Set
|
from typing import Any, Type
|
||||||
|
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
from .dispatcher import Dispatcher
|
from .dispatcher import Dispatcher
|
||||||
from .mc.packet import Packet
|
from .auth import AuthInterface, AuthException
|
||||||
from .mc.auth import AuthInterface, AuthException, MojangAuthenticator, MicrosoftAuthenticator
|
from .types import ConnectionState
|
||||||
from .mc.definitions import Dimension, Difficulty, Gamemode, ConnectionState
|
from .packet import Packet
|
||||||
from .mc.proto.status.serverbound import PacketPing, PacketPingStart
|
from .proto.status.serverbound import PacketPing, PacketPingStart
|
||||||
from .mc.proto.status.clientbound import PacketServerInfo, PacketPing as PacketPong
|
from .proto.status.clientbound import PacketServerInfo, PacketPing as PacketPong
|
||||||
from .mc.proto.handshaking.serverbound import PacketSetProtocol
|
from .proto.handshaking.serverbound import PacketSetProtocol
|
||||||
from .mc.proto.play.serverbound import PacketKeepAlive as PacketKeepAliveResponse
|
from .proto.play.serverbound import PacketKeepAlive as PacketKeepAliveResponse
|
||||||
from .mc.proto.play.clientbound import PacketKeepAlive, PacketSetCompression, PacketKickDisconnect
|
from .proto.play.clientbound import PacketKeepAlive, PacketSetCompression, PacketKickDisconnect
|
||||||
from .mc.proto.login.serverbound import PacketLoginStart, PacketEncryptionBegin as PacketEncryptionResponse
|
from .proto.login.serverbound import PacketLoginStart, PacketEncryptionBegin as PacketEncryptionResponse
|
||||||
from .mc.proto.login.clientbound import (
|
from .proto.login.clientbound import (
|
||||||
PacketCompress, PacketDisconnect, PacketEncryptionBegin, PacketLoginPluginRequest, PacketSuccess
|
PacketCompress, PacketDisconnect, PacketEncryptionBegin, PacketLoginPluginRequest, PacketSuccess
|
||||||
)
|
)
|
||||||
from .util import encryption, helpers
|
from .util import encryption, helpers
|
||||||
|
|
||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
class MinecraftClient:
|
class AbstractMinecraftClient:
|
||||||
online_mode:bool
|
online_mode: bool
|
||||||
authenticator:AuthInterface
|
authenticator: AuthInterface
|
||||||
dispatcher : Dispatcher
|
logger: logging.Logger
|
||||||
logger : logging.Logger
|
_dispatcher: Dispatcher | None
|
||||||
_authenticated : bool
|
_authenticated: bool
|
||||||
_processing : bool
|
_processing: bool
|
||||||
_worker : Task
|
_worker: Task
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
server:str,
|
|
||||||
authenticator:AuthInterface,
|
authenticator:AuthInterface,
|
||||||
online_mode:bool = True,
|
online_mode:bool = True,
|
||||||
force_port:int = 0,
|
|
||||||
resolve_srv:bool = True,
|
|
||||||
):
|
):
|
||||||
self.logger = LOGGER.getChild(f"on({server})")
|
self.logger = LOGGER.getChild(f"as({authenticator.selectedProfile.name})")
|
||||||
self.online_mode = online_mode
|
self.online_mode = online_mode
|
||||||
self.authenticator = authenticator
|
self.authenticator = authenticator
|
||||||
self._authenticated = False
|
self._authenticated = False
|
||||||
self._processing = False
|
self._processing = False
|
||||||
|
self._dispatcher = None
|
||||||
|
|
||||||
host = server
|
def resolve_srv(self, server: str) -> tuple[str, int]:
|
||||||
port = force_port or 25565
|
try:
|
||||||
|
answ = dns.resolver.resolve(f"_minecraft._tcp.{server}", "SRV")
|
||||||
if resolve_srv:
|
# TODO can we just use the 1st record?
|
||||||
try:
|
host = str(answ[0].target).rstrip('.')
|
||||||
answ = dns.resolver.resolve(f"_minecraft._tcp.{server}", "SRV")
|
port = answ[0].port
|
||||||
# TODO can we just use the 1st record?
|
return (host, port)
|
||||||
host = str(answ[0].target).rstrip('.')
|
except Exception: # TODO what can I catch? dns.resolver.exception doesn't always exist, wtf
|
||||||
port = answ[0].port
|
self.logger.warning("Failed resolving SRV record for '%s'", server)
|
||||||
except Exception: # TODO what can I catch? dns.resolver.exception doesn't always exist, wtf
|
return (server, 25565)
|
||||||
self.logger.warning("Failed resolving SRV record for '%s'", server)
|
|
||||||
|
|
||||||
self.dispatcher = Dispatcher().set_host(host, port)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def connected(self) -> bool:
|
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):
|
@property
|
||||||
await self.dispatcher.write(packet, wait)
|
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):
|
async def authenticate(self):
|
||||||
if self._authenticated:
|
if self._authenticated:
|
||||||
|
@ -89,46 +86,78 @@ class MinecraftClient:
|
||||||
self.logger.info("Logged in")
|
self.logger.info("Logged in")
|
||||||
self._authenticated = True
|
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"""
|
"""Make a mini connection to asses server status and version"""
|
||||||
|
if not port:
|
||||||
|
host, port = self.resolve_srv(host)
|
||||||
|
self._dispatcher = Dispatcher(
|
||||||
|
host=host,
|
||||||
|
port=port,
|
||||||
|
proto=proto,
|
||||||
|
log_ignored_packets=log_ignored_packets,
|
||||||
|
whitelist=whitelist
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
await self.dispatcher.set_host(host, port).connect()
|
await self.dispatcher.connect()
|
||||||
await self._handshake(ConnectionState.STATUS)
|
await self._handshake(ConnectionState.STATUS)
|
||||||
return await self._status(ping)
|
return await self._status(ping)
|
||||||
finally:
|
finally:
|
||||||
if self.dispatcher.connected:
|
if self.dispatcher.connected:
|
||||||
await self.dispatcher.disconnect()
|
await self.dispatcher.disconnect()
|
||||||
|
self._dispatcher = None
|
||||||
|
|
||||||
async def join(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:
|
if self.online_mode:
|
||||||
await self.authenticate()
|
await self.authenticate()
|
||||||
try:
|
try:
|
||||||
await self.dispatcher.set_host(host, port).set_proto(proto).connect()
|
await self.dispatcher.connect()
|
||||||
await self._handshake(ConnectionState.LOGIN)
|
await self._handshake(ConnectionState.LOGIN)
|
||||||
if await self._login():
|
if await self._login():
|
||||||
await self._play()
|
await self._play()
|
||||||
finally:
|
finally:
|
||||||
if self.dispatcher.connected:
|
if self.dispatcher.connected:
|
||||||
await self.dispatcher.disconnect()
|
await self.dispatcher.disconnect()
|
||||||
|
self._dispatcher = None
|
||||||
|
|
||||||
async def _handshake(self, state:ConnectionState):
|
async def _handshake(self, state:ConnectionState):
|
||||||
await self.dispatcher.write(
|
await self.dispatcher.write(
|
||||||
PacketSetProtocol(
|
PacketSetProtocol(
|
||||||
self.dispatcher._proto,
|
protocolVersion=self.dispatcher.proto,
|
||||||
protocolVersion=self.dispatcher._proto,
|
serverHost=self.dispatcher.host,
|
||||||
serverHost=self.dispatcher._host,
|
serverPort=self.dispatcher.port,
|
||||||
serverPort=self.dispatcher._port,
|
|
||||||
nextState=state.value
|
nextState=state.value
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _status(self, ping:bool=False) -> Dict[str, Any]:
|
async def _status(self, ping:bool=False) -> dict[str, Any]:
|
||||||
self.dispatcher.state = ConnectionState.STATUS
|
self.dispatcher.promote(ConnectionState.STATUS)
|
||||||
await self.dispatcher.write(
|
await self.dispatcher.write(PacketPingStart()) #empty packet
|
||||||
PacketPingStart(self.dispatcher._proto) #empty packet
|
|
||||||
)
|
|
||||||
#Response
|
#Response
|
||||||
data : Dict[str, Any] = {}
|
data : dict[str, Any] = {}
|
||||||
ping_id : int = 0
|
ping_id : int = 0
|
||||||
ping_time : float = 0
|
ping_time : float = 0
|
||||||
async for packet in self.dispatcher.packets():
|
async for packet in self.dispatcher.packets():
|
||||||
|
@ -140,10 +169,7 @@ class MinecraftClient:
|
||||||
ping_id = int(time())
|
ping_id = int(time())
|
||||||
ping_time = time()
|
ping_time = time()
|
||||||
await self.dispatcher.write(
|
await self.dispatcher.write(
|
||||||
PacketPing(
|
PacketPing(time=ping_id)
|
||||||
self.dispatcher._proto,
|
|
||||||
time=ping_id,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
if isinstance(packet, PacketPong):
|
if isinstance(packet, PacketPong):
|
||||||
if packet.time == ping_id:
|
if packet.time == ping_id:
|
||||||
|
@ -152,12 +178,9 @@ class MinecraftClient:
|
||||||
return data
|
return data
|
||||||
|
|
||||||
async def _login(self) -> bool:
|
async def _login(self) -> bool:
|
||||||
self.dispatcher.state = ConnectionState.LOGIN
|
self.dispatcher.promote(ConnectionState.LOGIN)
|
||||||
await self.dispatcher.write(
|
await self.dispatcher.write(
|
||||||
PacketLoginStart(
|
PacketLoginStart(username=self.authenticator.selectedProfile.name)
|
||||||
self.dispatcher._proto,
|
|
||||||
username=self.authenticator.selectedProfile.name
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
async for packet in self.dispatcher.packets():
|
async for packet in self.dispatcher.packets():
|
||||||
if isinstance(packet, PacketEncryptionBegin):
|
if isinstance(packet, PacketEncryptionBegin):
|
||||||
|
@ -186,7 +209,6 @@ class MinecraftClient:
|
||||||
else:
|
else:
|
||||||
self.logger.warning("Server gave an offline-mode serverId but still requested Encryption")
|
self.logger.warning("Server gave an offline-mode serverId but still requested Encryption")
|
||||||
encryption_response = PacketEncryptionResponse(
|
encryption_response = PacketEncryptionResponse(
|
||||||
self.dispatcher._proto,
|
|
||||||
sharedSecret=encrypted_secret,
|
sharedSecret=encrypted_secret,
|
||||||
verifyToken=token
|
verifyToken=token
|
||||||
)
|
)
|
||||||
|
@ -206,7 +228,7 @@ class MinecraftClient:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def _play(self):
|
async def _play(self):
|
||||||
self.dispatcher.state = ConnectionState.PLAY
|
self.dispatcher.promote(ConnectionState.PLAY)
|
||||||
async for packet in self.dispatcher.packets():
|
async for packet in self.dispatcher.packets():
|
||||||
self.logger.debug("[ * ] Processing %s", packet.__class__.__name__)
|
self.logger.debug("[ * ] Processing %s", packet.__class__.__name__)
|
||||||
if isinstance(packet, PacketSetCompression):
|
if isinstance(packet, PacketSetCompression):
|
|
@ -1,19 +1,18 @@
|
||||||
import io
|
import io
|
||||||
import asyncio
|
import asyncio
|
||||||
import contextlib
|
|
||||||
import zlib
|
import zlib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from typing import Type, AsyncIterator
|
||||||
from asyncio import StreamReader, StreamWriter, Queue, Task
|
from asyncio import StreamReader, StreamWriter, Queue, Task
|
||||||
from enum import Enum
|
|
||||||
from typing import List, Dict, Set, Optional, AsyncIterator, Type, Union
|
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
|
||||||
from cryptography.hazmat.primitives.ciphers import CipherContext
|
from cryptography.hazmat.primitives.ciphers import CipherContext
|
||||||
|
|
||||||
from .mc import proto as minecraft_protocol
|
from . import proto as minecraft_protocol
|
||||||
from .mc.types import VarInt, Context
|
from .primitives import VarInt, Context
|
||||||
from .mc.packet import Packet
|
from .packet import Packet
|
||||||
from .mc.definitions import ConnectionState
|
from .types import ConnectionState
|
||||||
from .util import encryption
|
from .util import encryption
|
||||||
|
|
||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -29,11 +28,11 @@ class Dispatcher:
|
||||||
_is_server : bool # True when receiving packets from clients
|
_is_server : bool # True when receiving packets from clients
|
||||||
|
|
||||||
_down : StreamReader
|
_down : StreamReader
|
||||||
_reader : Optional[Task]
|
_reader : Task | None
|
||||||
_decryptor : CipherContext
|
_decryptor : CipherContext
|
||||||
|
|
||||||
_up : StreamWriter
|
_up : StreamWriter
|
||||||
_writer : Optional[Task]
|
_writer : Task | None
|
||||||
_encryptor : CipherContext
|
_encryptor : CipherContext
|
||||||
|
|
||||||
_dispatching : bool
|
_dispatching : bool
|
||||||
|
@ -41,8 +40,8 @@ class Dispatcher:
|
||||||
_incoming : Queue
|
_incoming : Queue
|
||||||
_outgoing : Queue
|
_outgoing : Queue
|
||||||
|
|
||||||
_packet_whitelist : Optional[Set[Type[Packet]]]
|
_packet_whitelist : set[Type[Packet]] | None
|
||||||
_packet_id_whitelist : Optional[Set[int]]
|
_packet_id_whitelist : set[int] | None
|
||||||
|
|
||||||
_log_ignored_packets : bool
|
_log_ignored_packets : bool
|
||||||
|
|
||||||
|
@ -52,20 +51,39 @@ class Dispatcher:
|
||||||
_proto : int
|
_proto : int
|
||||||
|
|
||||||
_encryption : bool
|
_encryption : bool
|
||||||
_compression : Optional[int]
|
_compression : int | None
|
||||||
|
|
||||||
state : ConnectionState # TODO make getter/setter ?
|
state : ConnectionState # TODO make getter/setter ?
|
||||||
logger : logging.Logger
|
logger : logging.Logger
|
||||||
|
|
||||||
def __init__(self, server:bool = False):
|
def __init__(
|
||||||
self._proto = 757
|
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._is_server = server
|
||||||
self._host = "localhost"
|
|
||||||
self._port = 25565
|
|
||||||
self._dispatching = False
|
self._dispatching = False
|
||||||
self._packet_whitelist = None
|
self._packet_whitelist = None
|
||||||
self._packet_id_whitelist = None
|
self._packet_id_whitelist = None
|
||||||
self._log_ignored_packets = 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
|
@property
|
||||||
def proto(self) -> int:
|
def proto(self) -> int:
|
||||||
|
@ -84,7 +102,7 @@ class Dispatcher:
|
||||||
return self._encryption
|
return self._encryption
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def compression(self) -> Optional[int]:
|
def compression(self) -> int | None:
|
||||||
return self._compression
|
return self._compression
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -112,7 +130,7 @@ class Dispatcher:
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass # so we recheck self.connected
|
pass # so we recheck self.connected
|
||||||
|
|
||||||
def encrypt(self, secret:Optional[bytes]=None) -> 'Dispatcher':
|
def encrypt(self, secret: bytes | None = None):
|
||||||
if secret is not None:
|
if secret is not None:
|
||||||
cipher = encryption.create_AES_cipher(secret)
|
cipher = encryption.create_AES_cipher(secret)
|
||||||
self._encryptor = cipher.encryptor()
|
self._encryptor = cipher.encryptor()
|
||||||
|
@ -122,52 +140,20 @@ class Dispatcher:
|
||||||
else:
|
else:
|
||||||
self._encryption = False
|
self._encryption = False
|
||||||
self.logger.info("Encryption disabled")
|
self.logger.info("Encryption disabled")
|
||||||
return self
|
|
||||||
|
|
||||||
def whitelist(self, ids:Optional[List[Type[Packet]]]) -> 'Dispatcher':
|
def update_compression_threshold(self, threshold: int | None):
|
||||||
self._packet_whitelist = set(ids) if ids is not None else None
|
self._compression = threshold or 0
|
||||||
if self._packet_whitelist:
|
|
||||||
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKeepAlive)
|
|
||||||
self._packet_whitelist.add(minecraft_protocol.play.clientbound.PacketKickDisconnect)
|
|
||||||
self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist)) if self._packet_whitelist else None
|
|
||||||
return self
|
|
||||||
|
|
||||||
def set_host(
|
|
||||||
self,
|
|
||||||
host:Optional[str]="",
|
|
||||||
port:Optional[int]=0,
|
|
||||||
) -> 'Dispatcher':
|
|
||||||
self._host = host or self._host
|
|
||||||
self._port = port or self._port
|
|
||||||
self.logger = LOGGER.getChild(f"on({self._host}:{self._port})")
|
|
||||||
return self
|
|
||||||
|
|
||||||
def set_proto(self, proto:Optional[int]=757) -> 'Dispatcher':
|
|
||||||
self._proto = proto or self._proto
|
|
||||||
if self._packet_whitelist:
|
|
||||||
self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist))
|
|
||||||
return self
|
|
||||||
|
|
||||||
def set_compression(self, threshold:Optional[int] = None) -> 'Dispatcher':
|
|
||||||
self._compression = threshold
|
|
||||||
return self
|
|
||||||
|
|
||||||
def set_state(self, state:Optional[ConnectionState]=ConnectionState.HANDSHAKING) -> 'Dispatcher':
|
|
||||||
self.state = state or self.state
|
|
||||||
return self
|
|
||||||
|
|
||||||
def log_ignored_packets(self, log:bool) -> 'Dispatcher':
|
|
||||||
self._log_ignored_packets = log
|
|
||||||
return self
|
|
||||||
|
|
||||||
async def connect(self,
|
async def connect(self,
|
||||||
reader : Optional[StreamReader] = None,
|
reader : StreamReader | None = None,
|
||||||
writer : Optional[StreamWriter] = None,
|
writer : StreamWriter | None = None,
|
||||||
queue_size : int = 100,
|
queue_size : int = 100,
|
||||||
) -> 'Dispatcher':
|
):
|
||||||
if self.connected:
|
if self.connected:
|
||||||
raise InvalidState("Dispatcher already connected")
|
raise InvalidState("Dispatcher already connected")
|
||||||
|
|
||||||
|
self.logger = LOGGER.getChild(f"on({self._host}:{self._port})")
|
||||||
|
|
||||||
self._encryption = False
|
self._encryption = False
|
||||||
self._compression = None
|
self._compression = None
|
||||||
self._incoming = Queue(queue_size)
|
self._incoming = Queue(queue_size)
|
||||||
|
@ -191,7 +177,7 @@ class Dispatcher:
|
||||||
self.logger.info("Connected")
|
self.logger.info("Connected")
|
||||||
return self
|
return self
|
||||||
|
|
||||||
async def disconnect(self, block:bool=True) -> 'Dispatcher':
|
async def disconnect(self, block:bool=True):
|
||||||
self._dispatching = False
|
self._dispatching = False
|
||||||
if block and self._writer and self._reader:
|
if block and self._writer and self._reader:
|
||||||
await asyncio.gather(self._writer, self._reader)
|
await asyncio.gather(self._writer, self._reader)
|
||||||
|
@ -233,7 +219,10 @@ class Dispatcher:
|
||||||
if not self._proto:
|
if not self._proto:
|
||||||
raise InvalidState("Cannot access registries from invalid protocol")
|
raise InvalidState("Cannot access registries from invalid protocol")
|
||||||
|
|
||||||
proto_reg = reg[self._proto]
|
proto = self._proto
|
||||||
|
while proto not in reg:
|
||||||
|
proto -= 1
|
||||||
|
proto_reg = reg[proto]
|
||||||
|
|
||||||
return proto_reg[packet_id]
|
return proto_reg[packet_id]
|
||||||
|
|
||||||
|
@ -311,7 +300,7 @@ class Dispatcher:
|
||||||
self.logger.debug("%s", buffer.getvalue())
|
self.logger.debug("%s", buffer.getvalue())
|
||||||
await self.disconnect(block=False)
|
await self.disconnect(block=False)
|
||||||
|
|
||||||
async def _up_worker(self, timeout=1):
|
async def _up_worker(self, timeout:float = 1.):
|
||||||
while self._dispatching:
|
while self._dispatching:
|
||||||
try:
|
try:
|
||||||
packet : Packet = await asyncio.wait_for(self._outgoing.get(), timeout=timeout)
|
packet : Packet = await asyncio.wait_for(self._outgoing.get(), timeout=timeout)
|
||||||
|
@ -322,7 +311,7 @@ class Dispatcher:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
buffer = packet.serialize()
|
buffer = packet.serialize(self.proto)
|
||||||
length = len(buffer.getvalue()) # ewww TODO
|
length = len(buffer.getvalue()) # ewww TODO
|
||||||
|
|
||||||
if self._compression is not None:
|
if self._compression is not None:
|
|
@ -1,47 +1,69 @@
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
from asyncio import Event
|
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
|
MAX_FIELD_PRINT_SIZE = 255
|
||||||
|
|
||||||
class Packet:
|
class Packet:
|
||||||
__slots__ = 'id', 'definition', '_processed', '_proto', '_state'
|
__slots__ = 'id', 'definition', '_processed', '_proto', '_state'
|
||||||
|
|
||||||
id : int
|
id : int | None
|
||||||
definition : Tuple[Tuple[str, Type]]
|
definition : List[Tuple[str, Type]] | None
|
||||||
_processed : Event
|
_processed : Event
|
||||||
_proto : int
|
_proto : int | None
|
||||||
_state : int
|
_state : int
|
||||||
|
|
||||||
_ids : Dict[int, int] # definitions are compiled at install time
|
_ids : Dict[int, int] # definitions are compiled at install time
|
||||||
_definitions : Dict[int, 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):
|
def __init__(self, **kwargs):
|
||||||
self._proto = proto
|
if not self._definitions:
|
||||||
|
raise NotImplementedError("cannot instantiate Packet base class")
|
||||||
|
self.id = None
|
||||||
|
self.definition = None
|
||||||
|
self._proto = None
|
||||||
self._processed = Event()
|
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.definition = self._definitions[proto]
|
||||||
self.id = self._ids[proto]
|
self.id = self._ids[proto]
|
||||||
for name, t in self.definition:
|
return self.id
|
||||||
if name in kwargs and kwargs[name] is not None:
|
|
||||||
setattr(self, name, kwargs[name])
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def processed(self) -> Event:
|
def processed(self) -> Event:
|
||||||
"""Returns an event which will be set only after the packet has been processed (either sent or raised exc)"""
|
"""Returns an event which will be set only after the packet has been processed (either sent or raised exc)"""
|
||||||
return self._processed
|
return self._processed
|
||||||
|
|
||||||
|
@property
|
||||||
|
def slots(self) -> list[str]:
|
||||||
|
if self.definition is not None:
|
||||||
|
return [k for k, t in self.definition]
|
||||||
|
return [k for k in self.__slots__]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def deserialize(cls, proto:int, buffer:io.BytesIO):
|
def deserialize(cls, proto:int, buffer:io.BytesIO):
|
||||||
ctx = Context(_proto=proto)
|
ctx = Context(_proto=proto)
|
||||||
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))
|
setattr(ctx, k, t.read(buffer, ctx=ctx))
|
||||||
return cls(proto, **ctx.serialize())
|
packet = cls(**ctx.serialize())
|
||||||
# return cls(proto, **{ name : t.read(buffer) for (name, t) in cls._definitions[proto] })
|
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)
|
ctx = Context(_proto=self._proto)
|
||||||
buf = io.BytesIO()
|
buf = io.BytesIO()
|
||||||
VarInt.write(self.id, buf, ctx=ctx)
|
VarInt.write(self.id, buf, ctx=ctx)
|
||||||
|
@ -55,9 +77,11 @@ class Packet:
|
||||||
def __eq__(self, other) -> bool:
|
def __eq__(self, other) -> bool:
|
||||||
if not isinstance(other, self.__class__):
|
if not isinstance(other, self.__class__):
|
||||||
return False
|
return False
|
||||||
if self._proto != other._proto:
|
if self._proto is not None \
|
||||||
|
and other._proto is not None \
|
||||||
|
and self._proto != other._proto:
|
||||||
return False
|
return False
|
||||||
for name, t in self.definition:
|
for name in self.slots:
|
||||||
if getattr(self, name) != getattr(other, name):
|
if getattr(self, name) != getattr(other, name):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -68,13 +92,13 @@ class Packet:
|
||||||
obj["_proto"] = self._proto
|
obj["_proto"] = self._proto
|
||||||
obj["_state"] = self._state
|
obj["_state"] = self._state
|
||||||
obj["_id"] = f"0x{self.id:02x}"
|
obj["_id"] = f"0x{self.id:02x}"
|
||||||
for key, t in self.definition:
|
for key in self.slots:
|
||||||
obj[key] = getattr(self, key, None)
|
obj[key] = getattr(self, key, None)
|
||||||
return json.dumps(obj, indent=2, default=str)
|
return json.dumps(obj, indent=2, default=str)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
trunc = lambda x : x if len(x) < MAX_FIELD_PRINT_SIZE else "[blob]"
|
trunc = lambda x : x if len(x) < MAX_FIELD_PRINT_SIZE else "[blob]"
|
||||||
attrs = (f"{key}={trunc(repr(getattr(self, key, None)))}" for (key, 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)})"
|
return f"{self.__class__.__name__}({self._proto}, {', '.join(attrs)})"
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import io
|
import io
|
||||||
import struct
|
import struct
|
||||||
import asyncio
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import pynbt
|
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):
|
def __init__(self, **kwargs):
|
||||||
for k, v in kwargs.items():
|
for k, v in kwargs.items():
|
||||||
setattr(self, k, v)
|
setattr(self, k, v)
|
||||||
|
@ -29,7 +28,7 @@ class Context(object):
|
||||||
values = ( f"{k}={repr(v)}" for k,v in vars(self).items() )
|
values = ( f"{k}={repr(v)}" for k,v in vars(self).items() )
|
||||||
return f"Context({', '.join(values)})"
|
return f"Context({', '.join(values)})"
|
||||||
|
|
||||||
class Type(object):
|
class Type:
|
||||||
pytype : Union[type, Callable] = lambda x : x
|
pytype : Union[type, Callable] = lambda x : x
|
||||||
|
|
||||||
def write(self, data:Any, buffer:io.BytesIO, ctx:Context) -> None:
|
def write(self, data:Any, buffer:io.BytesIO, ctx:Context) -> None:
|
||||||
|
@ -113,10 +112,11 @@ class NBTType(Type):
|
||||||
pynbt.NBTFile(value=data).save(buffer)
|
pynbt.NBTFile(value=data).save(buffer)
|
||||||
|
|
||||||
def read(self, buffer:io.BytesIO, ctx:Context) -> Optional[dict]:
|
def read(self, buffer:io.BytesIO, ctx:Context) -> Optional[dict]:
|
||||||
|
index = buffer.tell()
|
||||||
head = Byte.read(buffer, ctx)
|
head = Byte.read(buffer, ctx)
|
||||||
if head == 0x0:
|
if head == 0x0:
|
||||||
return None
|
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))
|
return nbt_to_py(pynbt.NBTFile(io=buffer))
|
||||||
|
|
||||||
NBTTag = NBTType()
|
NBTTag = NBTType()
|
||||||
|
@ -216,20 +216,32 @@ class PositionType(Type):
|
||||||
pytype : type = tuple
|
pytype : type = tuple
|
||||||
MAX_SIZE : int = 8
|
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):
|
def write(self, data:tuple, buffer:io.BytesIO, ctx:Context):
|
||||||
packed = ((0x3FFFFFF & data[0]) << 38) \
|
if ctx._proto <= 441:
|
||||||
| ((0xFFF & data[1]) << 26) \
|
packed = ((0x3FFFFFF & data[0]) << 38) \
|
||||||
| (0x3FFFFFF & data[2])
|
| ((0xFFF & data[1]) << 26) \
|
||||||
UnsignedLong.write(packed, buffer, ctx=ctx)
|
| (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:
|
def read(self, buffer:io.BytesIO, ctx:Context) -> tuple:
|
||||||
packed = UnsignedLong.read(buffer, ctx)
|
if ctx._proto <= 441:
|
||||||
x = twos_comp(packed >> 38, 26)
|
packed = UnsignedLong.read(buffer, ctx)
|
||||||
y = (packed >> 26) & 0xFFF
|
x = twos_comp(packed >> 38, 26)
|
||||||
z = twos_comp(packed & 0x3FFFFFF, 26)
|
y = (packed >> 26) & 0xFFF
|
||||||
return (x, y, z)
|
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()
|
Position = PositionType()
|
||||||
|
|
||||||
|
@ -290,10 +302,20 @@ class SwitchType(Type):
|
||||||
field : str
|
field : str
|
||||||
mappings : Dict[Any, Type]
|
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.field = watch
|
||||||
self.mappings = mappings
|
|
||||||
self.default = default
|
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):
|
def write(self, data:Any, buffer:io.BytesIO, ctx:Context):
|
||||||
watched = getattr(ctx, self.field, None)
|
watched = getattr(ctx, self.field, None)
|
||||||
|
@ -346,7 +368,7 @@ class SlotType(Type):
|
||||||
new_way = ctx._proto > 340
|
new_way = ctx._proto > 340
|
||||||
check_type = Boolean if new_way else Short
|
check_type = Boolean if new_way else Short
|
||||||
val = check_type.read(buffer, ctx)
|
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:
|
if new_way:
|
||||||
slot["id"] = VarInt.read(buffer, ctx)
|
slot["id"] = VarInt.read(buffer, ctx)
|
||||||
else:
|
else:
|
||||||
|
@ -359,45 +381,29 @@ class SlotType(Type):
|
||||||
|
|
||||||
Slot = SlotType()
|
Slot = SlotType()
|
||||||
|
|
||||||
# wiki.vg does not document these anymore. Minecraft 1.12.2 has these as metadata types
|
class ParticleType(Type):
|
||||||
_ENTITY_METADATA_TYPES = {
|
pytype : type = dict
|
||||||
0 : Byte,
|
|
||||||
1 : VarInt,
|
def write(self, data:dict, buffer:io.BytesIO, ctx:Context):
|
||||||
2 : Float,
|
raise NotImplementedError
|
||||||
3 : String,
|
|
||||||
4 : Chat,
|
# TODO this changes across versions!
|
||||||
5 : Slot,
|
def read(self, data:dict, buffer:io.BytesIO, ctx:Context):
|
||||||
6 : Boolean,
|
from aiocraft.proto.ext import ParticlesDefinitions
|
||||||
7 : StructType(("x", Float), ("y", Float), ("z", Float)), # Rotation
|
proto = ctx._proto
|
||||||
8 : Position,
|
while proto not in ParticlesDefinitions._definitions:
|
||||||
9 : OptionalType(Position),
|
proto -= 1
|
||||||
10 : VarInt, # Direction (Down = 0, Up = 1, North = 2, South = 3, West = 4, East = 5)
|
data_id = VarInt.read(buffer, ctx)
|
||||||
11 : OptionalType(UUID),
|
if data_id in ParticlesDefinitions._definitions[proto]:
|
||||||
12 : VarInt, # OptBlockID (VarInt) 0 for absent (implies air); otherwise, a block state ID as per the global palette
|
t = ParticlesDefinitions._definitions[proto][data_id]
|
||||||
13 : NBTTag,
|
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):
|
class EntityMetadataType(Type):
|
||||||
pytype : type = dict
|
pytype : type = dict
|
||||||
|
@ -407,7 +413,11 @@ class EntityMetadataType(Type):
|
||||||
buffer.write(b'\xFF')
|
buffer.write(b'\xFF')
|
||||||
|
|
||||||
def read(self, buffer:io.BytesIO, ctx:Context) -> Dict[int, Any]:
|
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] = {}
|
out : Dict[int, Any] = {}
|
||||||
while True:
|
while True:
|
||||||
index = UnsignedByte.read(buffer, ctx)
|
index = UnsignedByte.read(buffer, ctx)
|
74
src/aiocraft/proto/ext.py
Normal file
74
src/aiocraft/proto/ext.py
Normal 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 ), )}
|
||||||
|
}
|
|
@ -40,5 +40,9 @@ REGISTRY = {
|
||||||
751 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
751 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
755 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
755 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
756 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
756 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
757 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }
|
757 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
|
758 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
|
759 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
|
760 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing },
|
||||||
|
761 : { 0 : PacketSetProtocol, 254 : PacketLegacyServerListPing }
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketLegacyServerListPing(Packet):
|
class PacketLegacyServerListPing(Packet):
|
||||||
__slots__ = ( 'id', 'payload' )
|
__slots__ = ( 'id', 'payload' )
|
||||||
|
|
||||||
payload : int
|
payload : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
payload:int=None,
|
payload:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
payload=payload
|
payload=payload
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketLegacyServerListPing(Packet):
|
||||||
751 : 254,
|
751 : 254,
|
||||||
755 : 254,
|
755 : 254,
|
||||||
756 : 254,
|
756 : 254,
|
||||||
757 : 254
|
757 : 254,
|
||||||
|
758 : 254,
|
||||||
|
759 : 254,
|
||||||
|
760 : 254,
|
||||||
|
761 : 254
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'payload', Byte ) ],
|
47 : [ ( 'payload', Byte ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketLegacyServerListPing(Packet):
|
||||||
751 : [ ( 'payload', Byte ) ],
|
751 : [ ( 'payload', Byte ) ],
|
||||||
755 : [ ( 'payload', Byte ) ],
|
755 : [ ( 'payload', Byte ) ],
|
||||||
756 : [ ( 'payload', Byte ) ],
|
756 : [ ( 'payload', Byte ) ],
|
||||||
757 : [ ( 'payload', Byte ) ]
|
757 : [ ( 'payload', Byte ) ],
|
||||||
|
758 : [ ( 'payload', Byte ) ],
|
||||||
|
759 : [ ( 'payload', Byte ) ],
|
||||||
|
760 : [ ( 'payload', Byte ) ],
|
||||||
|
761 : [ ( 'payload', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketSetProtocol(Packet):
|
class PacketSetProtocol(Packet):
|
||||||
__slots__ = ( 'id', 'nextState', 'protocolVersion', 'serverHost', 'serverPort' )
|
__slots__ = ( 'id', 'nextState', 'protocolVersion', 'serverHost', 'serverPort' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketSetProtocol(Packet):
|
||||||
serverHost : str
|
serverHost : str
|
||||||
serverPort : int
|
serverPort : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
nextState:int=None,
|
nextState:int | None = None,
|
||||||
protocolVersion:int=None,
|
protocolVersion:int | None = None,
|
||||||
serverHost:str=None,
|
serverHost:str | None = None,
|
||||||
serverPort:int=None,
|
serverPort:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
nextState=nextState,
|
nextState=nextState,
|
||||||
protocolVersion=protocolVersion,
|
protocolVersion=protocolVersion,
|
||||||
serverHost=serverHost,
|
serverHost=serverHost,
|
||||||
|
@ -66,7 +66,11 @@ class PacketSetProtocol(Packet):
|
||||||
751 : 0,
|
751 : 0,
|
||||||
755 : 0,
|
755 : 0,
|
||||||
756 : 0,
|
756 : 0,
|
||||||
757 : 0
|
757 : 0,
|
||||||
|
758 : 0,
|
||||||
|
759 : 0,
|
||||||
|
760 : 0,
|
||||||
|
761 : 0
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
47 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
|
@ -105,5 +109,9 @@ class PacketSetProtocol(Packet):
|
||||||
751 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
751 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
755 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
755 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
756 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
756 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
757 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ]
|
757 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
|
758 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
|
759 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
|
760 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ],
|
||||||
|
761 : [ ( 'protocolVersion', VarInt ), ( 'serverHost', String ), ( 'serverPort', UnsignedShort ), ( 'nextState', VarInt ) ]
|
||||||
}
|
}
|
|
@ -43,5 +43,9 @@ REGISTRY = {
|
||||||
751 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
751 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
755 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
755 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
756 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
756 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
757 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }
|
757 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
|
758 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
|
759 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
|
760 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest },
|
||||||
|
761 : { 0 : PacketDisconnect, 1 : PacketEncryptionBegin, 2 : PacketSuccess, 3 : PacketCompress, 4 : PacketLoginPluginRequest }
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCompress(Packet):
|
class PacketCompress(Packet):
|
||||||
__slots__ = ( 'id', 'threshold' )
|
__slots__ = ( 'id', 'threshold' )
|
||||||
|
|
||||||
threshold : int
|
threshold : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
threshold:int=None,
|
threshold:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
threshold=threshold
|
threshold=threshold
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketCompress(Packet):
|
||||||
751 : 3,
|
751 : 3,
|
||||||
755 : 3,
|
755 : 3,
|
||||||
756 : 3,
|
756 : 3,
|
||||||
757 : 3
|
757 : 3,
|
||||||
|
758 : 3,
|
||||||
|
759 : 3,
|
||||||
|
760 : 3,
|
||||||
|
761 : 3
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'threshold', VarInt ) ],
|
47 : [ ( 'threshold', VarInt ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketCompress(Packet):
|
||||||
751 : [ ( 'threshold', VarInt ) ],
|
751 : [ ( 'threshold', VarInt ) ],
|
||||||
755 : [ ( 'threshold', VarInt ) ],
|
755 : [ ( 'threshold', VarInt ) ],
|
||||||
756 : [ ( 'threshold', VarInt ) ],
|
756 : [ ( 'threshold', VarInt ) ],
|
||||||
757 : [ ( 'threshold', VarInt ) ]
|
757 : [ ( 'threshold', VarInt ) ],
|
||||||
|
758 : [ ( 'threshold', VarInt ) ],
|
||||||
|
759 : [ ( 'threshold', VarInt ) ],
|
||||||
|
760 : [ ( 'threshold', VarInt ) ],
|
||||||
|
761 : [ ( 'threshold', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketDisconnect(Packet):
|
class PacketDisconnect(Packet):
|
||||||
__slots__ = ( 'id', 'reason' )
|
__slots__ = ( 'id', 'reason' )
|
||||||
|
|
||||||
reason : str
|
reason : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
reason:str=None,
|
reason:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
reason=reason
|
reason=reason
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketDisconnect(Packet):
|
||||||
751 : 0,
|
751 : 0,
|
||||||
755 : 0,
|
755 : 0,
|
||||||
756 : 0,
|
756 : 0,
|
||||||
757 : 0
|
757 : 0,
|
||||||
|
758 : 0,
|
||||||
|
759 : 0,
|
||||||
|
760 : 0,
|
||||||
|
761 : 0
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'reason', String ) ],
|
47 : [ ( 'reason', String ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketDisconnect(Packet):
|
||||||
751 : [ ( 'reason', String ) ],
|
751 : [ ( 'reason', String ) ],
|
||||||
755 : [ ( 'reason', String ) ],
|
755 : [ ( 'reason', String ) ],
|
||||||
756 : [ ( 'reason', String ) ],
|
756 : [ ( 'reason', String ) ],
|
||||||
757 : [ ( 'reason', String ) ]
|
757 : [ ( 'reason', String ) ],
|
||||||
|
758 : [ ( 'reason', String ) ],
|
||||||
|
759 : [ ( 'reason', String ) ],
|
||||||
|
760 : [ ( 'reason', String ) ],
|
||||||
|
761 : [ ( 'reason', String ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEncryptionBegin(Packet):
|
class PacketEncryptionBegin(Packet):
|
||||||
__slots__ = ( 'id', 'publicKey', 'serverId', 'verifyToken' )
|
__slots__ = ( 'id', 'publicKey', 'serverId', 'verifyToken' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketEncryptionBegin(Packet):
|
||||||
serverId : str
|
serverId : str
|
||||||
verifyToken : bytes
|
verifyToken : bytes
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
publicKey:bytes=None,
|
publicKey:bytes | None = None,
|
||||||
serverId:str=None,
|
serverId:str | None = None,
|
||||||
verifyToken:bytes=None,
|
verifyToken:bytes | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
publicKey=publicKey,
|
publicKey=publicKey,
|
||||||
serverId=serverId,
|
serverId=serverId,
|
||||||
verifyToken=verifyToken
|
verifyToken=verifyToken
|
||||||
|
@ -63,7 +63,11 @@ class PacketEncryptionBegin(Packet):
|
||||||
751 : 1,
|
751 : 1,
|
||||||
755 : 1,
|
755 : 1,
|
||||||
756 : 1,
|
756 : 1,
|
||||||
757 : 1
|
757 : 1,
|
||||||
|
758 : 1,
|
||||||
|
759 : 1,
|
||||||
|
760 : 1,
|
||||||
|
761 : 1
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
47 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketEncryptionBegin(Packet):
|
||||||
751 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
751 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
755 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
755 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
756 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
756 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
757 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ]
|
757 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
758 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
759 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
760 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
761 : [ ( 'serverId', String ), ( 'publicKey', ByteArray ), ( 'verifyToken', ByteArray ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketLoginPluginRequest(Packet):
|
class PacketLoginPluginRequest(Packet):
|
||||||
__slots__ = ( 'id', 'channel', 'data', 'messageId' )
|
__slots__ = ( 'id', 'channel', 'data', 'messageId' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketLoginPluginRequest(Packet):
|
||||||
data : bytes
|
data : bytes
|
||||||
messageId : int
|
messageId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
channel:str=None,
|
channel:str | None = None,
|
||||||
data:bytes=None,
|
data:bytes | None = None,
|
||||||
messageId:int=None,
|
messageId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
channel=channel,
|
channel=channel,
|
||||||
data=data,
|
data=data,
|
||||||
messageId=messageId
|
messageId=messageId
|
||||||
|
@ -46,7 +46,11 @@ class PacketLoginPluginRequest(Packet):
|
||||||
751 : 4,
|
751 : 4,
|
||||||
755 : 4,
|
755 : 4,
|
||||||
756 : 4,
|
756 : 4,
|
||||||
757 : 4
|
757 : 4,
|
||||||
|
758 : 4,
|
||||||
|
759 : 4,
|
||||||
|
760 : 4,
|
||||||
|
761 : 4
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
393 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
393 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
@ -68,5 +72,9 @@ class PacketLoginPluginRequest(Packet):
|
||||||
751 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
751 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
755 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
755 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
756 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
756 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
757 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ]
|
757 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
758 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
759 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
760 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
761 : [ ( 'messageId', VarInt ), ( 'channel', String ), ( 'data', TrailingData ) ]
|
||||||
}
|
}
|
|
@ -2,21 +2,24 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketSuccess(Packet):
|
class PacketSuccess(Packet):
|
||||||
__slots__ = ( 'id', 'username', 'uuid' )
|
__slots__ = ( 'id', 'properties', 'username', 'uuid' )
|
||||||
|
|
||||||
|
properties : list
|
||||||
username : str
|
username : str
|
||||||
uuid : str
|
uuid : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
username:str=None,
|
properties:list | None = None,
|
||||||
uuid:str=None,
|
username:str | None = None,
|
||||||
|
uuid:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
|
properties=properties,
|
||||||
username=username,
|
username=username,
|
||||||
uuid=uuid
|
uuid=uuid
|
||||||
)
|
)
|
||||||
|
@ -60,7 +63,11 @@ class PacketSuccess(Packet):
|
||||||
751 : 2,
|
751 : 2,
|
||||||
755 : 2,
|
755 : 2,
|
||||||
756 : 2,
|
756 : 2,
|
||||||
757 : 2
|
757 : 2,
|
||||||
|
758 : 2,
|
||||||
|
759 : 2,
|
||||||
|
760 : 2,
|
||||||
|
761 : 2
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'uuid', String ), ( 'username', String ) ],
|
47 : [ ( 'uuid', String ), ( 'username', String ) ],
|
||||||
|
@ -99,5 +106,9 @@ class PacketSuccess(Packet):
|
||||||
751 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
751 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
||||||
755 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
755 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
||||||
756 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
756 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
||||||
757 : [ ( 'uuid', UUID ), ( 'username', String ) ]
|
757 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
||||||
|
758 : [ ( 'uuid', UUID ), ( 'username', String ) ],
|
||||||
|
759 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ],
|
||||||
|
760 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ],
|
||||||
|
761 : [ ( 'uuid', UUID ), ( 'username', String ), ( 'properties', ArrayType(StructType(( 'name', String ), ( 'value', String ), ( 'signature', OptionalType(String, ) ), ), VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -41,5 +41,9 @@ REGISTRY = {
|
||||||
751 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
751 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
755 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
755 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
756 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
756 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
757 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }
|
757 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
|
758 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
|
759 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
|
760 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse },
|
||||||
|
761 : { 0 : PacketLoginStart, 1 : PacketEncryptionBegin, 2 : PacketLoginPluginResponse }
|
||||||
}
|
}
|
|
@ -2,21 +2,27 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEncryptionBegin(Packet):
|
class PacketEncryptionBegin(Packet):
|
||||||
__slots__ = ( 'id', 'sharedSecret', 'verifyToken' )
|
__slots__ = ( 'id', 'crypto', 'hasVerifyToken', 'sharedSecret', 'verifyToken' )
|
||||||
|
|
||||||
|
crypto : Union[None, dict]
|
||||||
|
hasVerifyToken : bool
|
||||||
sharedSecret : bytes
|
sharedSecret : bytes
|
||||||
verifyToken : bytes
|
verifyToken : bytes
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
sharedSecret:bytes=None,
|
crypto:Union[None, dict] | None = None,
|
||||||
verifyToken:bytes=None,
|
hasVerifyToken:bool | None = None,
|
||||||
|
sharedSecret:bytes | None = None,
|
||||||
|
verifyToken:bytes | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
|
crypto=crypto,
|
||||||
|
hasVerifyToken=hasVerifyToken,
|
||||||
sharedSecret=sharedSecret,
|
sharedSecret=sharedSecret,
|
||||||
verifyToken=verifyToken
|
verifyToken=verifyToken
|
||||||
)
|
)
|
||||||
|
@ -60,7 +66,11 @@ class PacketEncryptionBegin(Packet):
|
||||||
751 : 1,
|
751 : 1,
|
||||||
755 : 1,
|
755 : 1,
|
||||||
756 : 1,
|
756 : 1,
|
||||||
757 : 1
|
757 : 1,
|
||||||
|
758 : 1,
|
||||||
|
759 : 1,
|
||||||
|
760 : 1,
|
||||||
|
761 : 1
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
47 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
@ -99,5 +109,9 @@ class PacketEncryptionBegin(Packet):
|
||||||
751 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
751 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
755 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
755 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
756 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
756 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
757 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ]
|
757 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
758 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ],
|
||||||
|
759 : [ ( 'sharedSecret', ByteArray ), ( 'hasVerifyToken', Boolean ), ( 'crypto', SwitchType('hasVerifyToken', { 'false' : StructType(( 'salt', Long ), ( 'messageSignature', ByteArray ), ), 'true' : StructType(( 'verifyToken', ByteArray ), ) }, None, ) ) ],
|
||||||
|
760 : [ ( 'sharedSecret', ByteArray ), ( 'hasVerifyToken', Boolean ), ( 'crypto', SwitchType('hasVerifyToken', { 'false' : StructType(( 'salt', Long ), ( 'messageSignature', ByteArray ), ), 'true' : StructType(( 'verifyToken', ByteArray ), ) }, None, ) ) ],
|
||||||
|
761 : [ ( 'sharedSecret', ByteArray ), ( 'verifyToken', ByteArray ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketLoginPluginResponse(Packet):
|
class PacketLoginPluginResponse(Packet):
|
||||||
__slots__ = ( 'id', 'data', 'messageId' )
|
__slots__ = ( 'id', 'data', 'messageId' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketLoginPluginResponse(Packet):
|
||||||
data : tuple
|
data : tuple
|
||||||
messageId : int
|
messageId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
data:tuple=None,
|
data:tuple | None = None,
|
||||||
messageId:int=None,
|
messageId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
data=data,
|
data=data,
|
||||||
messageId=messageId
|
messageId=messageId
|
||||||
)
|
)
|
||||||
|
@ -43,7 +43,11 @@ class PacketLoginPluginResponse(Packet):
|
||||||
751 : 2,
|
751 : 2,
|
||||||
755 : 2,
|
755 : 2,
|
||||||
756 : 2,
|
756 : 2,
|
||||||
757 : 2
|
757 : 2,
|
||||||
|
758 : 2,
|
||||||
|
759 : 2,
|
||||||
|
760 : 2,
|
||||||
|
761 : 2
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
393 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
393 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
|
@ -65,5 +69,9 @@ class PacketLoginPluginResponse(Packet):
|
||||||
751 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
751 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
755 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
755 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
756 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
756 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
757 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ]
|
757 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
|
758 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
|
759 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
|
760 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ],
|
||||||
|
761 : [ ( 'messageId', VarInt ), ( 'data', OptionalType(TrailingData, ) ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,25 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketLoginStart(Packet):
|
class PacketLoginStart(Packet):
|
||||||
__slots__ = ( 'id', 'username' )
|
__slots__ = ( 'id', 'playerUUID', 'signature', 'username' )
|
||||||
|
|
||||||
|
playerUUID : tuple
|
||||||
|
signature : tuple
|
||||||
username : str
|
username : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
username:str=None,
|
playerUUID:tuple | None = None,
|
||||||
|
signature:tuple | None = None,
|
||||||
|
username:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
|
playerUUID=playerUUID,
|
||||||
|
signature=signature,
|
||||||
username=username
|
username=username
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +63,11 @@ class PacketLoginStart(Packet):
|
||||||
751 : 0,
|
751 : 0,
|
||||||
755 : 0,
|
755 : 0,
|
||||||
756 : 0,
|
756 : 0,
|
||||||
757 : 0
|
757 : 0,
|
||||||
|
758 : 0,
|
||||||
|
759 : 0,
|
||||||
|
760 : 0,
|
||||||
|
761 : 0
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'username', String ) ],
|
47 : [ ( 'username', String ) ],
|
||||||
|
@ -96,5 +106,9 @@ class PacketLoginStart(Packet):
|
||||||
751 : [ ( 'username', String ) ],
|
751 : [ ( 'username', String ) ],
|
||||||
755 : [ ( 'username', String ) ],
|
755 : [ ( 'username', String ) ],
|
||||||
756 : [ ( 'username', String ) ],
|
756 : [ ( 'username', String ) ],
|
||||||
757 : [ ( 'username', String ) ]
|
757 : [ ( 'username', String ) ],
|
||||||
|
758 : [ ( 'username', String ) ],
|
||||||
|
759 : [ ( 'username', String ), ( 'signature', OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) ) ],
|
||||||
|
760 : [ ( 'username', String ), ( 'signature', OptionalType(StructType(( 'timestamp', Long ), ( 'publicKey', ByteArray ), ( 'signature', ByteArray ), ), ) ), ( 'playerUUID', OptionalType(UUID, ) ) ],
|
||||||
|
761 : [ ( 'username', String ), ( 'playerUUID', OptionalType(UUID, ) ) ]
|
||||||
}
|
}
|
|
@ -118,7 +118,18 @@ from .packet_set_title_subtitle import PacketSetTitleSubtitle
|
||||||
from .packet_set_title_text import PacketSetTitleText
|
from .packet_set_title_text import PacketSetTitleText
|
||||||
from .packet_set_title_time import PacketSetTitleTime
|
from .packet_set_title_time import PacketSetTitleTime
|
||||||
from .packet_simulation_distance import PacketSimulationDistance
|
from .packet_simulation_distance import PacketSimulationDistance
|
||||||
|
from .packet_chat_preview import PacketChatPreview
|
||||||
|
from .packet_player_chat import PacketPlayerChat
|
||||||
|
from .packet_should_display_chat_preview import PacketShouldDisplayChatPreview
|
||||||
|
from .packet_system_chat import PacketSystemChat
|
||||||
|
from .packet_server_data import PacketServerData
|
||||||
|
from .packet_chat_suggestions import PacketChatSuggestions
|
||||||
|
from .packet_hide_message import PacketHideMessage
|
||||||
|
from .packet_message_header import PacketMessageHeader
|
||||||
from .packet_advancement_progress import PacketAdvancementProgress
|
from .packet_advancement_progress import PacketAdvancementProgress
|
||||||
|
from .packet_profileless_chat import PacketProfilelessChat
|
||||||
|
from .packet_player_remove import PacketPlayerRemove
|
||||||
|
from .packet_feature_flags import PacketFeatureFlags
|
||||||
|
|
||||||
REGISTRY = {
|
REGISTRY = {
|
||||||
47 : { 0 : PacketKeepAlive, 1 : PacketLogin, 2 : PacketChat, 3 : PacketUpdateTime, 4 : PacketEntityEquipment, 5 : PacketSpawnPosition, 6 : PacketUpdateHealth, 7 : PacketRespawn, 8 : PacketPosition, 9 : PacketHeldItemSlot, 10 : PacketBed, 11 : PacketAnimation, 12 : PacketNamedEntitySpawn, 13 : PacketCollect, 14 : PacketSpawnEntity, 15 : PacketSpawnEntityLiving, 16 : PacketSpawnEntityPainting, 17 : PacketSpawnEntityExperienceOrb, 18 : PacketEntityVelocity, 19 : PacketEntityDestroy, 20 : PacketEntity, 21 : PacketRelEntityMove, 22 : PacketEntityLook, 23 : PacketEntityMoveLook, 24 : PacketEntityTeleport, 25 : PacketEntityHeadRotation, 26 : PacketEntityStatus, 27 : PacketAttachEntity, 28 : PacketEntityMetadata, 29 : PacketEntityEffect, 30 : PacketRemoveEntityEffect, 31 : PacketExperience, 32 : PacketUpdateAttributes, 33 : PacketMapChunk, 34 : PacketMultiBlockChange, 35 : PacketBlockChange, 36 : PacketBlockAction, 37 : PacketBlockBreakAnimation, 38 : PacketMapChunkBulk, 39 : PacketExplosion, 40 : PacketWorldEvent, 41 : PacketNamedSoundEffect, 42 : PacketWorldParticles, 43 : PacketGameStateChange, 44 : PacketSpawnEntityWeather, 45 : PacketOpenWindow, 46 : PacketCloseWindow, 47 : PacketSetSlot, 48 : PacketWindowItems, 49 : PacketCraftProgressBar, 50 : PacketTransaction, 51 : PacketUpdateSign, 52 : PacketMap, 53 : PacketTileEntityData, 54 : PacketOpenSignEntity, 55 : PacketStatistics, 56 : PacketPlayerInfo, 57 : PacketAbilities, 58 : PacketTabComplete, 59 : PacketScoreboardObjective, 60 : PacketScoreboardScore, 61 : PacketScoreboardDisplayObjective, 62 : PacketScoreboardTeam, 63 : PacketCustomPayload, 64 : PacketKickDisconnect, 65 : PacketDifficulty, 66 : PacketCombatEvent, 67 : PacketCamera, 68 : PacketWorldBorder, 69 : PacketTitle, 70 : PacketSetCompression, 71 : PacketPlayerlistHeader, 72 : PacketResourcePackSend, 73 : PacketUpdateEntityNbt },
|
47 : { 0 : PacketKeepAlive, 1 : PacketLogin, 2 : PacketChat, 3 : PacketUpdateTime, 4 : PacketEntityEquipment, 5 : PacketSpawnPosition, 6 : PacketUpdateHealth, 7 : PacketRespawn, 8 : PacketPosition, 9 : PacketHeldItemSlot, 10 : PacketBed, 11 : PacketAnimation, 12 : PacketNamedEntitySpawn, 13 : PacketCollect, 14 : PacketSpawnEntity, 15 : PacketSpawnEntityLiving, 16 : PacketSpawnEntityPainting, 17 : PacketSpawnEntityExperienceOrb, 18 : PacketEntityVelocity, 19 : PacketEntityDestroy, 20 : PacketEntity, 21 : PacketRelEntityMove, 22 : PacketEntityLook, 23 : PacketEntityMoveLook, 24 : PacketEntityTeleport, 25 : PacketEntityHeadRotation, 26 : PacketEntityStatus, 27 : PacketAttachEntity, 28 : PacketEntityMetadata, 29 : PacketEntityEffect, 30 : PacketRemoveEntityEffect, 31 : PacketExperience, 32 : PacketUpdateAttributes, 33 : PacketMapChunk, 34 : PacketMultiBlockChange, 35 : PacketBlockChange, 36 : PacketBlockAction, 37 : PacketBlockBreakAnimation, 38 : PacketMapChunkBulk, 39 : PacketExplosion, 40 : PacketWorldEvent, 41 : PacketNamedSoundEffect, 42 : PacketWorldParticles, 43 : PacketGameStateChange, 44 : PacketSpawnEntityWeather, 45 : PacketOpenWindow, 46 : PacketCloseWindow, 47 : PacketSetSlot, 48 : PacketWindowItems, 49 : PacketCraftProgressBar, 50 : PacketTransaction, 51 : PacketUpdateSign, 52 : PacketMap, 53 : PacketTileEntityData, 54 : PacketOpenSignEntity, 55 : PacketStatistics, 56 : PacketPlayerInfo, 57 : PacketAbilities, 58 : PacketTabComplete, 59 : PacketScoreboardObjective, 60 : PacketScoreboardScore, 61 : PacketScoreboardDisplayObjective, 62 : PacketScoreboardTeam, 63 : PacketCustomPayload, 64 : PacketKickDisconnect, 65 : PacketDifficulty, 66 : PacketCombatEvent, 67 : PacketCamera, 68 : PacketWorldBorder, 69 : PacketTitle, 70 : PacketSetCompression, 71 : PacketPlayerlistHeader, 72 : PacketResourcePackSend, 73 : PacketUpdateEntityNbt },
|
||||||
|
@ -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 },
|
751 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketAnimation, 6 : PacketStatistics, 7 : PacketAcknowledgePlayerDigging, 8 : PacketBlockBreakAnimation, 9 : PacketTileEntityData, 10 : PacketBlockAction, 11 : PacketBlockChange, 12 : PacketBossBar, 13 : PacketDifficulty, 14 : PacketChat, 15 : PacketTabComplete, 16 : PacketDeclareCommands, 17 : PacketTransaction, 18 : PacketCloseWindow, 19 : PacketWindowItems, 20 : PacketCraftProgressBar, 21 : PacketSetSlot, 22 : PacketSetCooldown, 23 : PacketCustomPayload, 24 : PacketNamedSoundEffect, 25 : PacketKickDisconnect, 26 : PacketEntityStatus, 27 : PacketExplosion, 28 : PacketUnloadChunk, 29 : PacketGameStateChange, 30 : PacketOpenHorseWindow, 31 : PacketKeepAlive, 32 : PacketMapChunk, 33 : PacketWorldEvent, 34 : PacketWorldParticles, 35 : PacketUpdateLight, 36 : PacketLogin, 37 : PacketMap, 38 : PacketTradeList, 39 : PacketRelEntityMove, 40 : PacketEntityMoveLook, 41 : PacketEntityLook, 42 : PacketEntity, 43 : PacketVehicleMove, 44 : PacketOpenBook, 45 : PacketOpenWindow, 46 : PacketOpenSignEntity, 47 : PacketCraftRecipeResponse, 48 : PacketAbilities, 49 : PacketCombatEvent, 50 : PacketPlayerInfo, 51 : PacketFacePlayer, 52 : PacketPosition, 53 : PacketUnlockRecipes, 54 : PacketEntityDestroy, 55 : PacketRemoveEntityEffect, 56 : PacketResourcePackSend, 57 : PacketRespawn, 58 : PacketEntityHeadRotation, 59 : PacketMultiBlockChange, 60 : PacketSelectAdvancementTab, 61 : PacketWorldBorder, 62 : PacketCamera, 63 : PacketHeldItemSlot, 64 : PacketUpdateViewPosition, 65 : PacketUpdateViewDistance, 66 : PacketSpawnPosition, 67 : PacketScoreboardDisplayObjective, 68 : PacketEntityMetadata, 69 : PacketAttachEntity, 70 : PacketEntityVelocity, 71 : PacketEntityEquipment, 72 : PacketExperience, 73 : PacketUpdateHealth, 74 : PacketScoreboardObjective, 75 : PacketSetPassengers, 76 : PacketTeams, 77 : PacketScoreboardScore, 78 : PacketUpdateTime, 79 : PacketTitle, 80 : PacketEntitySoundEffect, 81 : PacketSoundEffect, 82 : PacketStopSound, 83 : PacketPlayerlistHeader, 84 : PacketNbtQueryResponse, 85 : PacketCollect, 86 : PacketEntityTeleport, 87 : PacketAdvancements, 88 : PacketEntityUpdateAttributes, 89 : PacketEntityEffect, 90 : PacketDeclareRecipes, 91 : PacketTags },
|
||||||
755 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketDestroyEntity, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
|
755 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketDestroyEntity, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
|
||||||
756 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
|
756 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSetTitleSubtitle, 88 : PacketUpdateTime, 89 : PacketSetTitleText, 90 : PacketSetTitleTime, 91 : PacketEntitySoundEffect, 92 : PacketSoundEffect, 93 : PacketStopSound, 94 : PacketPlayerlistHeader, 95 : PacketNbtQueryResponse, 96 : PacketCollect, 97 : PacketEntityTeleport, 98 : PacketAdvancements, 99 : PacketEntityUpdateAttributes, 100 : PacketEntityEffect, 101 : PacketDeclareRecipes, 102 : PacketTags },
|
||||||
757 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags }
|
757 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags },
|
||||||
|
758 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketSpawnEntityLiving, 3 : PacketSpawnEntityPainting, 4 : PacketNamedEntitySpawn, 5 : PacketSculkVibrationSignal, 6 : PacketAnimation, 7 : PacketStatistics, 8 : PacketAcknowledgePlayerDigging, 9 : PacketBlockBreakAnimation, 10 : PacketTileEntityData, 11 : PacketBlockAction, 12 : PacketBlockChange, 13 : PacketBossBar, 14 : PacketDifficulty, 15 : PacketChat, 16 : PacketClearTitles, 17 : PacketTabComplete, 18 : PacketDeclareCommands, 19 : PacketCloseWindow, 20 : PacketWindowItems, 21 : PacketCraftProgressBar, 22 : PacketSetSlot, 23 : PacketSetCooldown, 24 : PacketCustomPayload, 25 : PacketNamedSoundEffect, 26 : PacketKickDisconnect, 27 : PacketEntityStatus, 28 : PacketExplosion, 29 : PacketUnloadChunk, 30 : PacketGameStateChange, 31 : PacketOpenHorseWindow, 32 : PacketInitializeWorldBorder, 33 : PacketKeepAlive, 34 : PacketMapChunk, 35 : PacketWorldEvent, 36 : PacketWorldParticles, 37 : PacketUpdateLight, 38 : PacketLogin, 39 : PacketMap, 40 : PacketTradeList, 41 : PacketRelEntityMove, 42 : PacketEntityMoveLook, 43 : PacketEntityLook, 44 : PacketVehicleMove, 45 : PacketOpenBook, 46 : PacketOpenWindow, 47 : PacketOpenSignEntity, 48 : PacketPing, 49 : PacketCraftRecipeResponse, 50 : PacketAbilities, 51 : PacketEndCombatEvent, 52 : PacketEnterCombatEvent, 53 : PacketDeathCombatEvent, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketActionBar, 66 : PacketWorldBorderCenter, 67 : PacketWorldBorderLerpSize, 68 : PacketWorldBorderSize, 69 : PacketWorldBorderWarningDelay, 70 : PacketWorldBorderWarningReach, 71 : PacketCamera, 72 : PacketHeldItemSlot, 73 : PacketUpdateViewPosition, 74 : PacketUpdateViewDistance, 75 : PacketSpawnPosition, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketPlayerlistHeader, 96 : PacketNbtQueryResponse, 97 : PacketCollect, 98 : PacketEntityTeleport, 99 : PacketAdvancements, 100 : PacketEntityUpdateAttributes, 101 : PacketEntityEffect, 102 : PacketDeclareRecipes, 103 : PacketTags },
|
||||||
|
759 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketChatPreview, 13 : PacketClearTitles, 14 : PacketTabComplete, 15 : PacketDeclareCommands, 16 : PacketCloseWindow, 17 : PacketWindowItems, 18 : PacketCraftProgressBar, 19 : PacketSetSlot, 20 : PacketSetCooldown, 21 : PacketCustomPayload, 22 : PacketNamedSoundEffect, 23 : PacketKickDisconnect, 24 : PacketEntityStatus, 25 : PacketExplosion, 26 : PacketUnloadChunk, 27 : PacketGameStateChange, 28 : PacketOpenHorseWindow, 29 : PacketInitializeWorldBorder, 30 : PacketKeepAlive, 31 : PacketMapChunk, 32 : PacketWorldEvent, 33 : PacketWorldParticles, 34 : PacketUpdateLight, 35 : PacketLogin, 36 : PacketMap, 37 : PacketTradeList, 38 : PacketRelEntityMove, 39 : PacketEntityMoveLook, 40 : PacketEntityLook, 41 : PacketVehicleMove, 42 : PacketOpenBook, 43 : PacketOpenWindow, 44 : PacketOpenSignEntity, 45 : PacketPing, 46 : PacketCraftRecipeResponse, 47 : PacketAbilities, 48 : PacketPlayerChat, 49 : PacketEndCombatEvent, 50 : PacketEnterCombatEvent, 51 : PacketDeathCombatEvent, 52 : PacketPlayerInfo, 53 : PacketFacePlayer, 54 : PacketPosition, 55 : PacketUnlockRecipes, 56 : PacketEntityDestroy, 57 : PacketRemoveEntityEffect, 58 : PacketResourcePackSend, 59 : PacketRespawn, 60 : PacketEntityHeadRotation, 61 : PacketMultiBlockChange, 62 : PacketSelectAdvancementTab, 63 : PacketServerData, 64 : PacketActionBar, 65 : PacketWorldBorderCenter, 66 : PacketWorldBorderLerpSize, 67 : PacketWorldBorderSize, 68 : PacketWorldBorderWarningDelay, 69 : PacketWorldBorderWarningReach, 70 : PacketCamera, 71 : PacketHeldItemSlot, 72 : PacketUpdateViewPosition, 73 : PacketUpdateViewDistance, 74 : PacketSpawnPosition, 75 : PacketShouldDisplayChatPreview, 76 : PacketScoreboardDisplayObjective, 77 : PacketEntityMetadata, 78 : PacketAttachEntity, 79 : PacketEntityVelocity, 80 : PacketEntityEquipment, 81 : PacketExperience, 82 : PacketUpdateHealth, 83 : PacketScoreboardObjective, 84 : PacketSetPassengers, 85 : PacketTeams, 86 : PacketScoreboardScore, 87 : PacketSimulationDistance, 88 : PacketSetTitleSubtitle, 89 : PacketUpdateTime, 90 : PacketSetTitleText, 91 : PacketSetTitleTime, 92 : PacketEntitySoundEffect, 93 : PacketSoundEffect, 94 : PacketStopSound, 95 : PacketSystemChat, 96 : PacketPlayerlistHeader, 97 : PacketNbtQueryResponse, 98 : PacketCollect, 99 : PacketEntityTeleport, 100 : PacketAdvancements, 101 : PacketEntityUpdateAttributes, 102 : PacketEntityEffect, 103 : PacketDeclareRecipes, 104 : PacketTags },
|
||||||
|
760 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketChatPreview, 13 : PacketClearTitles, 14 : PacketTabComplete, 15 : PacketDeclareCommands, 16 : PacketCloseWindow, 17 : PacketWindowItems, 18 : PacketCraftProgressBar, 19 : PacketSetSlot, 20 : PacketSetCooldown, 21 : PacketChatSuggestions, 22 : PacketCustomPayload, 23 : PacketNamedSoundEffect, 24 : PacketHideMessage, 25 : PacketKickDisconnect, 26 : PacketEntityStatus, 27 : PacketExplosion, 28 : PacketUnloadChunk, 29 : PacketGameStateChange, 30 : PacketOpenHorseWindow, 31 : PacketInitializeWorldBorder, 32 : PacketKeepAlive, 33 : PacketMapChunk, 34 : PacketWorldEvent, 35 : PacketWorldParticles, 36 : PacketUpdateLight, 37 : PacketLogin, 38 : PacketMap, 39 : PacketTradeList, 40 : PacketRelEntityMove, 41 : PacketEntityMoveLook, 42 : PacketEntityLook, 43 : PacketVehicleMove, 44 : PacketOpenBook, 45 : PacketOpenWindow, 46 : PacketOpenSignEntity, 47 : PacketPing, 48 : PacketCraftRecipeResponse, 49 : PacketAbilities, 50 : PacketMessageHeader, 51 : PacketPlayerChat, 52 : PacketEndCombatEvent, 53 : PacketEnterCombatEvent, 54 : PacketDeathCombatEvent, 55 : PacketPlayerInfo, 56 : PacketFacePlayer, 57 : PacketPosition, 58 : PacketUnlockRecipes, 59 : PacketEntityDestroy, 60 : PacketRemoveEntityEffect, 61 : PacketResourcePackSend, 62 : PacketRespawn, 63 : PacketEntityHeadRotation, 64 : PacketMultiBlockChange, 65 : PacketSelectAdvancementTab, 66 : PacketServerData, 67 : PacketActionBar, 68 : PacketWorldBorderCenter, 69 : PacketWorldBorderLerpSize, 70 : PacketWorldBorderSize, 71 : PacketWorldBorderWarningDelay, 72 : PacketWorldBorderWarningReach, 73 : PacketCamera, 74 : PacketHeldItemSlot, 75 : PacketUpdateViewPosition, 76 : PacketUpdateViewDistance, 77 : PacketSpawnPosition, 78 : PacketShouldDisplayChatPreview, 79 : PacketScoreboardDisplayObjective, 80 : PacketEntityMetadata, 81 : PacketAttachEntity, 82 : PacketEntityVelocity, 83 : PacketEntityEquipment, 84 : PacketExperience, 85 : PacketUpdateHealth, 86 : PacketScoreboardObjective, 87 : PacketSetPassengers, 88 : PacketTeams, 89 : PacketScoreboardScore, 90 : PacketSimulationDistance, 91 : PacketSetTitleSubtitle, 92 : PacketUpdateTime, 93 : PacketSetTitleText, 94 : PacketSetTitleTime, 95 : PacketEntitySoundEffect, 96 : PacketSoundEffect, 97 : PacketStopSound, 98 : PacketSystemChat, 99 : PacketPlayerlistHeader, 100 : PacketNbtQueryResponse, 101 : PacketCollect, 102 : PacketEntityTeleport, 103 : PacketAdvancements, 104 : PacketEntityUpdateAttributes, 105 : PacketEntityEffect, 106 : PacketDeclareRecipes, 107 : PacketTags },
|
||||||
|
761 : { 0 : PacketSpawnEntity, 1 : PacketSpawnEntityExperienceOrb, 2 : PacketNamedEntitySpawn, 3 : PacketAnimation, 4 : PacketStatistics, 5 : PacketAcknowledgePlayerDigging, 6 : PacketBlockBreakAnimation, 7 : PacketTileEntityData, 8 : PacketBlockAction, 9 : PacketBlockChange, 10 : PacketBossBar, 11 : PacketDifficulty, 12 : PacketClearTitles, 13 : PacketTabComplete, 14 : PacketDeclareCommands, 15 : PacketCloseWindow, 16 : PacketWindowItems, 17 : PacketCraftProgressBar, 18 : PacketSetSlot, 19 : PacketSetCooldown, 20 : PacketChatSuggestions, 21 : PacketCustomPayload, 22 : PacketHideMessage, 23 : PacketKickDisconnect, 24 : PacketProfilelessChat, 25 : PacketEntityStatus, 26 : PacketExplosion, 27 : PacketUnloadChunk, 28 : PacketGameStateChange, 29 : PacketOpenHorseWindow, 30 : PacketInitializeWorldBorder, 31 : PacketKeepAlive, 32 : PacketMapChunk, 33 : PacketWorldEvent, 34 : PacketWorldParticles, 35 : PacketUpdateLight, 36 : PacketLogin, 37 : PacketMap, 38 : PacketTradeList, 39 : PacketRelEntityMove, 40 : PacketEntityMoveLook, 41 : PacketEntityLook, 42 : PacketVehicleMove, 43 : PacketOpenBook, 44 : PacketOpenWindow, 45 : PacketOpenSignEntity, 46 : PacketPing, 47 : PacketCraftRecipeResponse, 48 : PacketAbilities, 49 : PacketPlayerChat, 50 : PacketEndCombatEvent, 51 : PacketEnterCombatEvent, 52 : PacketDeathCombatEvent, 53 : PacketPlayerRemove, 54 : PacketPlayerInfo, 55 : PacketFacePlayer, 56 : PacketPosition, 57 : PacketUnlockRecipes, 58 : PacketEntityDestroy, 59 : PacketRemoveEntityEffect, 60 : PacketResourcePackSend, 61 : PacketRespawn, 62 : PacketEntityHeadRotation, 63 : PacketMultiBlockChange, 64 : PacketSelectAdvancementTab, 65 : PacketServerData, 66 : PacketActionBar, 67 : PacketWorldBorderCenter, 68 : PacketWorldBorderLerpSize, 69 : PacketWorldBorderSize, 70 : PacketWorldBorderWarningDelay, 71 : PacketWorldBorderWarningReach, 72 : PacketCamera, 73 : PacketHeldItemSlot, 74 : PacketUpdateViewPosition, 75 : PacketUpdateViewDistance, 76 : PacketSpawnPosition, 77 : PacketScoreboardDisplayObjective, 78 : PacketEntityMetadata, 79 : PacketAttachEntity, 80 : PacketEntityVelocity, 81 : PacketEntityEquipment, 82 : PacketExperience, 83 : PacketUpdateHealth, 84 : PacketScoreboardObjective, 85 : PacketSetPassengers, 86 : PacketTeams, 87 : PacketScoreboardScore, 88 : PacketSimulationDistance, 89 : PacketSetTitleSubtitle, 90 : PacketUpdateTime, 91 : PacketSetTitleText, 92 : PacketSetTitleTime, 93 : PacketEntitySoundEffect, 94 : PacketSoundEffect, 95 : PacketStopSound, 96 : PacketSystemChat, 97 : PacketPlayerlistHeader, 98 : PacketNbtQueryResponse, 99 : PacketCollect, 100 : PacketEntityTeleport, 101 : PacketAdvancements, 102 : PacketEntityUpdateAttributes, 103 : PacketFeatureFlags, 104 : PacketEntityEffect, 105 : PacketDeclareRecipes, 106 : PacketTags }
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAbilities(Packet):
|
class PacketAbilities(Packet):
|
||||||
__slots__ = ( 'id', 'flags', 'flyingSpeed', 'walkingSpeed' )
|
__slots__ = ( 'id', 'flags', 'flyingSpeed', 'walkingSpeed' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketAbilities(Packet):
|
||||||
flyingSpeed : float
|
flyingSpeed : float
|
||||||
walkingSpeed : float
|
walkingSpeed : float
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
flags:int=None,
|
flags:int | None = None,
|
||||||
flyingSpeed:float=None,
|
flyingSpeed:float | None = None,
|
||||||
walkingSpeed:float=None,
|
walkingSpeed:float | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
flags=flags,
|
flags=flags,
|
||||||
flyingSpeed=flyingSpeed,
|
flyingSpeed=flyingSpeed,
|
||||||
walkingSpeed=walkingSpeed
|
walkingSpeed=walkingSpeed
|
||||||
|
@ -63,7 +63,11 @@ class PacketAbilities(Packet):
|
||||||
751 : 48,
|
751 : 48,
|
||||||
755 : 50,
|
755 : 50,
|
||||||
756 : 50,
|
756 : 50,
|
||||||
757 : 50
|
757 : 50,
|
||||||
|
758 : 50,
|
||||||
|
759 : 47,
|
||||||
|
760 : 49,
|
||||||
|
761 : 48
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
47 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketAbilities(Packet):
|
||||||
751 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
751 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
755 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
755 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
756 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
756 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
757 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ]
|
757 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
|
758 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
|
759 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
|
760 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ],
|
||||||
|
761 : [ ( 'flags', Byte ), ( 'flyingSpeed', Float ), ( 'walkingSpeed', Float ) ]
|
||||||
}
|
}
|
|
@ -2,27 +2,30 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAcknowledgePlayerDigging(Packet):
|
class PacketAcknowledgePlayerDigging(Packet):
|
||||||
__slots__ = ( 'id', 'block', 'location', 'status', 'successful' )
|
__slots__ = ( 'id', 'block', 'location', 'sequenceId', 'status', 'successful' )
|
||||||
|
|
||||||
block : int
|
block : int
|
||||||
location : tuple
|
location : tuple
|
||||||
|
sequenceId : int
|
||||||
status : int
|
status : int
|
||||||
successful : bool
|
successful : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
block:int=None,
|
block:int | None = None,
|
||||||
location:tuple=None,
|
location:tuple | None = None,
|
||||||
status:int=None,
|
sequenceId:int | None = None,
|
||||||
successful:bool=None,
|
status:int | None = None,
|
||||||
|
successful:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
block=block,
|
block=block,
|
||||||
location=location,
|
location=location,
|
||||||
|
sequenceId=sequenceId,
|
||||||
status=status,
|
status=status,
|
||||||
successful=successful
|
successful=successful
|
||||||
)
|
)
|
||||||
|
@ -41,7 +44,11 @@ class PacketAcknowledgePlayerDigging(Packet):
|
||||||
751 : 7,
|
751 : 7,
|
||||||
755 : 8,
|
755 : 8,
|
||||||
756 : 8,
|
756 : 8,
|
||||||
757 : 8
|
757 : 8,
|
||||||
|
758 : 8,
|
||||||
|
759 : 5,
|
||||||
|
760 : 5,
|
||||||
|
761 : 5
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
498 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
498 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
|
@ -55,5 +62,9 @@ class PacketAcknowledgePlayerDigging(Packet):
|
||||||
751 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
751 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
755 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
755 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
756 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
756 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
757 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ]
|
757 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
|
758 : [ ( 'location', Position ), ( 'block', VarInt ), ( 'status', VarInt ), ( 'successful', Boolean ) ],
|
||||||
|
759 : [ ( 'sequenceId', VarInt ) ],
|
||||||
|
760 : [ ( 'sequenceId', VarInt ) ],
|
||||||
|
761 : [ ( 'sequenceId', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketActionBar(Packet):
|
class PacketActionBar(Packet):
|
||||||
__slots__ = ( 'id', 'text' )
|
__slots__ = ( 'id', 'text' )
|
||||||
|
|
||||||
text : str
|
text : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
text:str=None,
|
text:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
text=text
|
text=text
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,10 +23,18 @@ class PacketActionBar(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 65,
|
755 : 65,
|
||||||
756 : 65,
|
756 : 65,
|
||||||
757 : 65
|
757 : 65,
|
||||||
|
758 : 65,
|
||||||
|
759 : 64,
|
||||||
|
760 : 67,
|
||||||
|
761 : 66
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ( 'text', String ) ],
|
755 : [ ( 'text', String ) ],
|
||||||
756 : [ ( 'text', String ) ],
|
756 : [ ( 'text', String ) ],
|
||||||
757 : [ ( 'text', String ) ]
|
757 : [ ( 'text', String ) ],
|
||||||
|
758 : [ ( 'text', String ) ],
|
||||||
|
759 : [ ( 'text', String ) ],
|
||||||
|
760 : [ ( 'text', String ) ],
|
||||||
|
761 : [ ( 'text', String ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAdvancementProgress(Packet):
|
class PacketAdvancementProgress(Packet):
|
||||||
__slots__ = ( 'id', 'id' )
|
__slots__ = ( 'id', 'id' )
|
||||||
|
|
||||||
id : tuple
|
id : tuple
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
id:tuple=None,
|
id:tuple | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
id=id
|
id=id
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAdvancements(Packet):
|
class PacketAdvancements(Packet):
|
||||||
__slots__ = ( 'id', 'advancementMapping', 'identifiers', 'progressMapping', 'reset' )
|
__slots__ = ( 'id', 'advancementMapping', 'identifiers', 'progressMapping', 'reset' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketAdvancements(Packet):
|
||||||
progressMapping : list
|
progressMapping : list
|
||||||
reset : bool
|
reset : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
advancementMapping:list=None,
|
advancementMapping:list | None = None,
|
||||||
identifiers:list=None,
|
identifiers:list | None = None,
|
||||||
progressMapping:list=None,
|
progressMapping:list | None = None,
|
||||||
reset:bool=None,
|
reset:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
advancementMapping=advancementMapping,
|
advancementMapping=advancementMapping,
|
||||||
identifiers=identifiers,
|
identifiers=identifiers,
|
||||||
progressMapping=progressMapping,
|
progressMapping=progressMapping,
|
||||||
|
@ -56,7 +56,11 @@ class PacketAdvancements(Packet):
|
||||||
751 : 87,
|
751 : 87,
|
||||||
755 : 98,
|
755 : 98,
|
||||||
756 : 98,
|
756 : 98,
|
||||||
757 : 99
|
757 : 99,
|
||||||
|
758 : 99,
|
||||||
|
759 : 100,
|
||||||
|
760 : 103,
|
||||||
|
761 : 101
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
321 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', VarInt ), ( 'frameType', VarInt ), ( 'backgroundTexture', OptionalType(String, ) ), ( 'xCord', VarInt ), ( 'yCord', VarInt ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
321 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', VarInt ), ( 'frameType', VarInt ), ( 'backgroundTexture', OptionalType(String, ) ), ( 'xCord', VarInt ), ( 'yCord', VarInt ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
755 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
755 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
756 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
756 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
757 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ]
|
757 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
758 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
759 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
760 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
761 : [ ( 'reset', Boolean ), ( 'advancementMapping', ArrayType(StructType(( 'key', String ), ( 'value', StructType(( 'parentId', OptionalType(String, ) ), ( 'displayData', OptionalType(StructType(( 'title', String ), ( 'description', String ), ( 'icon', Slot ), ( 'frameType', VarInt ), ( 'flags', Int ), ( 'backgroundTexture', SwitchType('has_background_texture', { 1 : String }, None, ) ), ( 'xCord', Float ), ( 'yCord', Float ), ), ) ), ( 'criteria', ArrayType(StructType(( 'key', String ), ( 'value', Void ), ), VarInt, ) ), ( 'requirements', ArrayType(ArrayType(String, VarInt, ), VarInt, ) ), ) ), ), VarInt, ) ), ( 'identifiers', ArrayType(String, VarInt, ) ), ( 'progressMapping', ArrayType(StructType(( 'key', String ), ( 'value', ArrayType(StructType(( 'criterionIdentifier', String ), ( 'criterionProgress', OptionalType(Long, ) ), ), VarInt, ) ), ), VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAnimation(Packet):
|
class PacketAnimation(Packet):
|
||||||
__slots__ = ( 'id', 'animation', 'entityId' )
|
__slots__ = ( 'id', 'animation', 'entityId' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketAnimation(Packet):
|
||||||
animation : int
|
animation : int
|
||||||
entityId : int
|
entityId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
animation:int=None,
|
animation:int | None = None,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
animation=animation,
|
animation=animation,
|
||||||
entityId=entityId
|
entityId=entityId
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketAnimation(Packet):
|
||||||
751 : 5,
|
751 : 5,
|
||||||
755 : 6,
|
755 : 6,
|
||||||
756 : 6,
|
756 : 6,
|
||||||
757 : 6
|
757 : 6,
|
||||||
|
758 : 6,
|
||||||
|
759 : 3,
|
||||||
|
760 : 3,
|
||||||
|
761 : 3
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketAnimation(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'animation', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketAttachEntity(Packet):
|
class PacketAttachEntity(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'leash', 'vehicleId' )
|
__slots__ = ( 'id', 'entityId', 'leash', 'vehicleId' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketAttachEntity(Packet):
|
||||||
leash : bool
|
leash : bool
|
||||||
vehicleId : int
|
vehicleId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
leash:bool=None,
|
leash:bool | None = None,
|
||||||
vehicleId:int=None,
|
vehicleId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
leash=leash,
|
leash=leash,
|
||||||
vehicleId=vehicleId
|
vehicleId=vehicleId
|
||||||
|
@ -63,7 +63,11 @@ class PacketAttachEntity(Packet):
|
||||||
751 : 69,
|
751 : 69,
|
||||||
755 : 78,
|
755 : 78,
|
||||||
756 : 78,
|
756 : 78,
|
||||||
757 : 78
|
757 : 78,
|
||||||
|
758 : 78,
|
||||||
|
759 : 78,
|
||||||
|
760 : 81,
|
||||||
|
761 : 79
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', Int ), ( 'vehicleId', Int ), ( 'leash', Boolean ) ],
|
47 : [ ( 'entityId', Int ), ( 'vehicleId', Int ), ( 'leash', Boolean ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketAttachEntity(Packet):
|
||||||
751 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
751 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
755 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
755 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
756 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
756 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
757 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ]
|
757 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
|
758 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
|
759 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
|
760 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ],
|
||||||
|
761 : [ ( 'entityId', Int ), ( 'vehicleId', Int ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketBed(Packet):
|
class PacketBed(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'location' )
|
__slots__ = ( 'id', 'entityId', 'location' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketBed(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
location : tuple
|
location : tuple
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
location:tuple=None,
|
location:tuple | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
location=location
|
location=location
|
||||||
)
|
)
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketBlockAction(Packet):
|
class PacketBlockAction(Packet):
|
||||||
__slots__ = ( 'id', 'blockId', 'byte1', 'byte2', 'location' )
|
__slots__ = ( 'id', 'blockId', 'byte1', 'byte2', 'location' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketBlockAction(Packet):
|
||||||
byte2 : int
|
byte2 : int
|
||||||
location : tuple
|
location : tuple
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
blockId:int=None,
|
blockId:int | None = None,
|
||||||
byte1:int=None,
|
byte1:int | None = None,
|
||||||
byte2:int=None,
|
byte2:int | None = None,
|
||||||
location:tuple=None,
|
location:tuple | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
blockId=blockId,
|
blockId=blockId,
|
||||||
byte1=byte1,
|
byte1=byte1,
|
||||||
byte2=byte2,
|
byte2=byte2,
|
||||||
|
@ -66,7 +66,11 @@ class PacketBlockAction(Packet):
|
||||||
751 : 10,
|
751 : 10,
|
||||||
755 : 11,
|
755 : 11,
|
||||||
756 : 11,
|
756 : 11,
|
||||||
757 : 11
|
757 : 11,
|
||||||
|
758 : 11,
|
||||||
|
759 : 8,
|
||||||
|
760 : 8,
|
||||||
|
761 : 8
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
47 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
|
@ -105,5 +109,9 @@ class PacketBlockAction(Packet):
|
||||||
751 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
751 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
755 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
755 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
756 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
756 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
757 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ]
|
757 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
|
758 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
|
759 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
|
760 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ],
|
||||||
|
761 : [ ( 'location', Position ), ( 'byte1', Byte ), ( 'byte2', Byte ), ( 'blockId', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketBlockBreakAnimation(Packet):
|
class PacketBlockBreakAnimation(Packet):
|
||||||
__slots__ = ( 'id', 'destroyStage', 'entityId', 'location' )
|
__slots__ = ( 'id', 'destroyStage', 'entityId', 'location' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketBlockBreakAnimation(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
location : tuple
|
location : tuple
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
destroyStage:int=None,
|
destroyStage:int | None = None,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
location:tuple=None,
|
location:tuple | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
destroyStage=destroyStage,
|
destroyStage=destroyStage,
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
location=location
|
location=location
|
||||||
|
@ -63,7 +63,11 @@ class PacketBlockBreakAnimation(Packet):
|
||||||
751 : 8,
|
751 : 8,
|
||||||
755 : 9,
|
755 : 9,
|
||||||
756 : 9,
|
756 : 9,
|
||||||
757 : 9
|
757 : 9,
|
||||||
|
758 : 9,
|
||||||
|
759 : 6,
|
||||||
|
760 : 6,
|
||||||
|
761 : 6
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketBlockBreakAnimation(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'location', Position ), ( 'destroyStage', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketBlockChange(Packet):
|
class PacketBlockChange(Packet):
|
||||||
__slots__ = ( 'id', 'location', 'type' )
|
__slots__ = ( 'id', 'location', 'type' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketBlockChange(Packet):
|
||||||
location : tuple
|
location : tuple
|
||||||
type : int
|
type : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
location:tuple=None,
|
location:tuple | None = None,
|
||||||
type:int=None,
|
type:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
location=location,
|
location=location,
|
||||||
type=type
|
type=type
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketBlockChange(Packet):
|
||||||
751 : 11,
|
751 : 11,
|
||||||
755 : 12,
|
755 : 12,
|
||||||
756 : 12,
|
756 : 12,
|
||||||
757 : 12
|
757 : 12,
|
||||||
|
758 : 12,
|
||||||
|
759 : 9,
|
||||||
|
760 : 9,
|
||||||
|
761 : 9
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
47 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketBlockChange(Packet):
|
||||||
751 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
751 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
755 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
755 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
756 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
756 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
757 : [ ( 'location', Position ), ( 'type', VarInt ) ]
|
757 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
|
758 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
|
759 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
|
760 : [ ( 'location', Position ), ( 'type', VarInt ) ],
|
||||||
|
761 : [ ( 'location', Position ), ( 'type', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketBossBar(Packet):
|
class PacketBossBar(Packet):
|
||||||
__slots__ = ( 'id', 'action', 'color', 'dividers', 'entityUUID', 'flags', 'health', 'title' )
|
__slots__ = ( 'id', 'action', 'color', 'dividers', 'entityUUID', 'flags', 'health', 'title' )
|
||||||
|
@ -16,17 +16,17 @@ class PacketBossBar(Packet):
|
||||||
health : Union[None, float]
|
health : Union[None, float]
|
||||||
title : Union[None, str]
|
title : Union[None, str]
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
action:int=None,
|
action:int | None = None,
|
||||||
color:Union[None, int]=None,
|
color:Union[None, int] | None = None,
|
||||||
dividers:Union[None, int]=None,
|
dividers:Union[None, int] | None = None,
|
||||||
entityUUID:str=None,
|
entityUUID:str | None = None,
|
||||||
flags:Union[None, int]=None,
|
flags:Union[None, int] | None = None,
|
||||||
health:Union[None, float]=None,
|
health:Union[None, float] | None = None,
|
||||||
title:Union[None, str]=None,
|
title:Union[None, str] | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
action=action,
|
action=action,
|
||||||
color=color,
|
color=color,
|
||||||
dividers=dividers,
|
dividers=dividers,
|
||||||
|
@ -74,7 +74,11 @@ class PacketBossBar(Packet):
|
||||||
751 : 12,
|
751 : 12,
|
||||||
755 : 13,
|
755 : 13,
|
||||||
756 : 13,
|
756 : 13,
|
||||||
757 : 13
|
757 : 13,
|
||||||
|
758 : 13,
|
||||||
|
759 : 10,
|
||||||
|
760 : 10,
|
||||||
|
761 : 10
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
76 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
76 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
755 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
755 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
756 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
756 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
757 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ]
|
757 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
|
758 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
|
759 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
|
760 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ],
|
||||||
|
761 : [ ( 'entityUUID', UUID ), ( 'action', VarInt ), ( 'title', SwitchType('action', { 0 : String, 3 : String }, None, ) ), ( 'health', SwitchType('action', { 0 : Float, 2 : Float }, None, ) ), ( 'color', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'dividers', SwitchType('action', { 0 : VarInt, 4 : VarInt }, None, ) ), ( 'flags', SwitchType('action', { 0 : Byte, 5 : Byte }, None, ) ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCamera(Packet):
|
class PacketCamera(Packet):
|
||||||
__slots__ = ( 'id', 'cameraId' )
|
__slots__ = ( 'id', 'cameraId' )
|
||||||
|
|
||||||
cameraId : int
|
cameraId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
cameraId:int=None,
|
cameraId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
cameraId=cameraId
|
cameraId=cameraId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketCamera(Packet):
|
||||||
751 : 62,
|
751 : 62,
|
||||||
755 : 71,
|
755 : 71,
|
||||||
756 : 71,
|
756 : 71,
|
||||||
757 : 71
|
757 : 71,
|
||||||
|
758 : 71,
|
||||||
|
759 : 70,
|
||||||
|
760 : 73,
|
||||||
|
761 : 72
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'cameraId', VarInt ) ],
|
47 : [ ( 'cameraId', VarInt ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketCamera(Packet):
|
||||||
751 : [ ( 'cameraId', VarInt ) ],
|
751 : [ ( 'cameraId', VarInt ) ],
|
||||||
755 : [ ( 'cameraId', VarInt ) ],
|
755 : [ ( 'cameraId', VarInt ) ],
|
||||||
756 : [ ( 'cameraId', VarInt ) ],
|
756 : [ ( 'cameraId', VarInt ) ],
|
||||||
757 : [ ( 'cameraId', VarInt ) ]
|
757 : [ ( 'cameraId', VarInt ) ],
|
||||||
|
758 : [ ( 'cameraId', VarInt ) ],
|
||||||
|
759 : [ ( 'cameraId', VarInt ) ],
|
||||||
|
760 : [ ( 'cameraId', VarInt ) ],
|
||||||
|
761 : [ ( 'cameraId', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketChat(Packet):
|
class PacketChat(Packet):
|
||||||
__slots__ = ( 'id', 'message', 'position', 'sender' )
|
__slots__ = ( 'id', 'message', 'position', 'sender' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketChat(Packet):
|
||||||
position : int
|
position : int
|
||||||
sender : str
|
sender : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
message:str=None,
|
message:str | None = None,
|
||||||
position:int=None,
|
position:int | None = None,
|
||||||
sender:str=None,
|
sender:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
message=message,
|
message=message,
|
||||||
position=position,
|
position=position,
|
||||||
sender=sender
|
sender=sender
|
||||||
|
@ -63,7 +63,8 @@ class PacketChat(Packet):
|
||||||
751 : 14,
|
751 : 14,
|
||||||
755 : 15,
|
755 : 15,
|
||||||
756 : 15,
|
756 : 15,
|
||||||
757 : 15
|
757 : 15,
|
||||||
|
758 : 15
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'message', String ), ( 'position', Byte ) ],
|
47 : [ ( 'message', String ), ( 'position', Byte ) ],
|
||||||
|
@ -102,5 +103,6 @@ class PacketChat(Packet):
|
||||||
751 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
751 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
||||||
755 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
755 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
||||||
756 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
756 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
||||||
757 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ]
|
757 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ],
|
||||||
|
758 : [ ( 'message', String ), ( 'position', Byte ), ( 'sender', UUID ) ]
|
||||||
}
|
}
|
33
src/aiocraft/proto/play/clientbound/packet_chat_preview.py
Normal file
33
src/aiocraft/proto/play/clientbound/packet_chat_preview.py
Normal 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, ) ) ]
|
||||||
|
}
|
|
@ -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, ) ) ]
|
||||||
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketClearTitles(Packet):
|
class PacketClearTitles(Packet):
|
||||||
__slots__ = ( 'id', 'reset' )
|
__slots__ = ( 'id', 'reset' )
|
||||||
|
|
||||||
reset : bool
|
reset : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
reset:bool=None,
|
reset:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
reset=reset
|
reset=reset
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,10 +23,18 @@ class PacketClearTitles(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 16,
|
755 : 16,
|
||||||
756 : 16,
|
756 : 16,
|
||||||
757 : 16
|
757 : 16,
|
||||||
|
758 : 16,
|
||||||
|
759 : 13,
|
||||||
|
760 : 13,
|
||||||
|
761 : 12
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ( 'reset', Boolean ) ],
|
755 : [ ( 'reset', Boolean ) ],
|
||||||
756 : [ ( 'reset', Boolean ) ],
|
756 : [ ( 'reset', Boolean ) ],
|
||||||
757 : [ ( 'reset', Boolean ) ]
|
757 : [ ( 'reset', Boolean ) ],
|
||||||
|
758 : [ ( 'reset', Boolean ) ],
|
||||||
|
759 : [ ( 'reset', Boolean ) ],
|
||||||
|
760 : [ ( 'reset', Boolean ) ],
|
||||||
|
761 : [ ( 'reset', Boolean ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCloseWindow(Packet):
|
class PacketCloseWindow(Packet):
|
||||||
__slots__ = ( 'id', 'windowId' )
|
__slots__ = ( 'id', 'windowId' )
|
||||||
|
|
||||||
windowId : int
|
windowId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
windowId:int=None,
|
windowId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
windowId=windowId
|
windowId=windowId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketCloseWindow(Packet):
|
||||||
751 : 18,
|
751 : 18,
|
||||||
755 : 19,
|
755 : 19,
|
||||||
756 : 19,
|
756 : 19,
|
||||||
757 : 19
|
757 : 19,
|
||||||
|
758 : 19,
|
||||||
|
759 : 16,
|
||||||
|
760 : 16,
|
||||||
|
761 : 15
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'windowId', Byte ) ],
|
47 : [ ( 'windowId', Byte ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketCloseWindow(Packet):
|
||||||
751 : [ ( 'windowId', Byte ) ],
|
751 : [ ( 'windowId', Byte ) ],
|
||||||
755 : [ ( 'windowId', Byte ) ],
|
755 : [ ( 'windowId', Byte ) ],
|
||||||
756 : [ ( 'windowId', Byte ) ],
|
756 : [ ( 'windowId', Byte ) ],
|
||||||
757 : [ ( 'windowId', Byte ) ]
|
757 : [ ( 'windowId', Byte ) ],
|
||||||
|
758 : [ ( 'windowId', Byte ) ],
|
||||||
|
759 : [ ( 'windowId', Byte ) ],
|
||||||
|
760 : [ ( 'windowId', Byte ) ],
|
||||||
|
761 : [ ( 'windowId', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCollect(Packet):
|
class PacketCollect(Packet):
|
||||||
__slots__ = ( 'id', 'collectedEntityId', 'collectorEntityId', 'pickupItemCount' )
|
__slots__ = ( 'id', 'collectedEntityId', 'collectorEntityId', 'pickupItemCount' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketCollect(Packet):
|
||||||
collectorEntityId : int
|
collectorEntityId : int
|
||||||
pickupItemCount : int
|
pickupItemCount : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
collectedEntityId:int=None,
|
collectedEntityId:int | None = None,
|
||||||
collectorEntityId:int=None,
|
collectorEntityId:int | None = None,
|
||||||
pickupItemCount:int=None,
|
pickupItemCount:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
collectedEntityId=collectedEntityId,
|
collectedEntityId=collectedEntityId,
|
||||||
collectorEntityId=collectorEntityId,
|
collectorEntityId=collectorEntityId,
|
||||||
pickupItemCount=pickupItemCount
|
pickupItemCount=pickupItemCount
|
||||||
|
@ -63,7 +63,11 @@ class PacketCollect(Packet):
|
||||||
751 : 85,
|
751 : 85,
|
||||||
755 : 96,
|
755 : 96,
|
||||||
756 : 96,
|
756 : 96,
|
||||||
757 : 97
|
757 : 97,
|
||||||
|
758 : 97,
|
||||||
|
759 : 98,
|
||||||
|
760 : 101,
|
||||||
|
761 : 99
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ) ],
|
47 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketCollect(Packet):
|
||||||
751 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
751 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
755 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
755 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
756 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
756 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
757 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ]
|
757 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
|
758 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
|
759 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
|
760 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ],
|
||||||
|
761 : [ ( 'collectedEntityId', VarInt ), ( 'collectorEntityId', VarInt ), ( 'pickupItemCount', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCombatEvent(Packet):
|
class PacketCombatEvent(Packet):
|
||||||
__slots__ = ( 'id', 'duration', 'entityId', 'event', 'message', 'playerId' )
|
__slots__ = ( 'id', 'duration', 'entityId', 'event', 'message', 'playerId' )
|
||||||
|
@ -14,15 +14,15 @@ class PacketCombatEvent(Packet):
|
||||||
message : Union[None, str]
|
message : Union[None, str]
|
||||||
playerId : Union[None, int]
|
playerId : Union[None, int]
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
duration:Union[None, int]=None,
|
duration:Union[None, int] | None = None,
|
||||||
entityId:Union[None, int]=None,
|
entityId:Union[None, int] | None = None,
|
||||||
event:int=None,
|
event:int | None = None,
|
||||||
message:Union[None, str]=None,
|
message:Union[None, str] | None = None,
|
||||||
playerId:Union[None, int]=None,
|
playerId:Union[None, int] | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
duration=duration,
|
duration=duration,
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
event=event,
|
event=event,
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCraftProgressBar(Packet):
|
class PacketCraftProgressBar(Packet):
|
||||||
__slots__ = ( 'id', 'property', 'value', 'windowId' )
|
__slots__ = ( 'id', 'property', 'value', 'windowId' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketCraftProgressBar(Packet):
|
||||||
value : int
|
value : int
|
||||||
windowId : int
|
windowId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
property:int=None,
|
property:int | None = None,
|
||||||
value:int=None,
|
value:int | None = None,
|
||||||
windowId:int=None,
|
windowId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
property=property,
|
property=property,
|
||||||
value=value,
|
value=value,
|
||||||
windowId=windowId
|
windowId=windowId
|
||||||
|
@ -63,7 +63,11 @@ class PacketCraftProgressBar(Packet):
|
||||||
751 : 20,
|
751 : 20,
|
||||||
755 : 21,
|
755 : 21,
|
||||||
756 : 21,
|
756 : 21,
|
||||||
757 : 21
|
757 : 21,
|
||||||
|
758 : 21,
|
||||||
|
759 : 18,
|
||||||
|
760 : 18,
|
||||||
|
761 : 17
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
47 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketCraftProgressBar(Packet):
|
||||||
751 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
751 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
755 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
755 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
756 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
756 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
757 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ]
|
757 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
|
758 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
|
759 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
|
760 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ],
|
||||||
|
761 : [ ( 'windowId', Byte ), ( 'property', Short ), ( 'value', Short ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCraftRecipeResponse(Packet):
|
class PacketCraftRecipeResponse(Packet):
|
||||||
__slots__ = ( 'id', 'recipe', 'windowId' )
|
__slots__ = ( 'id', 'recipe', 'windowId' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketCraftRecipeResponse(Packet):
|
||||||
recipe : Union[int,str]
|
recipe : Union[int,str]
|
||||||
windowId : int
|
windowId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
recipe:Union[int,str]=None,
|
recipe:Union[int,str] | None = None,
|
||||||
windowId:int=None,
|
windowId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
recipe=recipe,
|
recipe=recipe,
|
||||||
windowId=windowId
|
windowId=windowId
|
||||||
)
|
)
|
||||||
|
@ -46,7 +46,11 @@ class PacketCraftRecipeResponse(Packet):
|
||||||
751 : 47,
|
751 : 47,
|
||||||
755 : 49,
|
755 : 49,
|
||||||
756 : 49,
|
756 : 49,
|
||||||
757 : 49
|
757 : 49,
|
||||||
|
758 : 49,
|
||||||
|
759 : 46,
|
||||||
|
760 : 48,
|
||||||
|
761 : 47
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
338 : [ ( 'windowId', Byte ), ( 'recipe', VarInt ) ],
|
338 : [ ( 'windowId', Byte ), ( 'recipe', VarInt ) ],
|
||||||
|
@ -71,5 +75,9 @@ class PacketCraftRecipeResponse(Packet):
|
||||||
751 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
751 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
755 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
755 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
756 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
756 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
757 : [ ( 'windowId', Byte ), ( 'recipe', String ) ]
|
757 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
|
758 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
|
759 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
|
760 : [ ( 'windowId', Byte ), ( 'recipe', String ) ],
|
||||||
|
761 : [ ( 'windowId', Byte ), ( 'recipe', String ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketCustomPayload(Packet):
|
class PacketCustomPayload(Packet):
|
||||||
__slots__ = ( 'id', 'channel', 'data' )
|
__slots__ = ( 'id', 'channel', 'data' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketCustomPayload(Packet):
|
||||||
channel : str
|
channel : str
|
||||||
data : bytes
|
data : bytes
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
channel:str=None,
|
channel:str | None = None,
|
||||||
data:bytes=None,
|
data:bytes | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
channel=channel,
|
channel=channel,
|
||||||
data=data
|
data=data
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketCustomPayload(Packet):
|
||||||
751 : 23,
|
751 : 23,
|
||||||
755 : 24,
|
755 : 24,
|
||||||
756 : 24,
|
756 : 24,
|
||||||
757 : 24
|
757 : 24,
|
||||||
|
758 : 24,
|
||||||
|
759 : 21,
|
||||||
|
760 : 22,
|
||||||
|
761 : 21
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
47 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketCustomPayload(Packet):
|
||||||
751 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
751 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
755 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
755 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
756 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
756 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
757 : [ ( 'channel', String ), ( 'data', TrailingData ) ]
|
757 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
758 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
759 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
760 : [ ( 'channel', String ), ( 'data', TrailingData ) ],
|
||||||
|
761 : [ ( 'channel', String ), ( 'data', TrailingData ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketDeathCombatEvent(Packet):
|
class PacketDeathCombatEvent(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'message', 'playerId' )
|
__slots__ = ( 'id', 'entityId', 'message', 'playerId' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketDeathCombatEvent(Packet):
|
||||||
message : str
|
message : str
|
||||||
playerId : int
|
playerId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
message:str=None,
|
message:str | None = None,
|
||||||
playerId:int=None,
|
playerId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
message=message,
|
message=message,
|
||||||
playerId=playerId
|
playerId=playerId
|
||||||
|
@ -29,10 +29,18 @@ class PacketDeathCombatEvent(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 53,
|
755 : 53,
|
||||||
756 : 53,
|
756 : 53,
|
||||||
757 : 53
|
757 : 53,
|
||||||
|
758 : 53,
|
||||||
|
759 : 51,
|
||||||
|
760 : 54,
|
||||||
|
761 : 52
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
755 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
756 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
756 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
757 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ]
|
757 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
|
758 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
|
759 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
|
760 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ],
|
||||||
|
761 : [ ( 'playerId', VarInt ), ( 'entityId', Int ), ( 'message', String ) ]
|
||||||
}
|
}
|
|
@ -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 ) ]
|
||||||
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketDeclareRecipes(Packet):
|
class PacketDeclareRecipes(Packet):
|
||||||
__slots__ = ( 'id', 'recipes' )
|
__slots__ = ( 'id', 'recipes' )
|
||||||
|
|
||||||
recipes : list
|
recipes : list
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
recipes:list=None,
|
recipes:list | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
recipes=recipes
|
recipes=recipes
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,7 +41,11 @@ class PacketDeclareRecipes(Packet):
|
||||||
751 : 90,
|
751 : 90,
|
||||||
755 : 101,
|
755 : 101,
|
||||||
756 : 101,
|
756 : 101,
|
||||||
757 : 102
|
757 : 102,
|
||||||
|
758 : 102,
|
||||||
|
759 : 103,
|
||||||
|
760 : 106,
|
||||||
|
761 : 105
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
351 : [ ( 'recipes', ArrayType(StructType(( 'recipeId', String ), ( 'type', String ), ( 'data', SwitchType('type', { 'crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(ArrayType(Slot, VarInt, ), 'height', ), 'width', ) ), ( 'result', Slot ), ), 'crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(ArrayType(Slot, VarInt, ), VarInt, ) ), ( 'result', Slot ), ), 'crafting_special_armordye' : Void, 'crafting_special_banneraddpattern' : Void, 'crafting_special_bannerduplicate' : Void, 'crafting_special_bookcloning' : Void, 'crafting_special_firework_rocket' : Void, 'crafting_special_firework_star' : Void, 'crafting_special_firework_star_fade' : Void, 'crafting_special_mapcloning' : Void, 'crafting_special_mapextending' : Void, 'crafting_special_repairitem' : Void, 'crafting_special_shielddecoration' : Void, 'crafting_special_shulkerboxcoloring' : Void, 'crafting_special_tippedarrow' : Void }, None, ) ), ), VarInt, ) ) ],
|
351 : [ ( 'recipes', ArrayType(StructType(( 'recipeId', String ), ( 'type', String ), ( 'data', SwitchType('type', { 'crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(ArrayType(Slot, VarInt, ), 'height', ), 'width', ) ), ( 'result', Slot ), ), 'crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(ArrayType(Slot, VarInt, ), VarInt, ) ), ( 'result', Slot ), ), 'crafting_special_armordye' : Void, 'crafting_special_banneraddpattern' : Void, 'crafting_special_bannerduplicate' : Void, 'crafting_special_bookcloning' : Void, 'crafting_special_firework_rocket' : Void, 'crafting_special_firework_star' : Void, 'crafting_special_firework_star_fade' : Void, 'crafting_special_mapcloning' : Void, 'crafting_special_mapextending' : Void, 'crafting_special_repairitem' : Void, 'crafting_special_shielddecoration' : Void, 'crafting_special_shulkerboxcoloring' : Void, 'crafting_special_tippedarrow' : Void }, None, ) ), ), VarInt, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'width', ), 'height', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
755 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
755 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
756 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
756 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
757 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ]
|
757 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
|
758 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
|
759 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
|
760 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : Void, 'minecraft:crafting_special_banneraddpattern' : Void, 'minecraft:crafting_special_bannerduplicate' : Void, 'minecraft:crafting_special_bookcloning' : Void, 'minecraft:crafting_special_firework_rocket' : Void, 'minecraft:crafting_special_firework_star' : Void, 'minecraft:crafting_special_firework_star_fade' : Void, 'minecraft:crafting_special_mapcloning' : Void, 'minecraft:crafting_special_mapextending' : Void, 'minecraft:crafting_special_repairitem' : Void, 'minecraft:crafting_special_shielddecoration' : Void, 'minecraft:crafting_special_shulkerboxcoloring' : Void, 'minecraft:crafting_special_suspiciousstew' : Void, 'minecraft:crafting_special_tippedarrow' : Void, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ],
|
||||||
|
761 : [ ( 'recipes', ArrayType(StructType(( 'type', String ), ( 'recipeId', String ), ( 'data', SwitchType('type', { 'minecraft:blasting' : TrailingData, 'minecraft:campfire_cooking' : TrailingData, 'minecraft:crafting_shaped' : StructType(( 'width', VarInt ), ( 'height', VarInt ), ( 'group', String ), ( 'category', VarInt ), ( 'ingredients', ArrayType(ArrayType(TrailingData, 'height', ), 'width', ) ), ( 'result', Slot ), ), 'minecraft:crafting_shapeless' : StructType(( 'group', String ), ( 'category', VarInt ), ( 'ingredients', ArrayType(TrailingData, VarInt, ) ), ( 'result', Slot ), ), 'minecraft:crafting_special_armordye' : TrailingData, 'minecraft:crafting_special_banneraddpattern' : TrailingData, 'minecraft:crafting_special_bannerduplicate' : TrailingData, 'minecraft:crafting_special_bookcloning' : TrailingData, 'minecraft:crafting_special_firework_rocket' : TrailingData, 'minecraft:crafting_special_firework_star' : TrailingData, 'minecraft:crafting_special_firework_star_fade' : TrailingData, 'minecraft:crafting_special_mapcloning' : TrailingData, 'minecraft:crafting_special_mapextending' : TrailingData, 'minecraft:crafting_special_repairitem' : TrailingData, 'minecraft:crafting_special_shielddecoration' : TrailingData, 'minecraft:crafting_special_shulkerboxcoloring' : TrailingData, 'minecraft:crafting_special_suspiciousstew' : TrailingData, 'minecraft:crafting_special_tippedarrow' : TrailingData, 'minecraft:smelting' : TrailingData, 'minecraft:smithing' : StructType(( 'base', TrailingData ), ( 'addition', TrailingData ), ( 'result', Slot ), ), 'minecraft:smoking' : TrailingData, 'minecraft:stonecutting' : StructType(( 'group', String ), ( 'ingredient', TrailingData ), ( 'result', Slot ), ) }, None, ) ), ), VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketDestroyEntity(Packet):
|
class PacketDestroyEntity(Packet):
|
||||||
__slots__ = ( 'id', 'entityId' )
|
__slots__ = ( 'id', 'entityId' )
|
||||||
|
|
||||||
entityId : int
|
entityId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId
|
entityId=entityId
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketDifficulty(Packet):
|
class PacketDifficulty(Packet):
|
||||||
__slots__ = ( 'id', 'difficulty', 'difficultyLocked' )
|
__slots__ = ( 'id', 'difficulty', 'difficultyLocked' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketDifficulty(Packet):
|
||||||
difficulty : int
|
difficulty : int
|
||||||
difficultyLocked : bool
|
difficultyLocked : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
difficulty:int=None,
|
difficulty:int | None = None,
|
||||||
difficultyLocked:bool=None,
|
difficultyLocked:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
difficulty=difficulty,
|
difficulty=difficulty,
|
||||||
difficultyLocked=difficultyLocked
|
difficultyLocked=difficultyLocked
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketDifficulty(Packet):
|
||||||
751 : 13,
|
751 : 13,
|
||||||
755 : 14,
|
755 : 14,
|
||||||
756 : 14,
|
756 : 14,
|
||||||
757 : 14
|
757 : 14,
|
||||||
|
758 : 14,
|
||||||
|
759 : 11,
|
||||||
|
760 : 11,
|
||||||
|
761 : 11
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'difficulty', Byte ) ],
|
47 : [ ( 'difficulty', Byte ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketDifficulty(Packet):
|
||||||
751 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
751 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
755 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
755 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
756 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
756 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
757 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ]
|
757 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
|
758 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
|
759 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
|
760 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ],
|
||||||
|
761 : [ ( 'difficulty', Byte ), ( 'difficultyLocked', Boolean ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEndCombatEvent(Packet):
|
class PacketEndCombatEvent(Packet):
|
||||||
__slots__ = ( 'id', 'duration', 'entityId' )
|
__slots__ = ( 'id', 'duration', 'entityId' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketEndCombatEvent(Packet):
|
||||||
duration : int
|
duration : int
|
||||||
entityId : int
|
entityId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
duration:int=None,
|
duration:int | None = None,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
duration=duration,
|
duration=duration,
|
||||||
entityId=entityId
|
entityId=entityId
|
||||||
)
|
)
|
||||||
|
@ -26,10 +26,18 @@ class PacketEndCombatEvent(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 51,
|
755 : 51,
|
||||||
756 : 51,
|
756 : 51,
|
||||||
757 : 51
|
757 : 51,
|
||||||
|
758 : 51,
|
||||||
|
759 : 49,
|
||||||
|
760 : 52,
|
||||||
|
761 : 50
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
755 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
756 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
756 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
757 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ]
|
757 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
|
758 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
|
759 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
|
760 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ],
|
||||||
|
761 : [ ( 'duration', VarInt ), ( 'entityId', Int ) ]
|
||||||
}
|
}
|
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEnterCombatEvent(Packet):
|
class PacketEnterCombatEvent(Packet):
|
||||||
__slots__ = ( 'id' )
|
__slots__ = ( 'id' )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,10 +22,18 @@ class PacketEnterCombatEvent(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 52,
|
755 : 52,
|
||||||
756 : 52,
|
756 : 52,
|
||||||
757 : 52
|
757 : 52,
|
||||||
|
758 : 52,
|
||||||
|
759 : 50,
|
||||||
|
760 : 53,
|
||||||
|
761 : 51
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ],
|
755 : [ ],
|
||||||
756 : [ ],
|
756 : [ ],
|
||||||
757 : [ ]
|
757 : [ ],
|
||||||
|
758 : [ ],
|
||||||
|
759 : [ ],
|
||||||
|
760 : [ ],
|
||||||
|
761 : [ ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntity(Packet):
|
class PacketEntity(Packet):
|
||||||
__slots__ = ( 'id', 'entityId' )
|
__slots__ = ( 'id', 'entityId' )
|
||||||
|
|
||||||
entityId : int
|
entityId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId
|
entityId=entityId
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityDestroy(Packet):
|
class PacketEntityDestroy(Packet):
|
||||||
__slots__ = ( 'id', 'entityIds' )
|
__slots__ = ( 'id', 'entityIds' )
|
||||||
|
|
||||||
entityIds : list
|
entityIds : list
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityIds:list=None,
|
entityIds:list | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityIds=entityIds
|
entityIds=entityIds
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -56,7 +56,11 @@ class PacketEntityDestroy(Packet):
|
||||||
736 : 55,
|
736 : 55,
|
||||||
751 : 54,
|
751 : 54,
|
||||||
756 : 58,
|
756 : 58,
|
||||||
757 : 58
|
757 : 58,
|
||||||
|
758 : 58,
|
||||||
|
759 : 56,
|
||||||
|
760 : 59,
|
||||||
|
761 : 58
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
47 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
|
@ -94,5 +98,9 @@ class PacketEntityDestroy(Packet):
|
||||||
736 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
736 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
751 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
751 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
756 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
756 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
757 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ]
|
757 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
|
758 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
|
759 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
|
760 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ],
|
||||||
|
761 : [ ( 'entityIds', ArrayType(VarInt, VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -2,31 +2,34 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityEffect(Packet):
|
class PacketEntityEffect(Packet):
|
||||||
__slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'hideParticles' )
|
__slots__ = ( 'id', 'amplifier', 'duration', 'effectId', 'entityId', 'factorCodec', 'hideParticles' )
|
||||||
|
|
||||||
amplifier : int
|
amplifier : int
|
||||||
duration : int
|
duration : int
|
||||||
effectId : int
|
effectId : int
|
||||||
entityId : int
|
entityId : int
|
||||||
|
factorCodec : tuple
|
||||||
hideParticles : Union[bool,int]
|
hideParticles : Union[bool,int]
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
amplifier:int=None,
|
amplifier:int | None = None,
|
||||||
duration:int=None,
|
duration:int | None = None,
|
||||||
effectId:int=None,
|
effectId:int | None = None,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
hideParticles:Union[bool,int]=None,
|
factorCodec:tuple | None = None,
|
||||||
|
hideParticles:Union[bool,int] | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
amplifier=amplifier,
|
amplifier=amplifier,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
effectId=effectId,
|
effectId=effectId,
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
|
factorCodec=factorCodec,
|
||||||
hideParticles=hideParticles
|
hideParticles=hideParticles
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,7 +72,11 @@ class PacketEntityEffect(Packet):
|
||||||
751 : 89,
|
751 : 89,
|
||||||
755 : 100,
|
755 : 100,
|
||||||
756 : 100,
|
756 : 100,
|
||||||
757 : 101
|
757 : 101,
|
||||||
|
758 : 101,
|
||||||
|
759 : 102,
|
||||||
|
760 : 105,
|
||||||
|
761 : 104
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Boolean ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Boolean ) ],
|
||||||
|
@ -108,5 +115,9 @@ class PacketEntityEffect(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'effectId', Byte ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'effectId', VarInt ), ( 'amplifier', Byte ), ( 'duration', VarInt ), ( 'hideParticles', Byte ), ( 'factorCodec', OptionalType(NBTTag, ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityEquipment(Packet):
|
class PacketEntityEquipment(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'equipments', 'item', 'slot' )
|
__slots__ = ( 'id', 'entityId', 'equipments', 'item', 'slot' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketEntityEquipment(Packet):
|
||||||
item : Item
|
item : Item
|
||||||
slot : int
|
slot : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
equipments:bytes=None,
|
equipments:bytes | None = None,
|
||||||
item:Item=None,
|
item:Item | None = None,
|
||||||
slot:int=None,
|
slot:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
equipments=equipments,
|
equipments=equipments,
|
||||||
item=item,
|
item=item,
|
||||||
|
@ -66,7 +66,11 @@ class PacketEntityEquipment(Packet):
|
||||||
751 : 71,
|
751 : 71,
|
||||||
755 : 80,
|
755 : 80,
|
||||||
756 : 80,
|
756 : 80,
|
||||||
757 : 80
|
757 : 80,
|
||||||
|
758 : 80,
|
||||||
|
759 : 80,
|
||||||
|
760 : 83,
|
||||||
|
761 : 81
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'slot', Short ), ( 'item', Slot ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'slot', Short ), ( 'item', Slot ) ],
|
||||||
|
@ -105,5 +109,9 @@ class PacketEntityEquipment(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'equipments', TrailingData ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityHeadRotation(Packet):
|
class PacketEntityHeadRotation(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'headYaw' )
|
__slots__ = ( 'id', 'entityId', 'headYaw' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketEntityHeadRotation(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
headYaw : int
|
headYaw : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
headYaw:int=None,
|
headYaw:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
headYaw=headYaw
|
headYaw=headYaw
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketEntityHeadRotation(Packet):
|
||||||
751 : 58,
|
751 : 58,
|
||||||
755 : 62,
|
755 : 62,
|
||||||
756 : 62,
|
756 : 62,
|
||||||
757 : 62
|
757 : 62,
|
||||||
|
758 : 62,
|
||||||
|
759 : 60,
|
||||||
|
760 : 63,
|
||||||
|
761 : 62
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketEntityHeadRotation(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'headYaw', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityLook(Packet):
|
class PacketEntityLook(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'yaw' )
|
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'yaw' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketEntityLook(Packet):
|
||||||
pitch : int
|
pitch : int
|
||||||
yaw : int
|
yaw : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
onGround:bool=None,
|
onGround:bool | None = None,
|
||||||
pitch:int=None,
|
pitch:int | None = None,
|
||||||
yaw:int=None,
|
yaw:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
onGround=onGround,
|
onGround=onGround,
|
||||||
pitch=pitch,
|
pitch=pitch,
|
||||||
|
@ -66,7 +66,11 @@ class PacketEntityLook(Packet):
|
||||||
751 : 41,
|
751 : 41,
|
||||||
755 : 43,
|
755 : 43,
|
||||||
756 : 43,
|
756 : 43,
|
||||||
757 : 43
|
757 : 43,
|
||||||
|
758 : 43,
|
||||||
|
759 : 40,
|
||||||
|
760 : 42,
|
||||||
|
761 : 41
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
@ -105,5 +109,9 @@ class PacketEntityLook(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityMetadata(Packet):
|
class PacketEntityMetadata(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'metadata' )
|
__slots__ = ( 'id', 'entityId', 'metadata' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketEntityMetadata(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
metadata : dict
|
metadata : dict
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
metadata:dict=None,
|
metadata:dict | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
metadata=metadata
|
metadata=metadata
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketEntityMetadata(Packet):
|
||||||
751 : 68,
|
751 : 68,
|
||||||
755 : 77,
|
755 : 77,
|
||||||
756 : 77,
|
756 : 77,
|
||||||
757 : 77
|
757 : 77,
|
||||||
|
758 : 77,
|
||||||
|
759 : 77,
|
||||||
|
760 : 80,
|
||||||
|
761 : 78
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketEntityMetadata(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'metadata', EntityMetadata ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityMoveLook(Packet):
|
class PacketEntityMoveLook(Packet):
|
||||||
__slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround', 'pitch', 'yaw' )
|
__slots__ = ( 'id', 'dX', 'dY', 'dZ', 'entityId', 'onGround', 'pitch', 'yaw' )
|
||||||
|
@ -16,17 +16,17 @@ class PacketEntityMoveLook(Packet):
|
||||||
pitch : int
|
pitch : int
|
||||||
yaw : int
|
yaw : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
dX:int=None,
|
dX:int | None = None,
|
||||||
dY:int=None,
|
dY:int | None = None,
|
||||||
dZ:int=None,
|
dZ:int | None = None,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
onGround:bool=None,
|
onGround:bool | None = None,
|
||||||
pitch:int=None,
|
pitch:int | None = None,
|
||||||
yaw:int=None,
|
yaw:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
dX=dX,
|
dX=dX,
|
||||||
dY=dY,
|
dY=dY,
|
||||||
dZ=dZ,
|
dZ=dZ,
|
||||||
|
@ -75,7 +75,11 @@ class PacketEntityMoveLook(Packet):
|
||||||
751 : 40,
|
751 : 40,
|
||||||
755 : 42,
|
755 : 42,
|
||||||
756 : 42,
|
756 : 42,
|
||||||
757 : 42
|
757 : 42,
|
||||||
|
758 : 42,
|
||||||
|
759 : 39,
|
||||||
|
760 : 41,
|
||||||
|
761 : 40
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'dX', Byte ), ( 'dY', Byte ), ( 'dZ', Byte ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
@ -114,5 +118,9 @@ class PacketEntityMoveLook(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'dX', Short ), ( 'dY', Short ), ( 'dZ', Short ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
||||||
}
|
}
|
|
@ -2,30 +2,36 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntitySoundEffect(Packet):
|
class PacketEntitySoundEffect(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'pitch', 'soundCategory', 'soundId', 'volume' )
|
__slots__ = ( 'id', 'entityId', 'pitch', 'seed', 'soundCategory', 'soundEvent', 'soundId', 'volume' )
|
||||||
|
|
||||||
entityId : int
|
entityId : int
|
||||||
pitch : float
|
pitch : float
|
||||||
|
seed : int
|
||||||
soundCategory : int
|
soundCategory : int
|
||||||
|
soundEvent : Union[None, dict]
|
||||||
soundId : int
|
soundId : int
|
||||||
volume : float
|
volume : float
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
pitch:float=None,
|
pitch:float | None = None,
|
||||||
soundCategory:int=None,
|
seed:int | None = None,
|
||||||
soundId:int=None,
|
soundCategory:int | None = None,
|
||||||
volume:float=None,
|
soundEvent:Union[None, dict] | None = None,
|
||||||
|
soundId:int | None = None,
|
||||||
|
volume:float | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
pitch=pitch,
|
pitch=pitch,
|
||||||
|
seed=seed,
|
||||||
soundCategory=soundCategory,
|
soundCategory=soundCategory,
|
||||||
|
soundEvent=soundEvent,
|
||||||
soundId=soundId,
|
soundId=soundId,
|
||||||
volume=volume
|
volume=volume
|
||||||
)
|
)
|
||||||
|
@ -47,7 +53,11 @@ class PacketEntitySoundEffect(Packet):
|
||||||
751 : 80,
|
751 : 80,
|
||||||
755 : 91,
|
755 : 91,
|
||||||
756 : 91,
|
756 : 91,
|
||||||
757 : 92
|
757 : 92,
|
||||||
|
758 : 92,
|
||||||
|
759 : 92,
|
||||||
|
760 : 95,
|
||||||
|
761 : 93
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
477 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
477 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
|
@ -64,5 +74,9 @@ class PacketEntitySoundEffect(Packet):
|
||||||
751 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
751 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
755 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
755 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
756 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
756 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
757 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ]
|
757 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
|
758 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
|
759 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ) ],
|
||||||
|
760 : [ ( 'soundId', VarInt ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ],
|
||||||
|
761 : [ ( 'soundId', VarInt ), ( 'soundEvent', SwitchType('soundId', { 0 : StructType(( 'resource', String ), ( 'range', OptionalType(Float, ) ), ) }, None, ) ), ( 'soundCategory', VarInt ), ( 'entityId', VarInt ), ( 'volume', Float ), ( 'pitch', Float ), ( 'seed', Long ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityStatus(Packet):
|
class PacketEntityStatus(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'entityStatus' )
|
__slots__ = ( 'id', 'entityId', 'entityStatus' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketEntityStatus(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
entityStatus : int
|
entityStatus : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
entityStatus:int=None,
|
entityStatus:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
entityStatus=entityStatus
|
entityStatus=entityStatus
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketEntityStatus(Packet):
|
||||||
751 : 26,
|
751 : 26,
|
||||||
755 : 27,
|
755 : 27,
|
||||||
756 : 27,
|
756 : 27,
|
||||||
757 : 27
|
757 : 27,
|
||||||
|
758 : 27,
|
||||||
|
759 : 24,
|
||||||
|
760 : 26,
|
||||||
|
761 : 25
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
47 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketEntityStatus(Packet):
|
||||||
751 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
751 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
755 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
755 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
756 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
756 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
757 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ]
|
757 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
|
758 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
|
759 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
|
760 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ],
|
||||||
|
761 : [ ( 'entityId', Int ), ( 'entityStatus', Byte ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityTeleport(Packet):
|
class PacketEntityTeleport(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'x', 'y', 'yaw', 'z' )
|
__slots__ = ( 'id', 'entityId', 'onGround', 'pitch', 'x', 'y', 'yaw', 'z' )
|
||||||
|
@ -16,17 +16,17 @@ class PacketEntityTeleport(Packet):
|
||||||
yaw : int
|
yaw : int
|
||||||
z : Union[float,int]
|
z : Union[float,int]
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
onGround:bool=None,
|
onGround:bool | None = None,
|
||||||
pitch:int=None,
|
pitch:int | None = None,
|
||||||
x:Union[float,int]=None,
|
x:Union[float,int] | None = None,
|
||||||
y:Union[float,int]=None,
|
y:Union[float,int] | None = None,
|
||||||
yaw:int=None,
|
yaw:int | None = None,
|
||||||
z:Union[float,int]=None,
|
z:Union[float,int] | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
onGround=onGround,
|
onGround=onGround,
|
||||||
pitch=pitch,
|
pitch=pitch,
|
||||||
|
@ -75,7 +75,11 @@ class PacketEntityTeleport(Packet):
|
||||||
751 : 86,
|
751 : 86,
|
||||||
755 : 97,
|
755 : 97,
|
||||||
756 : 97,
|
756 : 97,
|
||||||
757 : 98
|
757 : 98,
|
||||||
|
758 : 98,
|
||||||
|
759 : 99,
|
||||||
|
760 : 102,
|
||||||
|
761 : 100
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'x', Int ), ( 'y', Int ), ( 'z', Int ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
@ -114,5 +118,9 @@ class PacketEntityTeleport(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'yaw', Byte ), ( 'pitch', Byte ), ( 'onGround', Boolean ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityUpdateAttributes(Packet):
|
class PacketEntityUpdateAttributes(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'properties' )
|
__slots__ = ( 'id', 'entityId', 'properties' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketEntityUpdateAttributes(Packet):
|
||||||
entityId : int
|
entityId : int
|
||||||
properties : list
|
properties : list
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
properties:list=None,
|
properties:list | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
properties=properties
|
properties=properties
|
||||||
)
|
)
|
||||||
|
@ -58,7 +58,11 @@ class PacketEntityUpdateAttributes(Packet):
|
||||||
751 : 88,
|
751 : 88,
|
||||||
755 : 99,
|
755 : 99,
|
||||||
756 : 99,
|
756 : 99,
|
||||||
757 : 100
|
757 : 100,
|
||||||
|
758 : 100,
|
||||||
|
759 : 101,
|
||||||
|
760 : 104,
|
||||||
|
761 : 102
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
107 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ],
|
107 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), Int, ) ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'properties', ArrayType(StructType(( 'key', String ), ( 'value', Double ), ( 'modifiers', ArrayType(StructType(( 'uuid', UUID ), ( 'amount', Double ), ( 'operation', Byte ), ), VarInt, ) ), ), VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketEntityVelocity(Packet):
|
class PacketEntityVelocity(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'velocityX', 'velocityY', 'velocityZ' )
|
__slots__ = ( 'id', 'entityId', 'velocityX', 'velocityY', 'velocityZ' )
|
||||||
|
@ -13,14 +13,14 @@ class PacketEntityVelocity(Packet):
|
||||||
velocityY : int
|
velocityY : int
|
||||||
velocityZ : int
|
velocityZ : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:int=None,
|
entityId:int | None = None,
|
||||||
velocityX:int=None,
|
velocityX:int | None = None,
|
||||||
velocityY:int=None,
|
velocityY:int | None = None,
|
||||||
velocityZ:int=None,
|
velocityZ:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
velocityX=velocityX,
|
velocityX=velocityX,
|
||||||
velocityY=velocityY,
|
velocityY=velocityY,
|
||||||
|
@ -66,7 +66,11 @@ class PacketEntityVelocity(Packet):
|
||||||
751 : 70,
|
751 : 70,
|
||||||
755 : 79,
|
755 : 79,
|
||||||
756 : 79,
|
756 : 79,
|
||||||
757 : 79
|
757 : 79,
|
||||||
|
758 : 79,
|
||||||
|
759 : 79,
|
||||||
|
760 : 82,
|
||||||
|
761 : 80
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
47 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
|
@ -105,5 +109,9 @@ class PacketEntityVelocity(Packet):
|
||||||
751 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
751 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
755 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
755 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
756 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
756 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
757 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ]
|
757 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
|
758 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
|
759 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
|
760 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ],
|
||||||
|
761 : [ ( 'entityId', VarInt ), ( 'velocityX', Short ), ( 'velocityY', Short ), ( 'velocityZ', Short ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketExperience(Packet):
|
class PacketExperience(Packet):
|
||||||
__slots__ = ( 'id', 'experienceBar', 'level', 'totalExperience' )
|
__slots__ = ( 'id', 'experienceBar', 'level', 'totalExperience' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketExperience(Packet):
|
||||||
level : int
|
level : int
|
||||||
totalExperience : int
|
totalExperience : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
experienceBar:float=None,
|
experienceBar:float | None = None,
|
||||||
level:int=None,
|
level:int | None = None,
|
||||||
totalExperience:int=None,
|
totalExperience:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
experienceBar=experienceBar,
|
experienceBar=experienceBar,
|
||||||
level=level,
|
level=level,
|
||||||
totalExperience=totalExperience
|
totalExperience=totalExperience
|
||||||
|
@ -63,7 +63,11 @@ class PacketExperience(Packet):
|
||||||
751 : 72,
|
751 : 72,
|
||||||
755 : 81,
|
755 : 81,
|
||||||
756 : 81,
|
756 : 81,
|
||||||
757 : 81
|
757 : 81,
|
||||||
|
758 : 81,
|
||||||
|
759 : 81,
|
||||||
|
760 : 84,
|
||||||
|
761 : 82
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
47 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
|
@ -102,5 +106,9 @@ class PacketExperience(Packet):
|
||||||
751 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
751 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
755 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
755 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
756 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
756 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
757 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ]
|
757 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
|
758 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
|
759 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
|
760 : [ ( 'experienceBar', Float ), ( 'level', VarInt ), ( 'totalExperience', VarInt ) ],
|
||||||
|
761 : [ ( 'experienceBar', Float ), ( 'totalExperience', VarInt ), ( 'level', VarInt ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketExplosion(Packet):
|
class PacketExplosion(Packet):
|
||||||
__slots__ = ( 'id', 'affectedBlockOffsets', 'playerMotionX', 'playerMotionY', 'playerMotionZ', 'radius', 'x', 'y', 'z' )
|
__slots__ = ( 'id', 'affectedBlockOffsets', 'playerMotionX', 'playerMotionY', 'playerMotionZ', 'radius', 'x', 'y', 'z' )
|
||||||
|
@ -17,18 +17,18 @@ class PacketExplosion(Packet):
|
||||||
y : float
|
y : float
|
||||||
z : float
|
z : float
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
affectedBlockOffsets:list=None,
|
affectedBlockOffsets:list | None = None,
|
||||||
playerMotionX:float=None,
|
playerMotionX:float | None = None,
|
||||||
playerMotionY:float=None,
|
playerMotionY:float | None = None,
|
||||||
playerMotionZ:float=None,
|
playerMotionZ:float | None = None,
|
||||||
radius:float=None,
|
radius:float | None = None,
|
||||||
x:float=None,
|
x:float | None = None,
|
||||||
y:float=None,
|
y:float | None = None,
|
||||||
z:float=None,
|
z:float | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
affectedBlockOffsets=affectedBlockOffsets,
|
affectedBlockOffsets=affectedBlockOffsets,
|
||||||
playerMotionX=playerMotionX,
|
playerMotionX=playerMotionX,
|
||||||
playerMotionY=playerMotionY,
|
playerMotionY=playerMotionY,
|
||||||
|
@ -78,7 +78,11 @@ class PacketExplosion(Packet):
|
||||||
751 : 27,
|
751 : 27,
|
||||||
755 : 28,
|
755 : 28,
|
||||||
756 : 28,
|
756 : 28,
|
||||||
757 : 28
|
757 : 28,
|
||||||
|
758 : 28,
|
||||||
|
759 : 25,
|
||||||
|
760 : 27,
|
||||||
|
761 : 26
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
47 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
|
@ -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 ) ],
|
751 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), Int, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
755 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
755 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
756 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
756 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
757 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ]
|
757 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
|
758 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
|
759 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
|
760 : [ ( 'x', Float ), ( 'y', Float ), ( 'z', Float ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ],
|
||||||
|
761 : [ ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'radius', Float ), ( 'affectedBlockOffsets', ArrayType(StructType(( 'x', Byte ), ( 'y', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'playerMotionX', Float ), ( 'playerMotionY', Float ), ( 'playerMotionZ', Float ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketFacePlayer(Packet):
|
class PacketFacePlayer(Packet):
|
||||||
__slots__ = ( 'id', 'entityId', 'entity_feet_eyes', 'feet_eyes', 'isEntity', 'x', 'y', 'z' )
|
__slots__ = ( 'id', 'entityId', 'entity_feet_eyes', 'feet_eyes', 'isEntity', 'x', 'y', 'z' )
|
||||||
|
@ -16,17 +16,17 @@ class PacketFacePlayer(Packet):
|
||||||
y : float
|
y : float
|
||||||
z : float
|
z : float
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
entityId:Union[None, int]=None,
|
entityId:Union[None, int] | None = None,
|
||||||
entity_feet_eyes:Union[None, str]=None,
|
entity_feet_eyes:Union[None, str] | None = None,
|
||||||
feet_eyes:int=None,
|
feet_eyes:int | None = None,
|
||||||
isEntity:bool=None,
|
isEntity:bool | None = None,
|
||||||
x:float=None,
|
x:float | None = None,
|
||||||
y:float=None,
|
y:float | None = None,
|
||||||
z:float=None,
|
z:float | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
entityId=entityId,
|
entityId=entityId,
|
||||||
entity_feet_eyes=entity_feet_eyes,
|
entity_feet_eyes=entity_feet_eyes,
|
||||||
feet_eyes=feet_eyes,
|
feet_eyes=feet_eyes,
|
||||||
|
@ -58,7 +58,11 @@ class PacketFacePlayer(Packet):
|
||||||
751 : 51,
|
751 : 51,
|
||||||
755 : 55,
|
755 : 55,
|
||||||
756 : 55,
|
756 : 55,
|
||||||
757 : 55
|
757 : 55,
|
||||||
|
758 : 55,
|
||||||
|
759 : 53,
|
||||||
|
760 : 56,
|
||||||
|
761 : 55
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
393 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
393 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
755 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
755 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
756 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
756 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
757 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ]
|
757 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
|
758 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
|
759 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
|
760 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ],
|
||||||
|
761 : [ ( 'feet_eyes', VarInt ), ( 'x', Double ), ( 'y', Double ), ( 'z', Double ), ( 'isEntity', Boolean ), ( 'entityId', SwitchType('isEntity', { 'true' : VarInt }, None, ) ), ( 'entity_feet_eyes', SwitchType('isEntity', { 'true' : String }, None, ) ) ]
|
||||||
}
|
}
|
28
src/aiocraft/proto/play/clientbound/packet_feature_flags.py
Normal file
28
src/aiocraft/proto/play/clientbound/packet_feature_flags.py
Normal 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, ) ) ]
|
||||||
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketGameStateChange(Packet):
|
class PacketGameStateChange(Packet):
|
||||||
__slots__ = ( 'id', 'gameMode', 'reason' )
|
__slots__ = ( 'id', 'gameMode', 'reason' )
|
||||||
|
@ -11,12 +11,12 @@ class PacketGameStateChange(Packet):
|
||||||
gameMode : float
|
gameMode : float
|
||||||
reason : int
|
reason : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
gameMode:float=None,
|
gameMode:float | None = None,
|
||||||
reason:int=None,
|
reason:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
gameMode=gameMode,
|
gameMode=gameMode,
|
||||||
reason=reason
|
reason=reason
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,11 @@ class PacketGameStateChange(Packet):
|
||||||
751 : 29,
|
751 : 29,
|
||||||
755 : 30,
|
755 : 30,
|
||||||
756 : 30,
|
756 : 30,
|
||||||
757 : 30
|
757 : 30,
|
||||||
|
758 : 30,
|
||||||
|
759 : 27,
|
||||||
|
760 : 29,
|
||||||
|
761 : 28
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
47 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
|
@ -99,5 +103,9 @@ class PacketGameStateChange(Packet):
|
||||||
751 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
751 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
755 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
755 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
756 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
756 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
757 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ]
|
757 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
|
758 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
|
759 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
|
760 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ],
|
||||||
|
761 : [ ( 'reason', Byte ), ( 'gameMode', Float ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketHeldItemSlot(Packet):
|
class PacketHeldItemSlot(Packet):
|
||||||
__slots__ = ( 'id', 'slot' )
|
__slots__ = ( 'id', 'slot' )
|
||||||
|
|
||||||
slot : int
|
slot : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
slot:int=None,
|
slot:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
slot=slot
|
slot=slot
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketHeldItemSlot(Packet):
|
||||||
751 : 63,
|
751 : 63,
|
||||||
755 : 72,
|
755 : 72,
|
||||||
756 : 72,
|
756 : 72,
|
||||||
757 : 72
|
757 : 72,
|
||||||
|
758 : 72,
|
||||||
|
759 : 71,
|
||||||
|
760 : 74,
|
||||||
|
761 : 73
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'slot', Byte ) ],
|
47 : [ ( 'slot', Byte ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketHeldItemSlot(Packet):
|
||||||
751 : [ ( 'slot', Byte ) ],
|
751 : [ ( 'slot', Byte ) ],
|
||||||
755 : [ ( 'slot', Byte ) ],
|
755 : [ ( 'slot', Byte ) ],
|
||||||
756 : [ ( 'slot', Byte ) ],
|
756 : [ ( 'slot', Byte ) ],
|
||||||
757 : [ ( 'slot', Byte ) ]
|
757 : [ ( 'slot', Byte ) ],
|
||||||
|
758 : [ ( 'slot', Byte ) ],
|
||||||
|
759 : [ ( 'slot', Byte ) ],
|
||||||
|
760 : [ ( 'slot', Byte ) ],
|
||||||
|
761 : [ ( 'slot', Byte ) ]
|
||||||
}
|
}
|
33
src/aiocraft/proto/play/clientbound/packet_hide_message.py
Normal file
33
src/aiocraft/proto/play/clientbound/packet_hide_message.py
Normal 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, ) ) ]
|
||||||
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketInitializeWorldBorder(Packet):
|
class PacketInitializeWorldBorder(Packet):
|
||||||
__slots__ = ( 'id', 'newDiameter', 'oldDiameter', 'portalTeleportBoundary', 'speed', 'warningBlocks', 'warningTime', 'x', 'z' )
|
__slots__ = ( 'id', 'newDiameter', 'oldDiameter', 'portalTeleportBoundary', 'speed', 'warningBlocks', 'warningTime', 'x', 'z' )
|
||||||
|
@ -17,18 +17,18 @@ class PacketInitializeWorldBorder(Packet):
|
||||||
x : float
|
x : float
|
||||||
z : float
|
z : float
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
newDiameter:float=None,
|
newDiameter:float | None = None,
|
||||||
oldDiameter:float=None,
|
oldDiameter:float | None = None,
|
||||||
portalTeleportBoundary:int=None,
|
portalTeleportBoundary:int | None = None,
|
||||||
speed:int=None,
|
speed:int | None = None,
|
||||||
warningBlocks:int=None,
|
warningBlocks:int | None = None,
|
||||||
warningTime:int=None,
|
warningTime:int | None = None,
|
||||||
x:float=None,
|
x:float | None = None,
|
||||||
z:float=None,
|
z:float | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
newDiameter=newDiameter,
|
newDiameter=newDiameter,
|
||||||
oldDiameter=oldDiameter,
|
oldDiameter=oldDiameter,
|
||||||
portalTeleportBoundary=portalTeleportBoundary,
|
portalTeleportBoundary=portalTeleportBoundary,
|
||||||
|
@ -44,10 +44,18 @@ class PacketInitializeWorldBorder(Packet):
|
||||||
_ids : Dict[int, int] = {
|
_ids : Dict[int, int] = {
|
||||||
755 : 32,
|
755 : 32,
|
||||||
756 : 32,
|
756 : 32,
|
||||||
757 : 32
|
757 : 32,
|
||||||
|
758 : 32,
|
||||||
|
759 : 29,
|
||||||
|
760 : 31,
|
||||||
|
761 : 30
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
755 : [ ( 'x', Double ), ( 'z', Double ), ( 'oldDiameter', Double ), ( 'newDiameter', Double ), ( 'speed', 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', VarInt ), ( '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', VarInt ), ( '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 ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketKeepAlive(Packet):
|
class PacketKeepAlive(Packet):
|
||||||
__slots__ = ( 'id', 'keepAliveId' )
|
__slots__ = ( 'id', 'keepAliveId' )
|
||||||
|
|
||||||
keepAliveId : int
|
keepAliveId : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
keepAliveId:int=None,
|
keepAliveId:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
keepAliveId=keepAliveId
|
keepAliveId=keepAliveId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketKeepAlive(Packet):
|
||||||
751 : 31,
|
751 : 31,
|
||||||
755 : 33,
|
755 : 33,
|
||||||
756 : 33,
|
756 : 33,
|
||||||
757 : 33
|
757 : 33,
|
||||||
|
758 : 33,
|
||||||
|
759 : 30,
|
||||||
|
760 : 32,
|
||||||
|
761 : 31
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'keepAliveId', VarInt ) ],
|
47 : [ ( 'keepAliveId', VarInt ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketKeepAlive(Packet):
|
||||||
751 : [ ( 'keepAliveId', Long ) ],
|
751 : [ ( 'keepAliveId', Long ) ],
|
||||||
755 : [ ( 'keepAliveId', Long ) ],
|
755 : [ ( 'keepAliveId', Long ) ],
|
||||||
756 : [ ( 'keepAliveId', Long ) ],
|
756 : [ ( 'keepAliveId', Long ) ],
|
||||||
757 : [ ( 'keepAliveId', Long ) ]
|
757 : [ ( 'keepAliveId', Long ) ],
|
||||||
|
758 : [ ( 'keepAliveId', Long ) ],
|
||||||
|
759 : [ ( 'keepAliveId', Long ) ],
|
||||||
|
760 : [ ( 'keepAliveId', Long ) ],
|
||||||
|
761 : [ ( 'keepAliveId', Long ) ]
|
||||||
}
|
}
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketKickDisconnect(Packet):
|
class PacketKickDisconnect(Packet):
|
||||||
__slots__ = ( 'id', 'reason' )
|
__slots__ = ( 'id', 'reason' )
|
||||||
|
|
||||||
reason : str
|
reason : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
reason:str=None,
|
reason:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
reason=reason
|
reason=reason
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -57,7 +57,11 @@ class PacketKickDisconnect(Packet):
|
||||||
751 : 25,
|
751 : 25,
|
||||||
755 : 26,
|
755 : 26,
|
||||||
756 : 26,
|
756 : 26,
|
||||||
757 : 26
|
757 : 26,
|
||||||
|
758 : 26,
|
||||||
|
759 : 23,
|
||||||
|
760 : 25,
|
||||||
|
761 : 23
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'reason', String ) ],
|
47 : [ ( 'reason', String ) ],
|
||||||
|
@ -96,5 +100,9 @@ class PacketKickDisconnect(Packet):
|
||||||
751 : [ ( 'reason', String ) ],
|
751 : [ ( 'reason', String ) ],
|
||||||
755 : [ ( 'reason', String ) ],
|
755 : [ ( 'reason', String ) ],
|
||||||
756 : [ ( 'reason', String ) ],
|
756 : [ ( 'reason', String ) ],
|
||||||
757 : [ ( 'reason', String ) ]
|
757 : [ ( 'reason', String ) ],
|
||||||
|
758 : [ ( 'reason', String ) ],
|
||||||
|
759 : [ ( 'reason', String ) ],
|
||||||
|
760 : [ ( 'reason', String ) ],
|
||||||
|
761 : [ ( 'reason', String ) ]
|
||||||
}
|
}
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketLogin(Packet):
|
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
|
difficulty : int
|
||||||
dimension : Union[dict,int,str]
|
dimension : Union[dict,int,str]
|
||||||
dimensionCodec : dict
|
dimensionCodec : dict
|
||||||
|
@ -26,29 +27,33 @@ class PacketLogin(Packet):
|
||||||
viewDistance : int
|
viewDistance : int
|
||||||
worldName : str
|
worldName : str
|
||||||
worldNames : list
|
worldNames : list
|
||||||
|
worldType : str
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
difficulty:int=None,
|
death:tuple | None = None,
|
||||||
dimension:Union[dict,int,str]=None,
|
difficulty:int | None = None,
|
||||||
dimensionCodec:dict=None,
|
dimension:Union[dict,int,str] | None = None,
|
||||||
enableRespawnScreen:bool=None,
|
dimensionCodec:dict | None = None,
|
||||||
entityId:int=None,
|
enableRespawnScreen:bool | None = None,
|
||||||
gameMode:int=None,
|
entityId:int | None = None,
|
||||||
hashedSeed:int=None,
|
gameMode:int | None = None,
|
||||||
isDebug:bool=None,
|
hashedSeed:int | None = None,
|
||||||
isFlat:bool=None,
|
isDebug:bool | None = None,
|
||||||
isHardcore:bool=None,
|
isFlat:bool | None = None,
|
||||||
levelType:str=None,
|
isHardcore:bool | None = None,
|
||||||
maxPlayers:int=None,
|
levelType:str | None = None,
|
||||||
previousGameMode:int=None,
|
maxPlayers:int | None = None,
|
||||||
reducedDebugInfo:bool=None,
|
previousGameMode:int | None = None,
|
||||||
simulationDistance:int=None,
|
reducedDebugInfo:bool | None = None,
|
||||||
viewDistance:int=None,
|
simulationDistance:int | None = None,
|
||||||
worldName:str=None,
|
viewDistance:int | None = None,
|
||||||
worldNames:list=None,
|
worldName:str | None = None,
|
||||||
|
worldNames:list | None = None,
|
||||||
|
worldType:str | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
|
death=death,
|
||||||
difficulty=difficulty,
|
difficulty=difficulty,
|
||||||
dimension=dimension,
|
dimension=dimension,
|
||||||
dimensionCodec=dimensionCodec,
|
dimensionCodec=dimensionCodec,
|
||||||
|
@ -66,7 +71,8 @@ class PacketLogin(Packet):
|
||||||
simulationDistance=simulationDistance,
|
simulationDistance=simulationDistance,
|
||||||
viewDistance=viewDistance,
|
viewDistance=viewDistance,
|
||||||
worldName=worldName,
|
worldName=worldName,
|
||||||
worldNames=worldNames
|
worldNames=worldNames,
|
||||||
|
worldType=worldType
|
||||||
)
|
)
|
||||||
|
|
||||||
_state : int = 3
|
_state : int = 3
|
||||||
|
@ -108,7 +114,11 @@ class PacketLogin(Packet):
|
||||||
751 : 36,
|
751 : 36,
|
||||||
755 : 38,
|
755 : 38,
|
||||||
756 : 38,
|
756 : 38,
|
||||||
757 : 38
|
757 : 38,
|
||||||
|
758 : 38,
|
||||||
|
759 : 35,
|
||||||
|
760 : 37,
|
||||||
|
761 : 36
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'entityId', Int ), ( 'gameMode', Byte ), ( 'dimension', Byte ), ( 'difficulty', Byte ), ( 'maxPlayers', Byte ), ( 'levelType', String ), ( 'reducedDebugInfo', Boolean ) ],
|
47 : [ ( 'entityId', Int ), ( 'gameMode', Byte ), ( 'dimension', Byte ), ( 'difficulty', Byte ), ( 'maxPlayers', Byte ), ( 'levelType', String ), ( 'reducedDebugInfo', Boolean ) ],
|
||||||
|
@ -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 ) ],
|
751 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
||||||
755 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
755 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
||||||
756 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
756 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
||||||
757 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ]
|
757 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
||||||
|
758 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'dimension', NBTTag ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ) ],
|
||||||
|
759 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ],
|
||||||
|
760 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ],
|
||||||
|
761 : [ ( 'entityId', Int ), ( 'isHardcore', Boolean ), ( 'gameMode', Byte ), ( 'previousGameMode', Byte ), ( 'worldNames', ArrayType(String, VarInt, ) ), ( 'dimensionCodec', NBTTag ), ( 'worldType', String ), ( 'worldName', String ), ( 'hashedSeed', Long ), ( 'maxPlayers', VarInt ), ( 'viewDistance', VarInt ), ( 'simulationDistance', VarInt ), ( 'reducedDebugInfo', Boolean ), ( 'enableRespawnScreen', Boolean ), ( 'isDebug', Boolean ), ( 'isFlat', Boolean ), ( 'death', OptionalType(StructType(( 'dimensionName', String ), ( 'location', Position ), ), ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketMap(Packet):
|
class PacketMap(Packet):
|
||||||
__slots__ = ( 'id', 'columns', 'data', 'icons', 'itemDamage', 'locked', 'rows', 'scale', 'trackingPosition', 'x', 'y' )
|
__slots__ = ( 'id', 'columns', 'data', 'icons', 'itemDamage', 'locked', 'rows', 'scale', 'trackingPosition', 'x', 'y' )
|
||||||
|
@ -19,20 +19,20 @@ class PacketMap(Packet):
|
||||||
x : Union[None, int]
|
x : Union[None, int]
|
||||||
y : Union[None, int]
|
y : Union[None, int]
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
columns:int=None,
|
columns:int | None = None,
|
||||||
data:Union[None, bytes]=None,
|
data:Union[None, bytes] | None = None,
|
||||||
icons:Union[list,tuple]=None,
|
icons:Union[list,tuple] | None = None,
|
||||||
itemDamage:int=None,
|
itemDamage:int | None = None,
|
||||||
locked:bool=None,
|
locked:bool | None = None,
|
||||||
rows:Union[None, int]=None,
|
rows:Union[None, int] | None = None,
|
||||||
scale:int=None,
|
scale:int | None = None,
|
||||||
trackingPosition:bool=None,
|
trackingPosition:bool | None = None,
|
||||||
x:Union[None, int]=None,
|
x:Union[None, int] | None = None,
|
||||||
y:Union[None, int]=None,
|
y:Union[None, int] | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
columns=columns,
|
columns=columns,
|
||||||
data=data,
|
data=data,
|
||||||
icons=icons,
|
icons=icons,
|
||||||
|
@ -84,7 +84,11 @@ class PacketMap(Packet):
|
||||||
751 : 37,
|
751 : 37,
|
||||||
755 : 39,
|
755 : 39,
|
||||||
756 : 39,
|
756 : 39,
|
||||||
757 : 39
|
757 : 39,
|
||||||
|
758 : 39,
|
||||||
|
759 : 36,
|
||||||
|
760 : 38,
|
||||||
|
761 : 37
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'icons', ArrayType(StructType(( 'directionAndType', Byte ), ( 'x', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
47 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'icons', ArrayType(StructType(( 'directionAndType', Byte ), ( 'x', Byte ), ( 'z', Byte ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'trackingPosition', Boolean ), ( 'locked', Boolean ), ( 'icons', ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
755 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
755 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
756 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
756 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
757 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ]
|
757 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
|
758 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
|
759 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
|
760 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ],
|
||||||
|
761 : [ ( 'itemDamage', VarInt ), ( 'scale', Byte ), ( 'locked', Boolean ), ( 'icons', OptionalType(ArrayType(StructType(( 'type', VarInt ), ( 'x', Byte ), ( 'z', Byte ), ( 'direction', Byte ), ( 'displayName', OptionalType(String, ) ), ), VarInt, ), ) ), ( 'columns', Byte ), ( 'rows', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'x', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'y', SwitchType('columns', { 0 : Void }, Byte, ) ), ( 'data', SwitchType('columns', { 0 : Void }, ByteArray, ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketMapChunk(Packet):
|
class PacketMapChunk(Packet):
|
||||||
__slots__ = ( 'id', 'biomes', 'bitMap', 'blockEntities', 'blockLight', 'blockLightMask', 'chunkData', 'emptyBlockLightMask', 'emptySkyLightMask', 'groundUp', 'heightmaps', 'ignoreOldData', 'skyLight', 'skyLightMask', 'trustEdges', 'x', 'z' )
|
__slots__ = ( 'id', 'biomes', 'bitMap', 'blockEntities', 'blockLight', 'blockLightMask', 'chunkData', 'emptyBlockLightMask', 'emptySkyLightMask', 'groundUp', 'heightmaps', 'ignoreOldData', 'skyLight', 'skyLightMask', 'trustEdges', 'x', 'z' )
|
||||||
|
@ -25,26 +25,26 @@ class PacketMapChunk(Packet):
|
||||||
x : int
|
x : int
|
||||||
z : int
|
z : int
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
biomes:Union[Union[None, list],list]=None,
|
biomes:Union[Union[None, list],list] | None = None,
|
||||||
bitMap:Union[int,list]=None,
|
bitMap:Union[int,list] | None = None,
|
||||||
blockEntities:list=None,
|
blockEntities:list | None = None,
|
||||||
blockLight:list=None,
|
blockLight:list | None = None,
|
||||||
blockLightMask:list=None,
|
blockLightMask:list | None = None,
|
||||||
chunkData:bytes=None,
|
chunkData:bytes | None = None,
|
||||||
emptyBlockLightMask:list=None,
|
emptyBlockLightMask:list | None = None,
|
||||||
emptySkyLightMask:list=None,
|
emptySkyLightMask:list | None = None,
|
||||||
groundUp:bool=None,
|
groundUp:bool | None = None,
|
||||||
heightmaps:dict=None,
|
heightmaps:dict | None = None,
|
||||||
ignoreOldData:bool=None,
|
ignoreOldData:bool | None = None,
|
||||||
skyLight:list=None,
|
skyLight:list | None = None,
|
||||||
skyLightMask:list=None,
|
skyLightMask:list | None = None,
|
||||||
trustEdges:bool=None,
|
trustEdges:bool | None = None,
|
||||||
x:int=None,
|
x:int | None = None,
|
||||||
z:int=None,
|
z:int | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
biomes=biomes,
|
biomes=biomes,
|
||||||
bitMap=bitMap,
|
bitMap=bitMap,
|
||||||
blockEntities=blockEntities,
|
blockEntities=blockEntities,
|
||||||
|
@ -102,7 +102,11 @@ class PacketMapChunk(Packet):
|
||||||
751 : 32,
|
751 : 32,
|
||||||
755 : 34,
|
755 : 34,
|
||||||
756 : 34,
|
756 : 34,
|
||||||
757 : 34
|
757 : 34,
|
||||||
|
758 : 34,
|
||||||
|
759 : 31,
|
||||||
|
760 : 33,
|
||||||
|
761 : 32
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', UnsignedShort ), ( 'chunkData', ByteArray ) ],
|
47 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', UnsignedShort ), ( 'chunkData', ByteArray ) ],
|
||||||
|
@ -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, ) ) ],
|
751 : [ ( 'x', Int ), ( 'z', Int ), ( 'groundUp', Boolean ), ( 'bitMap', VarInt ), ( 'heightmaps', NBTTag ), ( 'biomes', SwitchType('groundUp', { 'false' : Void, 'true' : ArrayType(VarInt, VarInt, ) }, None, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
|
||||||
755 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
|
755 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
|
||||||
756 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
|
756 : [ ( 'x', Int ), ( 'z', Int ), ( 'bitMap', ArrayType(Long, VarInt, ) ), ( 'heightmaps', NBTTag ), ( 'biomes', ArrayType(VarInt, VarInt, ) ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(NBTTag, VarInt, ) ) ],
|
||||||
757 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ]
|
757 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
|
||||||
|
758 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
|
||||||
|
759 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
|
||||||
|
760 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ],
|
||||||
|
761 : [ ( 'x', Int ), ( 'z', Int ), ( 'heightmaps', NBTTag ), ( 'chunkData', ByteArray ), ( 'blockEntities', ArrayType(TrailingData, VarInt, ) ), ( 'trustEdges', Boolean ), ( 'skyLightMask', ArrayType(Long, VarInt, ) ), ( 'blockLightMask', ArrayType(Long, VarInt, ) ), ( 'emptySkyLightMask', ArrayType(Long, VarInt, ) ), ( 'emptyBlockLightMask', ArrayType(Long, VarInt, ) ), ( 'skyLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ), ( 'blockLight', ArrayType(ArrayType(Byte, VarInt, ), VarInt, ) ) ]
|
||||||
}
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketMapChunkBulk(Packet):
|
class PacketMapChunkBulk(Packet):
|
||||||
__slots__ = ( 'id', 'data', 'meta', 'skyLightSent' )
|
__slots__ = ( 'id', 'data', 'meta', 'skyLightSent' )
|
||||||
|
@ -12,13 +12,13 @@ class PacketMapChunkBulk(Packet):
|
||||||
meta : list
|
meta : list
|
||||||
skyLightSent : bool
|
skyLightSent : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
data:bytes=None,
|
data:bytes | None = None,
|
||||||
meta:list=None,
|
meta:list | None = None,
|
||||||
skyLightSent:bool=None,
|
skyLightSent:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
data=data,
|
data=data,
|
||||||
meta=meta,
|
meta=meta,
|
||||||
skyLightSent=skyLightSent
|
skyLightSent=skyLightSent
|
37
src/aiocraft/proto/play/clientbound/packet_message_header.py
Normal file
37
src/aiocraft/proto/play/clientbound/packet_message_header.py
Normal 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 ) ]
|
||||||
|
}
|
|
@ -2,32 +2,35 @@
|
||||||
|
|
||||||
from typing import Tuple, List, Dict, Union, Optional
|
from typing import Tuple, List, Dict, Union, Optional
|
||||||
from ....packet import Packet
|
from ....packet import Packet
|
||||||
from ....definitions import *
|
|
||||||
from ....types import *
|
from ....types import *
|
||||||
|
from ....primitives import *
|
||||||
|
|
||||||
class PacketMultiBlockChange(Packet):
|
class PacketMultiBlockChange(Packet):
|
||||||
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records' )
|
__slots__ = ( 'id', 'chunkCoordinates', 'chunkX', 'chunkZ', 'notTrustEdges', 'records', 'suppressLightUpdates' )
|
||||||
|
|
||||||
chunkCoordinates : bytes
|
chunkCoordinates : int
|
||||||
chunkX : int
|
chunkX : int
|
||||||
chunkZ : int
|
chunkZ : int
|
||||||
notTrustEdges : bool
|
notTrustEdges : bool
|
||||||
records : list
|
records : list
|
||||||
|
suppressLightUpdates : bool
|
||||||
|
|
||||||
def __init__(self, proto:int,
|
def __init__(self,
|
||||||
chunkCoordinates:bytes=None,
|
chunkCoordinates:int | None = None,
|
||||||
chunkX:int=None,
|
chunkX:int | None = None,
|
||||||
chunkZ:int=None,
|
chunkZ:int | None = None,
|
||||||
notTrustEdges:bool=None,
|
notTrustEdges:bool | None = None,
|
||||||
records:list=None,
|
records:list | None = None,
|
||||||
|
suppressLightUpdates:bool | None = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
super().__init__(proto,
|
super().__init__(
|
||||||
chunkCoordinates=chunkCoordinates,
|
chunkCoordinates=chunkCoordinates,
|
||||||
chunkX=chunkX,
|
chunkX=chunkX,
|
||||||
chunkZ=chunkZ,
|
chunkZ=chunkZ,
|
||||||
notTrustEdges=notTrustEdges,
|
notTrustEdges=notTrustEdges,
|
||||||
records=records
|
records=records,
|
||||||
|
suppressLightUpdates=suppressLightUpdates
|
||||||
)
|
)
|
||||||
|
|
||||||
_state : int = 3
|
_state : int = 3
|
||||||
|
@ -69,7 +72,11 @@ class PacketMultiBlockChange(Packet):
|
||||||
751 : 59,
|
751 : 59,
|
||||||
755 : 63,
|
755 : 63,
|
||||||
756 : 63,
|
756 : 63,
|
||||||
757 : 63
|
757 : 63,
|
||||||
|
758 : 63,
|
||||||
|
759 : 61,
|
||||||
|
760 : 64,
|
||||||
|
761 : 63
|
||||||
}
|
}
|
||||||
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
_definitions : Dict[int, List[Tuple[str, Type]]] = {
|
||||||
47 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
47 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
||||||
|
@ -105,8 +112,12 @@ class PacketMultiBlockChange(Packet):
|
||||||
734 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
734 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
||||||
735 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
735 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
||||||
736 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
736 : [ ( 'chunkX', Int ), ( 'chunkZ', Int ), ( 'records', ArrayType(StructType(( 'horizontalPos', Byte ), ( 'y', Byte ), ( 'blockId', VarInt ), ), VarInt, ) ) ],
|
||||||
751 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
|
751 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ],
|
||||||
755 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
|
755 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ],
|
||||||
756 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, VarInt, ) ) ],
|
756 : [ ( 'chunkCoordinates', Long ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarLong, VarInt, ) ) ],
|
||||||
757 : [ ( 'chunkCoordinates', Int ), ( 'notTrustEdges', Boolean ), ( 'records', ArrayType(VarInt, 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
Loading…
Reference in a new issue