mcflayer 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. mcflayer-0.5.0/.gitignore +15 -0
  2. mcflayer-0.5.0/.importlinter +15 -0
  3. mcflayer-0.5.0/PKG-INFO +70 -0
  4. mcflayer-0.5.0/README.md +48 -0
  5. mcflayer-0.5.0/data/LICENSE +13 -0
  6. mcflayer-0.5.0/data/dataPaths.json +26 -0
  7. mcflayer-0.5.0/data/pc/1.8/biomes.json +804 -0
  8. mcflayer-0.5.0/data/pc/1.8/blockCollisionShapes.json +274 -0
  9. mcflayer-0.5.0/data/pc/1.8/blocks.json +5363 -0
  10. mcflayer-0.5.0/data/pc/1.8/effects.json +140 -0
  11. mcflayer-0.5.0/data/pc/1.8/entities.json +580 -0
  12. mcflayer-0.5.0/data/pc/1.8/foods.json +310 -0
  13. mcflayer-0.5.0/data/pc/1.8/items.json +3733 -0
  14. mcflayer-0.5.0/data/pc/1.8/materials.json +61 -0
  15. mcflayer-0.5.0/data/pc/1.8/protocol.json +3438 -0
  16. mcflayer-0.5.0/data/pc/1.8/version.json +5 -0
  17. mcflayer-0.5.0/data/pc/1.8/windows.json +229 -0
  18. mcflayer-0.5.0/docs/ARCHITECTURE.md +659 -0
  19. mcflayer-0.5.0/docs/POST PROMPT.md +88 -0
  20. mcflayer-0.5.0/docs/PROMPTS.md +663 -0
  21. mcflayer-0.5.0/docs/ROADMAP.md +121 -0
  22. mcflayer-0.5.0/docs/handoff/M1.md +41 -0
  23. mcflayer-0.5.0/docs/handoff/M2.md +51 -0
  24. mcflayer-0.5.0/docs/index.md +86 -0
  25. mcflayer-0.5.0/docs/modules/auth.md +48 -0
  26. mcflayer-0.5.0/docs/modules/bot.md +72 -0
  27. mcflayer-0.5.0/docs/modules/client.md +55 -0
  28. mcflayer-0.5.0/docs/modules/data.md +82 -0
  29. mcflayer-0.5.0/docs/modules/errors.md +56 -0
  30. mcflayer-0.5.0/docs/modules/events.md +51 -0
  31. mcflayer-0.5.0/docs/modules/index.md +67 -0
  32. mcflayer-0.5.0/docs/modules/internal.md +41 -0
  33. mcflayer-0.5.0/docs/modules/models.md +34 -0
  34. mcflayer-0.5.0/docs/modules/protocol.md +97 -0
  35. mcflayer-0.5.0/docs/modules/protodef.md +80 -0
  36. mcflayer-0.5.0/docs/modules/transport.md +99 -0
  37. mcflayer-0.5.0/docs/sessions.md +165 -0
  38. mcflayer-0.5.0/docs/tasks.md +154 -0
  39. mcflayer-0.5.0/mkdocs.yml +63 -0
  40. mcflayer-0.5.0/pyproject.toml +86 -0
  41. mcflayer-0.5.0/requirements-docs.txt +2 -0
  42. mcflayer-0.5.0/src/pyflayer/__init__.py +92 -0
  43. mcflayer-0.5.0/src/pyflayer/_internal/__init__.py +8 -0
  44. mcflayer-0.5.0/src/pyflayer/_internal/clock.py +115 -0
  45. mcflayer-0.5.0/src/pyflayer/_internal/cpu.py +53 -0
  46. mcflayer-0.5.0/src/pyflayer/_internal/log.py +22 -0
  47. mcflayer-0.5.0/src/pyflayer/_internal/util.py +56 -0
  48. mcflayer-0.5.0/src/pyflayer/actions/__init__.py +1 -0
  49. mcflayer-0.5.0/src/pyflayer/bot/__init__.py +15 -0
  50. mcflayer-0.5.0/src/pyflayer/bot/bot.py +536 -0
  51. mcflayer-0.5.0/src/pyflayer/bot/chat.py +146 -0
  52. mcflayer-0.5.0/src/pyflayer/cli.py +98 -0
  53. mcflayer-0.5.0/src/pyflayer/data/__init__.py +53 -0
  54. mcflayer-0.5.0/src/pyflayer/data/features.py +123 -0
  55. mcflayer-0.5.0/src/pyflayer/data/loader.py +250 -0
  56. mcflayer-0.5.0/src/pyflayer/data/registries.py +330 -0
  57. mcflayer-0.5.0/src/pyflayer/data/schema.py +133 -0
  58. mcflayer-0.5.0/src/pyflayer/data/shapes.py +68 -0
  59. mcflayer-0.5.0/src/pyflayer/data/versions.py +122 -0
  60. mcflayer-0.5.0/src/pyflayer/errors.py +249 -0
  61. mcflayer-0.5.0/src/pyflayer/events/__init__.py +52 -0
  62. mcflayer-0.5.0/src/pyflayer/events/base.py +48 -0
  63. mcflayer-0.5.0/src/pyflayer/events/bus.py +415 -0
  64. mcflayer-0.5.0/src/pyflayer/events/catalog.py +168 -0
  65. mcflayer-0.5.0/src/pyflayer/ext/__init__.py +1 -0
  66. mcflayer-0.5.0/src/pyflayer/ext/commands/__init__.py +1 -0
  67. mcflayer-0.5.0/src/pyflayer/ext/tasks/__init__.py +1 -0
  68. mcflayer-0.5.0/src/pyflayer/models/__init__.py +39 -0
  69. mcflayer-0.5.0/src/pyflayer/models/aabb.py +93 -0
  70. mcflayer-0.5.0/src/pyflayer/models/chat.py +46 -0
  71. mcflayer-0.5.0/src/pyflayer/models/enums.py +98 -0
  72. mcflayer-0.5.0/src/pyflayer/models/items.py +44 -0
  73. mcflayer-0.5.0/src/pyflayer/models/protocols.py +61 -0
  74. mcflayer-0.5.0/src/pyflayer/models/text.py +153 -0
  75. mcflayer-0.5.0/src/pyflayer/models/vec3.py +163 -0
  76. mcflayer-0.5.0/src/pyflayer/pathfinder/__init__.py +1 -0
  77. mcflayer-0.5.0/src/pyflayer/physics/__init__.py +1 -0
  78. mcflayer-0.5.0/src/pyflayer/protocol/__init__.py +44 -0
  79. mcflayer-0.5.0/src/pyflayer/protocol/auth/__init__.py +20 -0
  80. mcflayer-0.5.0/src/pyflayer/protocol/auth/base.py +86 -0
  81. mcflayer-0.5.0/src/pyflayer/protocol/auth/microsoft.py +275 -0
  82. mcflayer-0.5.0/src/pyflayer/protocol/auth/offline.py +81 -0
  83. mcflayer-0.5.0/src/pyflayer/protocol/auth/session_join.py +82 -0
  84. mcflayer-0.5.0/src/pyflayer/protocol/buffer.py +336 -0
  85. mcflayer-0.5.0/src/pyflayer/protocol/client.py +365 -0
  86. mcflayer-0.5.0/src/pyflayer/protocol/connection.py +226 -0
  87. mcflayer-0.5.0/src/pyflayer/protocol/crypto.py +66 -0
  88. mcflayer-0.5.0/src/pyflayer/protocol/framing.py +171 -0
  89. mcflayer-0.5.0/src/pyflayer/protocol/protodef.py +713 -0
  90. mcflayer-0.5.0/src/pyflayer/protocol/registry.py +84 -0
  91. mcflayer-0.5.0/src/pyflayer/protocol/state.py +109 -0
  92. mcflayer-0.5.0/src/pyflayer/protocol/status.py +223 -0
  93. mcflayer-0.5.0/src/pyflayer/protocol/types/__init__.py +39 -0
  94. mcflayer-0.5.0/src/pyflayer/protocol/types/bitset.py +22 -0
  95. mcflayer-0.5.0/src/pyflayer/protocol/types/nbt.py +384 -0
  96. mcflayer-0.5.0/src/pyflayer/protocol/types/position.py +57 -0
  97. mcflayer-0.5.0/src/pyflayer/protocol/types/slot.py +73 -0
  98. mcflayer-0.5.0/src/pyflayer/protocol/types/uuid.py +45 -0
  99. mcflayer-0.5.0/src/pyflayer/protocol/varint.py +161 -0
  100. mcflayer-0.5.0/src/pyflayer/py.typed +0 -0
  101. mcflayer-0.5.0/src/pyflayer/swarm/__init__.py +1 -0
  102. mcflayer-0.5.0/src/pyflayer/testing/__init__.py +7 -0
  103. mcflayer-0.5.0/src/pyflayer/testing/fake_server.py +276 -0
  104. mcflayer-0.5.0/src/pyflayer/world/__init__.py +1 -0
  105. mcflayer-0.5.0/tests/test_auth.py +59 -0
  106. mcflayer-0.5.0/tests/test_bot.py +155 -0
  107. mcflayer-0.5.0/tests/test_buffer.py +172 -0
  108. mcflayer-0.5.0/tests/test_client.py +104 -0
  109. mcflayer-0.5.0/tests/test_clock.py +66 -0
  110. mcflayer-0.5.0/tests/test_crypto.py +25 -0
  111. mcflayer-0.5.0/tests/test_data.py +86 -0
  112. mcflayer-0.5.0/tests/test_events.py +176 -0
  113. mcflayer-0.5.0/tests/test_framing.py +143 -0
  114. mcflayer-0.5.0/tests/test_models.py +67 -0
  115. mcflayer-0.5.0/tests/test_nbt.py +106 -0
  116. mcflayer-0.5.0/tests/test_protodef.py +131 -0
  117. mcflayer-0.5.0/tests/test_state.py +47 -0
  118. mcflayer-0.5.0/tests/test_status.py +103 -0
  119. mcflayer-0.5.0/tests/test_util.py +37 -0
  120. mcflayer-0.5.0/tests/test_varint.py +86 -0
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .venv-docs/
5
+ site/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ .hypothesis/
10
+ dist/
11
+ build/
12
+ *.egg-info/
13
+ .coverage
14
+ htmlcov/
15
+ data/.git
@@ -0,0 +1,15 @@
1
+ [importlinter]
2
+ root_package = pyflayer
3
+
4
+ [importlinter:contract:layers]
5
+ name = PyFlayer layer map (ADR-2)
6
+ type = layers
7
+ layers =
8
+ pyflayer.ext | pyflayer.swarm
9
+ pyflayer.actions | pyflayer.pathfinder
10
+ pyflayer.physics
11
+ pyflayer.world
12
+ pyflayer.bot
13
+ pyflayer.protocol
14
+ pyflayer.data | pyflayer.events
15
+ pyflayer.models | pyflayer._internal | pyflayer.errors
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.5
2
+ Name: mcflayer
3
+ Version: 0.5.0
4
+ Summary: asyncio Minecraft Java Edition bot library - transport, data, codecs, login and events
5
+ Author: PyFlayer contributors
6
+ License: MIT
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: cryptography>=42
9
+ Requires-Dist: dnspython>=2.6
10
+ Requires-Dist: httpx>=0.27
11
+ Requires-Dist: msgspec>=0.18
12
+ Requires-Dist: numpy>=1.26
13
+ Provides-Extra: dev
14
+ Requires-Dist: hypothesis>=6.100; extra == 'dev'
15
+ Requires-Dist: import-linter>=2.0; extra == 'dev'
16
+ Requires-Dist: mypy>=1.10; extra == 'dev'
17
+ Requires-Dist: pyright>=1.1.360; extra == 'dev'
18
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
19
+ Requires-Dist: pytest>=8; extra == 'dev'
20
+ Requires-Dist: ruff>=0.5; extra == 'dev'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # PyFlayer
24
+
25
+ An asyncio Minecraft Java Edition bot library: Mineflayer's protocol, world and physics, with a
26
+ command layer shaped like discord.py.
27
+
28
+ **Status:** Milestone 2 (transport, codecs, login/auth, encryption, event bus, minimal bot) is
29
+ implemented against **Minecraft 1.8.9 / protocol 47** and verified live on PikaNetwork. World,
30
+ physics, commands and pathfinding are M3–M7. See [docs/sessions.md](docs/sessions.md) for the
31
+ session log and [docs/tasks.md](docs/tasks.md) for the task board.
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pip install mcflayer # distribution name; the import package is `pyflayer`
37
+ ```
38
+
39
+ The PyPI distribution is `mcflayer` (the `pyflayer` name is taken); the import name is unchanged:
40
+ `import pyflayer`.
41
+
42
+ ## Quick start
43
+
44
+ ```bash
45
+ python3 -m venv .venv
46
+ source .venv/bin/activate
47
+ pip install -e .[dev]
48
+
49
+ # Ping a server (server list ping)
50
+ python -m pyflayer.protocol.status play.example.org
51
+
52
+ # Join a server, print chat and send one message
53
+ python -m pyflayer.cli play.pika-network.net --username Steve --timeout 15 --chat hello
54
+
55
+ # Run the tests
56
+ pytest
57
+ ```
58
+
59
+ ## Layout
60
+
61
+ ```
62
+ src/pyflayer/ library code (src layout, typed)
63
+ data/pc/1.8/ vendored subset of PrismarineJS/minecraft-data (MIT)
64
+ tests/ unit, golden and loopback tests
65
+ docs/ MkDocs site: architecture, roadmap, prompts, module docs, sessions, tasks
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ The docs are MkDocs (Material theme). Install `requirements-docs.txt` and run `mkdocs serve`.
@@ -0,0 +1,48 @@
1
+ # PyFlayer
2
+
3
+ An asyncio Minecraft Java Edition bot library: Mineflayer's protocol, world and physics, with a
4
+ command layer shaped like discord.py.
5
+
6
+ **Status:** Milestone 2 (transport, codecs, login/auth, encryption, event bus, minimal bot) is
7
+ implemented against **Minecraft 1.8.9 / protocol 47** and verified live on PikaNetwork. World,
8
+ physics, commands and pathfinding are M3–M7. See [docs/sessions.md](docs/sessions.md) for the
9
+ session log and [docs/tasks.md](docs/tasks.md) for the task board.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install mcflayer # distribution name; the import package is `pyflayer`
15
+ ```
16
+
17
+ The PyPI distribution is `mcflayer` (the `pyflayer` name is taken); the import name is unchanged:
18
+ `import pyflayer`.
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ python3 -m venv .venv
24
+ source .venv/bin/activate
25
+ pip install -e .[dev]
26
+
27
+ # Ping a server (server list ping)
28
+ python -m pyflayer.protocol.status play.example.org
29
+
30
+ # Join a server, print chat and send one message
31
+ python -m pyflayer.cli play.pika-network.net --username Steve --timeout 15 --chat hello
32
+
33
+ # Run the tests
34
+ pytest
35
+ ```
36
+
37
+ ## Layout
38
+
39
+ ```
40
+ src/pyflayer/ library code (src layout, typed)
41
+ data/pc/1.8/ vendored subset of PrismarineJS/minecraft-data (MIT)
42
+ tests/ unit, golden and loopback tests
43
+ docs/ MkDocs site: architecture, roadmap, prompts, module docs, sessions, tasks
44
+ ```
45
+
46
+ ## Documentation
47
+
48
+ The docs are MkDocs (Material theme). Install `requirements-docs.txt` and run `mkdocs serve`.
@@ -0,0 +1,13 @@
1
+ # Vendored data notice
2
+
3
+ `data/pc/1.8/` contains a small, pinned subset of
4
+ [PrismarineJS/minecraft-data](https://github.com/PrismarineJS/minecraft-data), fetched from `master`
5
+ on 2026-11-20. `minecraft-data` is distributed under the MIT license (see its `package.json` and the
6
+ upstream repository); this notice is kept so the provenance is never lost.
7
+
8
+ Only the files needed for the M1 data loader and codec compiler are included. The upstream
9
+ `version.json` reports `minecraftVersion: 1.8.8` and `version: 47`; Minecraft 1.8.9 uses the same
10
+ protocol and data, so docs refer to the reference target as **1.8.9 / protocol 47**.
11
+
12
+ To support another version, add its `pc/<version>` files and an entry in `data/dataPaths.json`, or
13
+ point `PYFLAYER_DATA_DIR` at a full `minecraft-data/data` checkout.
@@ -0,0 +1,26 @@
1
+ {
2
+ "pc": {
3
+ "1.8": {
4
+ "attributes": "pc/1.8",
5
+ "biomes": "pc/1.8",
6
+ "blockCollisionShapes": "pc/1.8",
7
+ "blocks": "pc/1.8",
8
+ "effects": "pc/1.8",
9
+ "enchantments": "pc/1.8",
10
+ "entities": "pc/1.8",
11
+ "foods": "pc/1.8",
12
+ "instruments": "pc/1.8",
13
+ "items": "pc/1.8",
14
+ "language": "pc/1.8",
15
+ "mapIcons": "pc/1.7",
16
+ "materials": "pc/1.8",
17
+ "particles": "pc/1.8",
18
+ "proto": "pc/1.8",
19
+ "protocol": "pc/1.8",
20
+ "recipes": "pc/1.8",
21
+ "tints": "pc/1.16.2",
22
+ "version": "pc/1.8",
23
+ "windows": "pc/1.8"
24
+ }
25
+ }
26
+ }