Add pre-release versions between 1.14.4 and 1.15.1; update test config

This commit is contained in:
joo 2020-01-08 15:54:45 +01:00
parent 51c618aeb5
commit b38adc1aa1
13 changed files with 67 additions and 39 deletions

View File

@ -1,25 +1,27 @@
language: python
python: 3.5
python: 3.8
matrix:
include:
- python: 2.7
env: TOX_ENV=py27
- python: 3.4
env: TOX_ENV=py34
- python: pypy
env: TOX_ENV=pypy
- python: 3.5
env: TOX_ENV=py35
- python: 3.6
env: TOX_ENV=py36
- python: 3.6
- python: 3.7
env: TOX_ENV=py37
- python: 3.8
env: TOX_ENV=py38
- python: 3.8
env: TOX_ENV=flake8
- python: 3.6
- python: 3.8
env: TOX_ENV=pylint-errors
- python: 3.6
- python: 3.8
env: TOX_ENV=pylint-full
- python: 3.6
- python: 3.8
env: TOX_ENV=verify-manifest
install:
@ -28,6 +30,6 @@ install:
script:
- tox -e $TOX_ENV
after_script:
- if [ "$TOX_ENV" = "py36" ]; then tox -e coveralls; fi
- if [ "$TOX_ENV" = "py38" ]; then tox -e coveralls; fi
notifications:
email: false

View File

@ -30,6 +30,7 @@ pyCraft is compatible with the following Minecraft releases:
* 1.12, 1.12.1, 1.12.2
* 1.13, 1.13.1, 1.13.2
* 1.14, 1.14.1, 1.14.2, 1.14.3, 1.14.4
* 1.15, 1.15.1
In addition, some development snapshots and pre-release versions are supported:
`<minecraft/__init__.py>`_ contains a full list of supported Minecraft versions
@ -50,9 +51,10 @@ Supported Python versions
pyCraft is compatible with (at least) the following Python implementations:
* Python 2.7
* Python 3.4
* Python 3.5
* Python 3.6
* Python 3.7
* Python 3.8
* PyPy
Requirements

View File

@ -197,7 +197,30 @@ SUPPORTED_MINECRAFT_VERSIONS = {
'1.14.4-pre6': 496,
'1.14.4-pre7': 497,
'1.14.4': 498,
'19w34a': 550,
'19w35a': 551,
'19w36a': 552,
'19w37a': 553,
'19w38a': 554,
'19w38b': 555,
'19w39a': 556,
'19w40a': 557,
'19w41a': 558,
'19w42a': 559,
'19w44a': 560,
'19w45a': 561,
'19w45b': 562,
'19w46a': 563,
'19w46b': 564,
'1.15-pre1': 565,
'1.15-pre2': 566,
'1.15-pre3': 567,
'1.15-pre4': 569,
'1.15-pre5': 570,
'1.15-pre6': 571,
'1.15-pre7': 572,
'1.15': 573,
'1.15.1-pre1': 574,
'1.15.1': 575,
}

View File

