2015-04-01 17:38:14 +02:00
|
|
|
"""
|
|
|
|
A modern, Python3-compatible, well-documented library for communicating
|
|
|
|
with a MineCraft server.
|
|
|
|
"""
|
2016-03-05 08:28:14 +01:00
|
|
|
|
2019-05-14 18:41:58 +02:00
|
|
|
# The version number of the most recent pyCraft release.
|
2019-05-29 18:47:14 +02:00
|
|
|
__version__ = "0.6.0"
|
2016-03-05 08:28:14 +01:00
|
|
|
|
2019-08-16 00:16:41 +02:00
|
|
|
# A dict mapping the ID string of each Minecraft version supported by pyCraft
|
|
|
|
# to the corresponding protocol version number. The ID string of a version is
|
|
|
|
# the key used to identify it in
|
|
|
|
# <https://launchermeta.mojang.com/mc/game/version_manifest.json>, or the 'id'
|
|
|
|
# key in "version.json" in the corresponding ".jar" file distributed by Mojang.
|
2016-03-07 03:40:25 +01:00
|
|
|
SUPPORTED_MINECRAFT_VERSIONS = {
|
2019-05-13 22:25:40 +02:00
|
|
|
'1.8': 47,
|
|
|
|
'1.8.1': 47,
|
|
|
|
'1.8.2': 47,
|
|
|
|
'1.8.3': 47,
|
|
|
|
'1.8.4': 47,
|
|
|
|
'1.8.5': 47,
|
|
|
|
'1.8.6': 47,
|
|
|
|
'1.8.7': 47,
|
|
|
|
'1.8.8': 47,
|
|
|
|
'1.8.9': 47,
|
|
|
|
'1.9': 107,
|
|
|
|
'1.9.1': 108,
|
|
|
|
'1.9.2': 109,
|
|
|
|
'1.9.3': 110,
|
|
|
|
'1.9.4': 110,
|
|
|
|
'1.10': 210,
|
|
|
|
'1.10.1': 210,
|
|
|
|
'1.10.2': 210,
|
|
|
|
'16w32a': 301,
|
|
|
|
'16w32b': 302,
|
|
|
|
'16w33a': 303,
|
|
|
|
'16w35a': 304,
|
|
|
|
'16w36a': 305,
|
|
|
|
'16w38a': 306,
|
|
|
|
'16w39a': 307,
|
|
|
|
'16w39b': 308,
|
|
|
|
'16w39c': 309,
|
|
|
|
'16w40a': 310,
|
|
|
|
'16w41a': 311,
|
|
|
|
'16w42a': 312,
|
|
|
|
'16w43a': 313,
|
|
|
|
'16w44a': 313,
|
|
|
|
'1.11-pre1': 314,
|
|
|
|
'1.11': 315,
|
|
|
|
'16w50a': 316,
|
|
|
|
'1.11.1': 316,
|
|
|
|
'1.11.2': 316,
|
|
|
|
'17w06a': 317,
|
|
|
|
'17w13a': 318,
|
|
|
|
'17w13b': 319,
|
|
|
|
'17w14a': 320,
|
|
|
|
'17w15a': 321,
|
|
|
|
'17w16a': 322,
|
|
|
|
'17w16b': 323,
|
|
|
|
'17w17a': 324,
|
|
|
|
'17w17b': 325,
|
|
|
|
'17w18a': 326,
|
|
|
|
'17w18b': 327,
|
|
|
|
'1.12-pre1': 328,
|
|
|
|
'1.12-pre2': 329,
|
|
|
|
'1.12-pre3': 330,
|
|
|
|
'1.12-pre4': 331,
|
|
|
|
'1.12-pre5': 332,
|
|
|
|
'1.12-pre6': 333,
|
|
|
|
'1.12-pre7': 334,
|
|
|
|
'1.12': 335,
|
|
|
|
'17w31a': 336,
|
|
|
|
'1.12.1-pre1': 337,
|
|
|
|
'1.12.1': 338,
|
|
|
|
'1.12.2-pre1': 339,
|
|
|
|
'1.12.2-pre2': 339,
|
|
|
|
'1.12.2': 340,
|
|
|
|
'17w43a': 341,
|
|
|
|
'17w43b': 342,
|
|
|
|
'17w45a': 343,
|
|
|
|
'17w45b': 344,
|
|
|
|
'17w46a': 345,
|
|
|
|
'17w47a': 346,
|
|
|
|
'17w47b': 347,
|
|
|
|
'17w48a': 348,
|
|
|
|
'17w49a': 349,
|
|
|
|
'17w49b': 350,
|
|
|
|
'17w50a': 351,
|
|
|
|
'18w01a': 352,
|
|
|
|
'18w02a': 353,
|
|
|
|
'18w03a': 354,
|
|
|
|
'18w03b': 355,
|
|
|
|
'18w05a': 356,
|
|
|
|
'18w06a': 357,
|
|
|
|
'18w07a': 358,
|
|
|
|
'18w07b': 359,
|
|
|
|
'18w07c': 360,
|
|
|
|
'18w08a': 361,
|
|
|
|
'18w08b': 362,
|
|
|
|
'18w09a': 363,
|
|
|
|
'18w10a': 364,
|
|
|
|
'18w10b': 365,
|
|
|
|
'18w10c': 366,
|
|
|
|
'18w10d': 367,
|
|
|
|
'18w11a': 368,
|
|
|
|
'18w14a': 369,
|
|
|
|
'18w14b': 370,
|
|
|
|
'18w15a': 371,
|
|
|
|
'18w16a': 372,
|
|
|
|
'18w19a': 373,
|
|
|
|
'18w19b': 374,
|
|
|
|
'18w20a': 375,
|
|
|
|
'18w20b': 376,
|
|
|
|
'18w20c': 377,
|
|
|
|
'18w21a': 378,
|
|
|
|
'18w21b': 379,
|
|
|
|
'18w22a': 380,
|
|
|
|
'18w22b': 381,
|
|
|
|
'18w22c': 382,
|
|
|
|
'1.13-pre1': 383,
|
|
|
|
'1.13-pre2': 384,
|
|
|
|
'1.13-pre3': 385,
|
|
|
|
'1.13-pre4': 386,
|
|
|
|
'1.13-pre5': 387,
|
|
|
|
'1.13-pre6': 388,
|
|
|
|
'1.13-pre7': 389,
|
|
|
|
'1.13-pre8': 390,
|
|
|
|
'1.13-pre9': 391,
|
|
|
|
'1.13-pre10': 392,
|
|
|
|
'1.13': 393,
|
|
|
|
'18w30a': 394,
|
|
|
|
'18w30b': 395,
|
|
|
|
'18w31a': 396,
|
|
|
|
'18w32a': 397,
|
|
|
|
'18w33a': 398,
|
|
|
|
'1.13.1-pre1': 399,
|
|
|
|
'1.13.1-pre2': 400,
|
|
|
|
'1.13.1': 401,
|
|
|
|
'1.13.2-pre1': 402,
|
|
|
|
'1.13.2-pre2': 403,
|
|
|
|
'1.13.2': 404,
|
|
|
|
'18w43a': 441,
|
|
|
|
'18w43b': 441,
|
|
|
|
'18w43c': 442,
|
|
|
|
'18w44a': 443,
|
|
|
|
'18w45a': 444,
|
|
|
|
'18w46a': 445,
|
|
|
|
'18w47a': 446,
|
|
|
|
'18w47b': 447,
|
|
|
|
'18w48a': 448,
|
|
|
|
'18w48b': 449,
|
|
|
|
'18w49a': 450,
|
|
|
|
'18w50a': 451,
|
|
|
|
'19w02a': 452,
|
|
|
|
'19w03a': 453,
|
|
|
|
'19w03b': 454,
|
|
|
|
'19w03c': 455,
|
|
|
|
'19w04a': 456,
|
|
|
|
'19w04b': 457,
|
|
|
|
'19w05a': 458,
|
|
|
|
'19w06a': 459,
|
|
|
|
'19w07a': 460,
|
|
|
|
'19w08a': 461,
|
|
|
|
'19w08b': 462,
|
|
|
|
'19w09a': 463,
|
|
|
|
'19w11a': 464,
|
|
|
|
'19w11b': 465,
|
|
|
|
'19w12a': 466,
|
|
|
|
'19w12b': 467,
|
|
|
|
'19w13a': 468,
|
|
|
|
'19w13b': 469,
|
|
|
|
'19w14a': 470,
|
|
|
|
'19w14b': 471,
|
|
|
|
'1.14 Pre-Release 1': 472,
|
|
|
|
'1.14 Pre-Release 2': 473,
|
|
|
|
'1.14 Pre-Release 3': 474,
|
|
|
|
'1.14 Pre-Release 4': 475,
|
|
|
|
'1.14 Pre-Release 5': 476,
|
|
|
|
'1.14': 477,
|
|
|
|
'1.14.1 Pre-Release 1': 478,
|
|
|
|
'1.14.1 Pre-Release 2': 479,
|
|
|
|
'1.14.1': 480,
|
2019-05-29 18:26:06 +02:00
|
|
|
'1.14.2 Pre-Release 1': 481,
|
|
|
|
'1.14.2 Pre-Release 2': 482,
|
|
|
|
'1.14.2 Pre-Release 3': 483,
|
|
|
|
'1.14.2 Pre-Release 4': 484,
|
2019-05-29 07:37:25 +02:00
|
|
|
'1.14.2': 485,
|
2019-08-16 00:16:41 +02:00
|
|
|
'1.14.3-pre1': 486,
|
|
|
|
'1.14.3-pre2': 487,
|
|
|
|
'1.14.3-pre3': 488,
|
|
|
|
'1.14.3-pre4': 489,
|
2019-06-25 05:58:13 +02:00
|
|
|
'1.14.3': 490,
|
2019-08-16 00:16:41 +02:00
|
|
|
'1.14.4-pre1': 491,
|
|
|
|
'1.14.4-pre2': 492,
|
|
|
|
'1.14.4-pre3': 493,
|
|
|
|
'1.14.4-pre4': 494,
|
|
|
|
'1.14.4-pre5': 495,
|
|
|
|
'1.14.4-pre6': 496,
|
|
|
|
'1.14.4-pre7': 497,
|
2019-07-26 03:10:35 +02:00
|
|
|
'1.14.4': 498,
|
2020-01-08 15:54:45 +01:00
|
|
|
'19w34a': 550,
|
|
|
|
'19w35a': 551,
|
|
|
|
'19w36a': 552,
|
|
|
|
'19w37a': 553,
|
|
|
|
'19w38a': 554,
|
|
|
|
'19w38b': 555,
|
|
|
|
'19w39a': 556,
|
|
|
|
'19w40a': 557,
|
|
|
|
'19w41a': 558,
|
|
|
|
'19w42a': 559,
|
|
|
|
'19w44a': 560,
|
|
|
|
'19w45a': 561,
|
|
|
|
'19w45b': 562,
|
|
|
|
'19w46a': 563,
|
|
|
|
'19w46b': 564,
|
|
|
|
'1.15-pre1': 565,
|
|
|
|
'1.15-pre2': 566,
|
|
|
|
'1.15-pre3': 567,
|
|
|
|
'1.15-pre4': 569,
|
|
|
|
'1.15-pre5': 570,
|
|
|
|
'1.15-pre6': 571,
|
|
|
|
'1.15-pre7': 572,
|
2019-12-11 06:52:25 +01:00
|
|
|
'1.15': 573,
|
2020-01-08 15:54:45 +01:00
|
|
|
'1.15.1-pre1': 574,
|
2019-12-22 12:24:26 +01:00
|
|
|
'1.15.1': 575,
|
2020-01-23 18:02:10 +01:00
|
|
|
'1.15.2-pre1': 576,
|
|
|
|
'1.15.2-pre2': 577,
|
|
|
|
'1.15.2': 578,
|
2020-03-17 05:23:35 +01:00
|
|
|
'20w06a': 701,
|
|
|
|
'20w07a': 702,
|
|
|
|
'20w08a': 703,
|
|
|
|
'20w09a': 704,
|
|
|
|
'20w10a': 705,
|
|
|
|
'20w11a': 706,
|
2020-03-20 15:42:41 +01:00
|
|
|
'20w12a': 707,
|
2020-03-26 01:04:55 +01:00
|
|
|
'20w13a': 708,
|
2020-04-17 02:52:48 +02:00
|
|
|
'20w13b': 709,
|
|
|
|
'20w14a': 710,
|
|
|
|
'20w15a': 711,
|
|
|
|
'20w16a': 712,
|
2020-04-22 22:36:19 +02:00
|
|
|
'20w17a': 713,
|
2020-05-04 18:04:04 +02:00
|
|
|
'20w18a': 714,
|
2020-05-07 17:58:08 +02:00
|
|
|
'20w19a': 715,
|
2016-03-07 03:40:25 +01:00
|
|
|
}
|
2016-06-17 02:06:15 +02:00
|
|
|
|
2019-05-14 18:41:58 +02:00
|
|
|
# Those Minecraft versions supported by pyCraft which are "release" versions,
|
|
|
|
# i.e. not development snapshots or pre-release versions.
|
|
|
|
RELEASE_MINECRAFT_VERSIONS = {
|
2019-08-16 00:16:41 +02:00
|
|
|
vid: protocol for (vid, protocol) in SUPPORTED_MINECRAFT_VERSIONS.items()
|
|
|
|
if __import__('re').match(r'\d+(\.\d+)+$', vid)}
|
2019-05-14 18:41:58 +02:00
|
|
|
|
|
|
|
# The protocol versions of SUPPORTED_MINECRAFT_VERSIONS, without duplicates,
|
|
|
|
# in ascending numerical (and hence chronological) order.
|
2018-01-08 00:56:31 +01:00
|
|
|
SUPPORTED_PROTOCOL_VERSIONS = \
|
|
|
|
sorted(set(SUPPORTED_MINECRAFT_VERSIONS.values()))
|
2019-05-14 18:41:58 +02:00
|
|
|
|
|
|
|
# The protocol versions of RELEASE_MINECRAFT_VERSIONS, without duplicates,
|
|
|
|
# in ascending numerical (and hence chronological) order.
|
|
|
|
RELEASE_PROTOCOL_VERSIONS = \
|
|
|
|
sorted(set(RELEASE_MINECRAFT_VERSIONS.values()))
|