* Add Angle type for byte-encoded rotation angles.
* Fix: SpawnPlayerPacket and SpawnObjectPacket use wrong type for pitch/yaw.
* Add FacePlayerPacket and EntityLookPacket.
Remarks: I chose to implement an angle between 0-360 degrees as opposed to -180 - 180. linear transformation, the maths was far simpler converting an UnsignedByte into positive values instead of a Byte into negative and positive
Improvements to the test suite:
* List release version names and numbers in minecraft/__init__.py.
* Make some tests, which previously ran for *all* protocol versions,
run only for release protocol versions (to improve test performance).
* Make some tests, which previously ran only for the latest protocol
version, run for all release protocol versions (to improve coverage).
* Print each protocol version being tested to the debug log, to help
identify sources of errors.
* Use the `nose-timer' plugin to show the run time of each test.
Fix errors revealed by increased test coverage:
* Fix: SoundEffectPacket.Pitch is not serialised correctly for early
protocol versions.
* Fix: handleExceptionTest finishes later than necessary because
the test overrode an exception handler used internally by
`_FakeServerTest', causing the server thread to time out after 4s.
* Add support for multiple exception handlers in `Connection'
(required for the above).
Improvements to data descriptors:
* Make syntax of property declarations more consistent/Pythonic.
* Factor the definition of several aliasing properties into the
utility methods `attribute_alias' and `multi_attribute_alias',
which construct suitable data descriptors.
* Define and use the named tuple `Direction' for (pitch, yaw) values.
This commit introduces two backward-incompatible changes which may break
existing code:
(1) `networking.packets.clientbound.play.SpawnObjectPacket.EntityType'
is no longer accessible as an attribute of the the `SpawnObjectPacket'
class: the values now depend on a `ConnectionContext`, and must be
accessed through an instance, or using `SpawnObjectPacket.field_enum'.
See the text of the `AttributeError` raised from the descriptor for
`SpawnObjectPacket.EntityType` for the full details.
(2) For some subclasses of `networking.types.Type', it is necessary to
call the methods `read_with_context' and `send_with_context' instead of
`read' and `send', supplying a `ConnectionContext' for those data types
- currently only `Position` - whose layout depends on it.
Information gathered from https://wiki.vg/Protocol_version_numbers.
Due to some difficulties the change from "sound_id" to "sound_name" and
the re-implementation of "sound_category" in the packet may be off by
some protocol versions.
This changes the default behaviour to include `self.client_token`
when using `authenticate`. If `self.client_token` is `None`, a new
token is generated using uuid4 (like the vanilla client does).