@ -62,7 +62,7 @@ def get_packets(context):
class KeepAlivePacket(AbstractKeepAlivePacket):
@staticmethod
def get_id(context):
return 0x21 if context.protocol_version >= 573 else \
return 0x21 if context.protocol_version >= 550 else \
0x20 if context.protocol_version >= 471 else \
0x21 if context.protocol_version >= 389 else \
0x20 if context.protocol_version >= 345 else \
@ -75,7 +75,7 @@ class KeepAlivePacket(AbstractKeepAlivePacket):
class JoinGamePacket(Packet):
@staticmethod
def get_id(context):
return 0x26 if context.protocol_version >= 573 else \
return 0x26 if context.protocol_version >= 550 else \
0x25 if context.protocol_version >= 389 else \
0x24 if context.protocol_version >= 345 else \
0x23 if context.protocol_version >= 332 else \
@ -88,13 +88,13 @@ class JoinGamePacket(Packet):
{'entity_id': Integer},
{'game_mode': UnsignedByte},
{'dimension': Integer if context.protocol_version >= 108 else Byte},
{'hashed_seed': Long} if context.protocol_version >= 573 else {},
{'hashed_seed': Long} if context.protocol_version >= 552 else {},
{'difficulty': UnsignedByte} if context.protocol_version < 464 else {},
{'max_players': UnsignedByte},
{'level_type': String},
{'render_distance': VarInt} if context.protocol_version >= 468 else {},
{'reduced_debug_info': Boolean},
{'respawn_screen': Boolean} if context.protocol_version >= 573 else {},
{'respawn_screen': Boolean} if context.protocol_version >= 571 else {},
])
# These aliases declare the Enum type corresponding to each field:
@ -106,7 +106,7 @@ class JoinGamePacket(Packet):
class ServerDifficultyPacket(Packet):
@staticmethod
def get_id(context):
return 0x0E if context.protocol_version >= 573 else \
return 0x0E if context.protocol_version >= 550 else \
0x0D if context.protocol_version >= 332 else \
0x0E if context.protocol_version >= 318 else \
0x0D if context.protocol_version >= 70 else \
@ -125,7 +125,7 @@ class ServerDifficultyPacket(Packet):
class ChatMessagePacket(Packet):
@staticmethod
def get_id(context):
return 0x0F if context.protocol_version >= 573 else \
return 0x0F if context.protocol_version >= 550 else \
0x0E if context.protocol_version >= 343 else \
0x0F if context.protocol_version >= 332 else \
0x10 if context.protocol_version >= 317 else \
@ -146,7 +146,7 @@ class ChatMessagePacket(Packet):
class DisconnectPacket(Packet):
@staticmethod
def get_id(context):
return 0x1B if context.protocol_version >= 573 else \
return 0x1B if context.protocol_version >= 550 else \
0x1A if context.protocol_version >= 471 else \
0x1B if context.protocol_version >= 345 else \
0x1A if context.protocol_version >= 332 else \
@ -187,7 +187,7 @@ class SpawnPlayerPacket(Packet):
{'yaw': Angle},
{'pitch': Angle},
{'current_item': Short} if context.protocol_version <= 49 else {},
# TODO: read entity metadata
# TODO: read entity metadata (protocol < 550)
])
# Access the 'x', 'y', 'z' fields as a Vector tuple.
@ -206,7 +206,7 @@ class SpawnPlayerPacket(Packet):
class EntityVelocityPacket(Packet):
@staticmethod
def get_id(context):
return 0x46 if context.protocol_version >= 573 else \
return 0x46 if context.protocol_version >= 550 else \
0x45 if context.protocol_version >= 471 else \
0x41 if context.protocol_version >= 461 else \
0x42 if context.protocol_version >= 451 else \
@ -232,7 +232,7 @@ class EntityVelocityPacket(Packet):
class UpdateHealthPacket(Packet):
@staticmethod
def get_id(context):
return 0x49 if context.protocol_version >= 573 else \
return 0x49 if context.protocol_version >= 550 else \
0x48 if context.protocol_version >= 471 else \
0x44 if context.protocol_version >= 461 else \
0x45 if context.protocol_version >= 451 else \
@ -257,7 +257,7 @@ class UpdateHealthPacket(Packet):
class RespawnPacket(Packet):
@staticmethod
def get_id(context):
return 0x3B if context.protocol_version >= 573 else \
return 0x3B if context.protocol_version >= 550 else \
0x3A if context.protocol_version >= 471 else \
0x38 if context.protocol_version >= 461 else \
0x39 if context.protocol_version >= 451 else \
@ -274,6 +274,7 @@ class RespawnPacket(Packet):
get_definition = staticmethod(lambda context: [
{'dimension': Integer},
{'difficulty': UnsignedByte} if context.protocol_version < 464 else {},
{'hashed_seed': Long} if context.protocol_version >= 552 else {},
{'game_mode': UnsignedByte},
{'level_type': String},
])
@ -287,7 +288,7 @@ class RespawnPacket(Packet):
class PluginMessagePacket(AbstractPluginMessagePacket):
@staticmethod
def get_id(context):
return 0x19 if context.protocol_version >= 573 else \
return 0x19 if context.protocol_version >= 550 else \
0x18 if context.protocol_version >= 471 else \
0x19 if context.protocol_version >= 345 else \
0x18 if context.protocol_version >= 332 else \
@ -299,7 +300,7 @@ class PluginMessagePacket(AbstractPluginMessagePacket):
class PlayerListHeaderAndFooterPacket(Packet):
@staticmethod
def get_id(context):
return 0x54 if context.protocol_version >= 573 else \
return 0x54 if context.protocol_version >= 550 else \
0x53 if context.protocol_version >= 471 else \
0x5F if context.protocol_version >= 461 else \
0x50 if context.protocol_version >= 451 else \
@ -320,7 +321,7 @@ class PlayerListHeaderAndFooterPacket(Packet):
class EntityLookPacket(Packet):
@staticmethod
def get_id(context):
return 0x2B if context.protocol_version >= 573 else \
return 0x2B if context.protocol_version >= 550 else \
0x2A if context.protocol_version >= 389 else \
0x29 if context.protocol_version >= 345 else \
0x28 if context.protocol_version >= 318 else \

View File

