Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7d38fb8
fix: improper use of enum
plun1331 Mar 17, 2023
139856c
feat: implement most of the client
plun1331 Mar 21, 2023
4ea5554
feat: change timeout time
plun1331 Mar 21, 2023
7cddde1
docs: add example
plun1331 Mar 21, 2023
40bc6e0
fix: bug fixes
plun1331 Mar 22, 2023
144d174
feat: rework client & connection interface
plun1331 Mar 22, 2023
a1ee9dc
Merge branch 'client' of https://github.com/plun1331/MCPy into client
plun1331 Mar 22, 2023
a7616b7
feat: rewrite some internals for better interface
plun1331 Mar 22, 2023
65849a1
feat: add exceptions for login disconnect
plun1331 Mar 22, 2023
c4df20c
refactor: simplify encryption
plun1331 Mar 22, 2023
37d6363
feat: remove test file
plun1331 Mar 22, 2023
eacde2e
fix: correct incorrect protocol data
plun1331 Mar 22, 2023
f357c93
Merge remote-tracking branch 'origin/client' into client
plun1331 Mar 22, 2023
1eea862
style: reformat
plun1331 Mar 22, 2023
24ec652
feat: implement auth errors
plun1331 Mar 23, 2023
417d788
feat: add methods for listeners & auth
plun1331 Mar 23, 2023
7d176ad
feat: fix pylint errors
plun1331 Mar 23, 2023
aaec84d
Merge branch 'main' into client
plun1331 Mar 23, 2023
75b57ea
docs: add documentation
plun1331 Mar 23, 2023
e87ff7d
docs: begin work on documentation
plun1331 Mar 23, 2023
c60faed
feat: improvements
plun1331 Mar 23, 2023
44afceb
Merge remote-tracking branch 'origin/client' into client
plun1331 Mar 23, 2023
769dd9b
style: format
plun1331 Mar 23, 2023
e13b7e2
feat: upgrade to 1.19.4 and other changes
plun1331 Mar 24, 2023
672130e
Merge branch 'documentation' into client
plun1331 Mar 24, 2023
726ecc1
docs: add documentation (#24)
plun1331 Mar 27, 2023
5bbc7e0
fix: update docs, typehints, syntax error fixes
plun1331 Mar 29, 2023
7d6d823
Merge branch 'main' into client
plun1331 Mar 29, 2023
1cc6b91
Merge branch 'main' into client
plun1331 Mar 29, 2023
d39e441
style: format code with black
github-actions[bot] Mar 29, 2023
911c471
feat: add play reactor
plun1331 Mar 29, 2023
0f274cf
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 Mar 29, 2023
30049a3
Update README.md
plun1331 Mar 29, 2023
c578032
style: format code with black
github-actions[bot] Mar 29, 2023
0747ba0
fix: minor bugs
plun1331 Mar 29, 2023
9de35e3
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 Mar 29, 2023
31572e6
style: format code with black
github-actions[bot] Mar 29, 2023
78eff7d
fix: various packet parsing fixes
plun1331 Mar 29, 2023
17171a1
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 Mar 29, 2023
d8a3aa8
feat: bug fixes
plun1331 Mar 31, 2023
21d01f3
Merge branch 'main' into client
plun1331 Apr 11, 2023
d359ec7
style: format code with black
github-actions[bot] Apr 11, 2023
7610f88
chore: remove build dir
plun1331 Apr 11, 2023
115ea25
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 Apr 11, 2023
cc27ce9
fix: bug fixes
plun1331 Apr 11, 2023
46307ab
style: format code with black
github-actions[bot] Apr 11, 2023
b1df2ec
feat: change log level
plun1331 Apr 11, 2023
1b13b6b
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 Apr 11, 2023
0386fe8
style: format code with black
github-actions[bot] Apr 11, 2023
6b80256
chore: remove accidentally committed files
plun1331 Apr 11, 2023
62afde8
chore: remove accidentally committed files
plun1331 Apr 11, 2023
d49fdb5
Merge branch 'main' into client
plun1331 Apr 11, 2023
9c5944e
Create requirements.txt
plun1331 Apr 11, 2023
252cd32
Create .readthedocs.yaml
plun1331 Apr 11, 2023
3c0ffe4
Update .readthedocs.yaml
plun1331 Apr 13, 2023
cf1034d
Update .readthedocs.yaml
plun1331 Apr 13, 2023
e947f54
Delete requirements.txt
plun1331 Apr 13, 2023
0bdbaf8
Update .readthedocs.yaml
plun1331 Apr 13, 2023
a6348ef
Update .readthedocs.yaml
plun1331 Apr 13, 2023
8af8d37
Merge branch 'main' into client
plun1331 Apr 13, 2023
456637a
Merge branch 'main' into client
plun1331 May 3, 2023
ef25d60
feat: update requirement documentation
plun1331 May 3, 2023
3661b5f
style: format code with black
github-actions[bot] May 3, 2023
db9181b
chore: change LICENCE to markdown
plun1331 May 3, 2023
82be654
chore: fix pylint errors
plun1331 May 3, 2023
66a83d4
style: format code with black
github-actions[bot] May 3, 2023
64e0886
chore: fix pylint errors
plun1331 May 3, 2023
af0377c
Merge branch 'client' of https://github.com/plun1331/minecraft.py int…
plun1331 May 3, 2023
c9c06e1
style: format code with black
github-actions[bot] May 3, 2023
e591fc3
Merge branch 'main' into client
plun1331 May 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
too-few-public-methods,too-many-return-statements,protected-access,too-many-arguments,\
too-many-branches,too-many-lines,duplicate-code,too-many-statements,too-many-nested-blocks,\
invalid-name,unused-wildcard-import,wildcard-import,cyclic-import,redefined-builtin,\
redefined-outer-name,undefined-variable,import-outside-toplevel
redefined-outer-name,undefined-variable,import-outside-toplevel,unused-argument
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.devcontainer
__pycache__
docs/_build/**
**.egg-info/**
dist/**
docs/changelog.md
build/**
**.egg-info/**
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.11"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
- microsoft-auth
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.
All changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [Unreleased](https://github.com/plun1331/minecraft.py/tree/main)

These changes are available on the `main` branch, but have not yet been released.

### Added
- Implement all play packet classes.
([#5](https://github.com/plun1331/minecraft.py/pull/5))
- Add a `pyproject.toml` file.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BSD 3-Clause License
## BSD 3-Clause License

Copyright (c) 2023, plun1331

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ Note that this requires that you have [`git`](https://git-scm.com/) installed.


### Optional Requirements
- `microsoft-auth`
- `microsoft-auth`: Enables the builtin device code authentication flow with `Client.microsoft_auth`.
- [`msal`](https://pypi.org/project/msal/) for Microsoft authentication

- `docs`: For building the docs locally. Typically not needed unless you plan on contributing.
- [`sphinx`](https://pypi.org/project/sphinx/) for documentation generation.
- [`furo`](https://pypi.org/project/furo/) for our documentation styling.
- [`myst-parser`](https://pypi.org/project/myst-parser/) for parsing markdown files.

## Support

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions docs/api/auth.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: minecraft

Authentication
===============

.. automodule:: minecraft.auth
:members:
7 changes: 7 additions & 0 deletions docs/api/client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: minecraft

Client
=======

.. autoclass:: Client
:members:
9 changes: 9 additions & 0 deletions docs/api/datatypes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. currentmodule:: minecraft

Data Types
===========

.. automodule:: minecraft.datatypes
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/api/enums.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. currentmodule:: minecraft

Enums
=======

.. automodule:: minecraft.enums
:members:
:undoc-members:
8 changes: 8 additions & 0 deletions docs/api/exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. currentmodule:: minecraft

Exceptions
===========

.. automodule:: minecraft.exceptions
:members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
API Reference
==============

The following section outlines the API of minecraft.py.

.. note::
The API is still in development and is subject to change.

.. toctree::
:maxdepth: 1

auth
client
datatypes
enums
exceptions
nbt
version
networking/index
packets/index
17 changes: 17 additions & 0 deletions docs/api/nbt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. currentmodule:: nbt.nbt

NBT
====

.. note::
This page contains automatically generated documentation for
the `NBT module <https://github.com/twoolie/NBT>`_, and is not maintained by minecraft.py.

NBT is licensed under the MIT license, you can view a copy of it
`here <https://github.com/twoolie/NBT/blob/master/LICENSE.txt>`_.


.. automodule:: nbt.nbt
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/networking/connection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: minecraft.networking

Connection
==========

.. autoclass:: Connection
:members:
7 changes: 7 additions & 0 deletions docs/api/networking/dispatcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: minecraft.networking

Dispatcher
==========

.. autoclass:: Dispatcher
:members:
7 changes: 7 additions & 0 deletions docs/api/networking/encryption.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: minecraft.networking

Encryption
==========

.. automodule:: minecraft.networking.encryption
:members:
12 changes: 12 additions & 0 deletions docs/api/networking/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Networking
==========

minecraft.py's networking module.

.. toctree::
:maxdepth: 1

connection
dispatcher
encryption
reactors
37 changes: 37 additions & 0 deletions docs/api/networking/reactors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. currentmodule:: minecraft.networking.reactors

Reactors
=========

A reactor is a class used by the :class:`.Connection` to handle incoming packets,
while also forcing the read loop to wait until processing of the packet is complete.

This is useful in cases like :class:`.SetCompression`, in which the next packet will be compressed,
and the :class:`.Connection` needs to know that before recieving it.

These are mostly used by the library and shouldn't need to be overriden by you, the developer,
however, you can still override their default behavior by updating :data:`REACTORS` with your own :class:`Reactor`.

.. data:: REACTORS

A dictionary mapping connection states to reactors. (:class:`dict`\[:class:`.State`, :class:`Reactor`\])

.. autoclass:: Reactor
:members:

.. autofunction:: react_to

Login
---------

.. autoclass:: LoginReactor
:members:
:undoc-members:


Play
---------

.. autoclass:: PlayReactor
:members:
:undoc-members:
17 changes: 17 additions & 0 deletions docs/api/packets/handshake.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Handshake
=========

Clientbound
-----------

There are no client bound packets for the handshake state. After :class:`Handshake` is sent,
the state immediately switches to :attr:`.State.LOGIN`.


Serverbound
-----------

.. automodule:: minecraft.packets.handshake_serverbound
:members:
:member-order: bysource

34 changes: 34 additions & 0 deletions docs/api/packets/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Packets
=======

Every packet in the Minecraft protocol is implemented here.

All packets inherit from one base class, :class:`.Packet`.

.. toctree::
:maxdepth: 1

handshake
login
status
play


Packet
------

.. currentmodule:: minecraft.packets

.. autoclass:: Packet
:members:

.. autoattribute:: packet_id
:annotation: = The packet's ID

.. autoattribute:: state
:annotation: = The state the packet is used in

.. autoattribute:: bound_to
:annotation: = The direction the packet is sent in

.. autofunction:: get_packet
18 changes: 18 additions & 0 deletions docs/api/packets/login.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Login
======

Clientbound
-----------

.. automodule:: minecraft.packets.login_clientbound
:members:
:member-order: bysource


Serverbound
-----------

.. automodule:: minecraft.packets.login_serverbound
:members:
:member-order: bysource

18 changes: 18 additions & 0 deletions docs/api/packets/play.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Play
====

Clientbound
-----------

.. automodule:: minecraft.packets.play_clientbound
:members:
:member-order: bysource


Serverbound
-----------

.. automodule:: minecraft.packets.play_serverbound
:members:
:member-order: bysource

18 changes: 18 additions & 0 deletions docs/api/packets/status.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Status
======

Clientbound
-----------

.. automodule:: minecraft.packets.status_clientbound
:members:
:member-order: bysource


Serverbound
-----------

.. automodule:: minecraft.packets.status_serverbound
:members:
:member-order: bysource

21 changes: 21 additions & 0 deletions docs/api/version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. currentmodule:: minecraft

Versioning
==========

This project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

.. data:: __version__

The current version of the library, such as ``'0.0.0-alpha.1'``.

:type: str


.. data:: version_info

The current version of the library in a named tuple.

This is identical to :data:`sys.version_info`.

:type: typing.NamedTuple
Loading