support 1.12.2

This commit is contained in:
TheSnoozer 2017-09-19 18:30:51 -04:00
parent 9765e936c9
commit 61d9695226
3 changed files with 9 additions and 4 deletions

View File

@ -27,7 +27,7 @@ pyCraft is compatible with the following Minecraft releases:
* 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
* 1.10, 1.10.1, 1.10.2
* 1.11, 1.11.1, 1.11.2
* 1.12, 1.12.1
* 1.12, 1.12.1, 1.12.2
In addition, some development snapshots and pre-release versions are supported:
`<minecraft/__init__.py>`_ contains a full list of supported Minecraft versions

View File

@ -64,6 +64,9 @@ SUPPORTED_MINECRAFT_VERSIONS = {
'17w31a': 336,
'1.12.1-pre1': 337,
'1.12.1': 338,
'1.12.2-pre1': 339,
'1.12.2-pre2': 339,
'1.12.2': 340,
}
SUPPORTED_PROTOCOL_VERSIONS = sorted(SUPPORTED_MINECRAFT_VERSIONS.values())

View File

@ -1,11 +1,13 @@
from .packet import Packet
from minecraft.networking.types import (
VarInt
VarInt, Long
)
class KeepAlivePacket(Packet):
packet_name = "keep alive"
definition = [
{'keep_alive_id': VarInt}]
get_definition = staticmethod(lambda context: [
{'keep_alive_id': Long} if context.protocol_version >= 339
else {'keep_alive_id': VarInt}
])