@ -8,7 +8,7 @@ from minecraft.networking.types import (
class BlockChangePacket(Packet):
@staticmethod
def get_id(context):
return 0x0C if context.protocol_version >= 573 else \
return 0x0C if context.protocol_version >= 550 else \
0x0B if context.protocol_version >= 332 else \
0x0C if context.protocol_version >= 318 else \
0x0B if context.protocol_version >= 67 else \
@ -46,7 +46,7 @@ class BlockChangePacket(Packet):
class MultiBlockChangePacket(Packet):
@staticmethod
def get_id(context):
return 0x10 if context.protocol_version >= 573 else \
return 0x10 if context.protocol_version >= 550 else \
0x0F if context.protocol_version >= 343 else \
0x10 if context.protocol_version >= 332 else \
0x11 if context.protocol_version >= 318 else \

View File

@ -8,7 +8,7 @@ from minecraft.networking.types import (
class CombatEventPacket(Packet):
@staticmethod
def get_id(context):
return 0x33 if context.protocol_version >= 573 else \
return 0x33 if context.protocol_version >= 550 else \
0x32 if context.protocol_version >= 471 else \
0x30 if context.protocol_version >= 451 else \
0x2F if context.protocol_version >= 389 else \

View File

@ -7,7 +7,7 @@ from minecraft.networking.packets import Packet
class ExplosionPacket(Packet):
@staticmethod
def get_id(context):
return 0x1D if context.protocol_version >= 573 else \
return 0x1D if context.protocol_version >= 550 else \
0x1C if context.protocol_version >= 471 else \
0x1E if context.protocol_version >= 389 else \
0x1D if context.protocol_version >= 345 else \

View File

@ -8,7 +8,7 @@ from minecraft.networking.packets import Packet
class FacePlayerPacket(Packet):
@staticmethod
def get_id(context):
return 0x35 if context.protocol_version >= 573 else \
return 0x35 if context.protocol_version >= 550 else \
0x34 if context.protocol_version >= 471 else \
0x32 if context.protocol_version >= 451 else \
0x31 if context.protocol_version >= 389 else \

View File

@ -8,7 +8,7 @@ from minecraft.networking.types import (
class MapPacket(Packet):
@staticmethod
def get_id(context):
return 0x27 if context.protocol_version >= 573 else \
return 0x27 if context.protocol_version >= 550 else \
0x26 if context.protocol_version >= 389 else \
0x25 if context.protocol_version >= 345 else \
0x24 if context.protocol_version >= 334 else \

View File

@ -9,7 +9,7 @@ from minecraft.networking.types import (
class PlayerListItemPacket(Packet):
@staticmethod
def get_id(context):
return 0x34 if context.protocol_version >= 573 else \
return 0x34 if context.protocol_version >= 550 else \
0x33 if context.protocol_version >= 471 else \
0x31 if context.protocol_version >= 451 else \
0x30 if context.protocol_version >= 389 else \

View File

@ -9,7 +9,7 @@ from minecraft.networking.types import (
class PlayerPositionAndLookPacket(Packet, BitFieldEnum):
@staticmethod
def get_id(context):
return 0x36 if context.protocol_version >= 573 else \
return 0x36 if context.protocol_version >= 550 else \
0x35 if context.protocol_version >= 471 else \
0x33 if context.protocol_version >= 451 else \
0x32 if context.protocol_version >= 389 else \

View File

@ -9,7 +9,7 @@ __all__ = 'SoundEffectPacket',
class SoundEffectPacket(Packet):
@staticmethod
def get_id(context):
return 0x52 if context.protocol_version >= 573 else \
return 0x52 if context.protocol_version >= 550 else \
0x51 if context.protocol_version >= 471 else \
0x4D if context.protocol_version >= 461 else \
0x4E if context.protocol_version >= 451 else \

14
tox.ini
View File

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py27, py34, py35, py36, pypy, flake8, pylint-errors, pylint-full, verify-manifest
envlist = py27, py35, py36, py37, py38, pypy, flake8, pylint-errors, pylint-full, verify-manifest
[testenv]
commands = nosetests --with-timer
@ -32,7 +32,7 @@ deps =
{[testenv]deps}
mock
[testenv:py36]
[testenv:py38]
setenv =
PYCRAFT_RUN_INTERNET_TESTS=1
commands =
@ -46,7 +46,7 @@ deps =
mock
[testenv:flake8]
basepython = python3.6
basepython = python3.8
commands =
flake8 minecraft tests setup.py start.py bin/generate_travis_yml.py
deps =
@ -58,14 +58,14 @@ per-file-ignores =
*/clientbound/play/spawn_object_packet.py:E221,E222,E271,E272
[testenv:pylint-errors]
basepython = python3.6
basepython = python3.8
deps =
{[testenv]deps}
pylint
commands = pylint minecraft -E
[testenv:pylint-full]
basepython = python3.6
basepython = python3.8
deps =
{[testenv]deps}
pylint
@ -73,7 +73,7 @@ commands =
- pylint minecraft --disable=E
[testenv:docs]
basepython = python3.6
basepython = python3.8
deps =
{[testenv:cover]deps}
sphinx
@ -82,7 +82,7 @@ commands =
{toxinidir}/bin/build_docs
[testenv:verify-manifest]
basepython = python3.6
basepython = python3.8
deps =
check-manifest
commands =