Commit Graph
10 Commits
Author SHA1 Message Date
joodicator 997f813a6c Add tests for string representation of PlayerListItemPacket (issue #133) 2019-07-03 19:54:15 +02:00
joodicator e3d2b1a368 Improve metadata and auxiliary methods of existing packets.
* Add multi-attribute aliases to some packets, for user convenience.
* Add support for writing PlayerListItemPacket.
* Add 'fields' attributes to manually-read/written packet classes,
  implementing 'field_string' where appropriate to allow enable the
  default __repr__ implementation.
* Modify data constructors where appropriate so that __repr__
  implementations match their constructor protocols.
* Improve comments on type aliases within packet classes.
* Add/modify tests to cover the new functionality.
2019-06-08 15:39:24 +02:00
joodicator 612fa8e324 Add support for Minecraft 18w43a to 1.14 (protocols 441 to 477)
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.
2019-05-11 08:43:51 +02:00
joo db714f9490 Fix: MapPacket.write_fields() is incorrect. 2018-05-27 17:12:50 +01:00
joo 46e058dd08 Update all tests, docs and code to use new packet names. 2017-08-09 20:53:54 +01:00
Ammar Askar f450ef5ff4 Add test for reactors 2017-07-16 20:02:50 -07:00
Ammar Askar d686b6487f Add testing for MapPacket 2017-07-16 15:18:09 -07:00
Ammar Askar 5b261b840e Refactor out the action of writing out the packet header.
This allows subclasses of Packet to just call the new
method instead of having to duplicate the header writing
and compression code.
2017-07-16 13:40:00 -07:00
Ammar Askar 4ce8c7f6ca Fix flake errors in test file 2017-07-16 02:53:52 -07:00
Ammar Askar 8859e0f7bf Add test coverage for PlayerList packet 2017-07-16 02:42:16 -07:00