Add support for Minecraft 1.18 and 1.18.1.

This commit is contained in:
joodicator committed 2021-12-16 19:39:13 +01:00
1 parent 1ae9a2b48a
commit bf49006553
17 files changed
+322 -75

No files matched your search

+7
View File
@@ -53,6 +53,13 @@ class ConnectionContext(object):
later than, or is equal to, 'other_pv', or else False."""
return utility.protocol_earlier_eq(other_pv, self.protocol_version)
def protocol_in_range(self, start_pv, end_pv):
"""Returns True if the protocol version of this context was published
later than, or is equal to, 'start_pv' and was published earlier
than 'end_pv' (analogously to Python's 'range' function)."""
return (utility.protocol_earlier(self.protocol_version, end_pv) and
utility.protocol_earlier_eq(start_pv, self.protocol_version))
class _ConnectionOptions(object):
def __init__(self, address=None, port=None, compression_threshold=-1,