repo_id
stringclasses
383 values
file_path
stringlengths
7
168
content
stringlengths
0
1.75M
amidst
src\main\java\amidst\threading\worker\WorkerWithResult.java
package amidst.threading.worker; import amidst.documentation.AmidstThread; import amidst.documentation.CalledOnlyBy; @FunctionalInterface public interface WorkerWithResult<R> { @CalledOnlyBy(AmidstThread.WORKER) R run(); }
amidst
src\main\resources\amidst\mojangapi\default_biome_profile.json
{ "name":"Default", "shortcut":"control D", "colorMap":[ [ 0, { "r":0, "g":0, "b":112 } ], [ 1, { "r":141, "g":179, "b":96 } ], [ 2, { "r":250, "g":148, "b":24 } ], [ 3, { "r":96, "g":96, "b":96 } ], [ 4, { "r":5, "g":102, "b":33 } ], [ 5, { "r":11, "g":102, "b":89 } ], [ 6, { "r":7, "g":249, "b":178 } ], [ 7, { "r":0, "g":0, "b":255 } ], [ 8, { "r":191, "g":59, "b":59 } ], [ 9, { "r":128, "g":128, "b":255 } ], [ 10, { "r":112, "g":112, "b":214 } ], [ 11, { "r":160, "g":160, "b":255 } ], [ 12, { "r":255, "g":255, "b":255 } ], [ 13, { "r":160, "g":160, "b":160 } ], [ 14, { "r":255, "g":0, "b":255 } ], [ 15, { "r":160, "g":0, "b":255 } ], [ 16, { "r":250, "g":222, "b":85 } ], [ 17, { "r":210, "g":95, "b":18 } ], [ 18, { "r":34, "g":85, "b":28 } ], [ 19, { "r":22, "g":57, "b":51 } ], [ 20, { "r":114, "g":120, "b":154 } ], [ 21, { "r":83, "g":123, "b":9 } ], [ 22, { "r":44, "g":66, "b":5 } ], [ 23, { "r":98, "g":139, "b":23 } ], [ 24, { "r":0, "g":0, "b":48 } ], [ 25, { "r":162, "g":162, "b":132 } ], [ 26, { "r":250, "g":240, "b":192 } ], [ 27, { "r":48, "g":116, "b":68 } ], [ 28, { "r":31, "g":95, "b":50 } ], [ 29, { "r":64, "g":81, "b":26 } ], [ 30, { "r":49, "g":85, "b":74 } ], [ 31, { "r":36, "g":63, "b":54 } ], [ 32, { "r":89, "g":102, "b":81 } ], [ 33, { "r":69, "g":79, "b":62 } ], [ 34, { "r":80, "g":112, "b":80 } ], [ 35, { "r":189, "g":178, "b":95 } ], [ 36, { "r":167, "g":157, "b":100 } ], [ 37, { "r":217, "g":69, "b":21 } ], [ 38, { "r":176, "g":151, "b":101 } ], [ 39, { "r":202, "g":140, "b":101 } ], [ 40, { "r":128, "g":128, "b":255 } ], [ 41, { "r":128, "g":128, "b":255 } ], [ 42, { "r":128, "g":128, "b":255 } ], [ 43, { "r":128, "g":128, "b":255 } ], [ 44, { "r":0, "g":0, "b":172 } ], [ 45, { "r":0, "g":0, "b":144 } ], [ 46, { "r":32, "g":32, "b":112 } ], [ 47, { "r":0, "g":0, "b":80 } ], [ 48, { "r":0, "g":0, "b":64 } ], [ 49, { "r":32, "g":32, "b":56 } ], [ 50, { "r":64, "g":64, "b":144 } ], [ 127, { "r":0, "g":0, "b":0 } ], [ 129, { "r":181, "g":219, "b":136 } ], [ 130, { "r":255, "g":188, "b":64 } ], [ 131, { "r":136, "g":136, "b":136 } ], [ 132, { "r":45, "g":142, "b":73 } ], [ 133, { "r":51, "g":142, "b":129 } ], [ 134, { "r":47, "g":255, "b":218 } ], [ 140, { "r":180, "g":220, "b":220 } ], [ 149, { "r":123, "g":163, "b":49 } ], [ 151, { "r":138, "g":179, "b":63 } ], [ 155, { "r":88, "g":156, "b":108 } ], [ 156, { "r":71, "g":135, "b":90 } ], [ 157, { "r":104, "g":121, "b":66 } ], [ 158, { "r":89, "g":125, "b":114 } ], [ 160, { "r":129, "g":142, "b":121 } ], [ 161, { "r":109, "g":119, "b":102 } ], [ 162, { "r":120, "g":152, "b":120 } ], [ 163, { "r":229, "g":218, "b":135 } ], [ 164, { "r":207, "g":197, "b":140 } ], [ 165, { "r":255, "g":109, "b":61 } ], [ 166, { "r":216, "g":191, "b":141 } ], [ 167, { "r":242, "g":180, "b":141 } ], [ 168, { "r":118, "g":142, "b":20 } ], [ 169, { "r":59, "g":71, "b":10 } ], [ 170, { "r":94, "g":56, "b":48 } ], [ 171, { "r":221, "g":8, "b":8 } ], [ 172, { "r":73, "g":144, "b":123 } ], [ 173, { "r":64, "g":54, "b":54 } ] ] }
amidst
src\main\resources\amidst\mojangapi\version_manifest.json
{"latest": {"release": "1.17", "snapshot": "1.17"}, "versions": [{"id": "1.17", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/44fa141917df947ed5a138f5cfe667a34f7bbaca/1.17.json", "time": "2021-06-08T11:04:03+00:00", "releaseTime": "2021-06-08T11:00:40+00:00"}, {"id": "1.17-rc2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f519837590bed663f935c90141c001f66bd61d8e/1.17-rc2.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-06-07T11:46:28+00:00"}, {"id": "1.17-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6c2a5af59125c39a487d032967b084e1a3ee260d/1.17-rc1.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-06-04T13:24:48+00:00"}, {"id": "1.17-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/96c554df2191769207c84363410a962b8e3a4062/1.17-pre5.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-06-03T17:01:28+00:00"}, {"id": "1.17-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/22f4ef49025c630f0a44dbcdb8e8a8fe82d19290/1.17-pre4.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-06-02T16:15:43+00:00"}, {"id": "1.17-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fa5f421a793c062e2809c65eb76c9f65492671db/1.17-pre3.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-06-01T15:43:46+00:00"}, {"id": "1.17-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8fbf1fd967750e52e48a7f89ee3de9a2bad7b96b/1.17-pre2.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-05-31T15:54:05+00:00"}, {"id": "1.17-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3581bb3ff271a714bc5e5bded2fb90bd17aafc87/1.17-pre1.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-05-27T09:39:21+00:00"}, {"id": "21w20a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0883286188ce8a2ed9c03adf2300fc56b5959b2a/21w20a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-05-19T15:22:02+00:00"}, {"id": "21w19a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7ad6c3b2694d2f988998721b5deec4fe76f5eb3e/21w19a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-05-12T11:19:15+00:00"}, {"id": "21w18a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/361c5c67a9a56648ccabc2f6623b94a33233612a/21w18a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-05-05T15:24:35+00:00"}, {"id": "21w17a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/01b0633d42dc32a0a462d90be1a679d3a821945c/21w17a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-04-28T13:54:05+00:00"}, {"id": "21w16a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8595e64d8e59bf67f0d24d52e5be6395dbc7f362/21w16a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-04-21T16:41:14+00:00"}, {"id": "21w15a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a071d8a055305401856b6da0d9e09883c5cbeb67/21w15a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-04-14T13:41:34+00:00"}, {"id": "21w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8a087eb2c89adbd86e617dcfdc000e34d47fdffc/21w14a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-04-07T14:04:09+00:00"}, {"id": "21w13a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ced110ac8b81894095a2fc2a37210a89bb042143/21w13a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-03-31T16:17:46+00:00"}, {"id": "21w11a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2b07aaa059559d85332845454971929f3cb1d07f/21w11a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-03-17T15:05:50+00:00"}, {"id": "21w10a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b9b4e504293e8ce11b7a3c877e9541d5e1ff42aa/21w10a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-03-10T15:24:38+00:00"}, {"id": "21w08b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4ba9992d24ba0ffa5a40f120c324d39e0ff8bc37/21w08b.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-25T11:46:34+00:00"}, {"id": "21w08a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6ccb3be04a461b0b2ae1a3d8dbf3dd33db687818/21w08a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-24T14:38:51+00:00"}, {"id": "21w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c421cb0f88b2dd79019eaa6a67746b72cecf0d49/21w07a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-17T16:35:40+00:00"}, {"id": "21w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c57a9b007ea53c2abfadff0a5e592ab6f1ea4c57/21w06a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-10T17:13:54+00:00"}, {"id": "21w05b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/254390011f0a66cba6e27977a5f8324e97ec075d/21w05b.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-04T15:09:29+00:00"}, {"id": "21w05a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/306f9902977dda9d52bd9628768b215db7f1acae/21w05a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-02-03T15:56:54+00:00"}, {"id": "21w03a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b3284f4b30d20d4d81e1f1f12e7ffa50556e5d9a/21w03a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2021-01-20T14:56:29+00:00"}, {"id": "1.16.5", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/436877ffaef948954053e1a78a366b8b7c204a91/1.16.5.json", "time": "2021-01-14T16:09:14+00:00", "releaseTime": "2021-01-14T16:05:32+00:00"}, {"id": "1.16.5-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/71e9c151db78849ce3c2b3161a0f87e7dbbe61fd/1.16.5-rc1.json", "time": "2021-01-14T14:07:34+00:00", "releaseTime": "2021-01-13T15:58:55+00:00"}, {"id": "20w51a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dd9ee3996e44d275c7fd3e1422a7394dbd0107be/20w51a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2020-12-16T16:27:57+00:00"}, {"id": "20w49a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f09c95482939fbe38b79e4f29876f8c18f645f23/20w49a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2020-12-02T16:47:20+00:00"}, {"id": "20w48a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b42462c21284920420f0a2a31d82942982f0d5a0/20w48a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2020-11-25T15:42:24+00:00"}, {"id": "20w46a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fa85be32bd769dab56d8f2970f71687736acf9d8/20w46a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2020-11-11T15:30:32+00:00"}, {"id": "20w45a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f4362d0c390540fca08cdc46f5ec48ba05c90650/20w45a.json", "time": "2021-06-08T10:51:13+00:00", "releaseTime": "2020-11-04T16:42:00+00:00"}, {"id": "1.16.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/b8adadb9b21e7be96994d4485f7576377f883a0d/1.16.4.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-10-29T15:49:37+00:00"}, {"id": "1.16.4-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b4a9d9dcfbfca9965dea1e579cfab9cd4c2738f5/1.16.4-rc1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-10-27T16:31:08+00:00"}, {"id": "1.16.4-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ddaf385fd2d21bb52fadfd5e7e570cfdfd1cadf7/1.16.4-pre2.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-10-22T15:32:17+00:00"}, {"id": "1.16.4-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7194b676975672260235753f57df8e7a62b0ca05/1.16.4-pre1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-10-13T14:36:07+00:00"}, {"id": "1.16.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/1e27bd30d3bfd10e072c5ff7ea1bc2a22e11b687/1.16.3.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-09-10T13:42:37+00:00"}, {"id": "1.16.3-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a5bda56aaa6c1986a621fe234746eaf3fe7f198c/1.16.3-rc1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-09-07T12:34:06+00:00"}, {"id": "1.16.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/f27887ca787ae699c2284da64c2a28abda52bfe0/1.16.2.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-08-11T10:13:46+00:00"}, {"id": "1.16.2-rc2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e21e17591a53f3c9d993c9f46ca20e11273218d8/1.16.2-rc2.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-08-10T11:43:36+00:00"}, {"id": "1.16.2-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/818452f8cb1c7baae017308026257b9e51b8f21b/1.16.2-rc1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-08-07T14:35:39+00:00"}, {"id": "1.16.2-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d43abed7ba7f6ce9d57d798db1c99d38a214fc8c/1.16.2-pre3.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-08-06T16:44:52+00:00"}, {"id": "1.16.2-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0da70ca20e2d247fa36eeb5626d5be5abd19b5ae/1.16.2-pre2.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-08-05T15:30:50+00:00"}, {"id": "1.16.2-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9850e2c8526d517c7ef9f7c9e411bbfe4c6cb026/1.16.2-pre1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-07-29T13:19:05+00:00"}, {"id": "20w30a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/94d6c2cb261778ad1767843cfbd00fa4e7940a5d/20w30a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-07-22T15:05:15+00:00"}, {"id": "20w29a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e516b0a3305ee1929ce09780d955310dda82c700/20w29a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-07-15T14:13:47+00:00"}, {"id": "20w28a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/34a23d0c332cb62c34154faa11be55695ffdf7bb/20w28a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-07-08T15:10:40+00:00"}, {"id": "20w27a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/694a98f5dac72e385707d06d698ab9ed0652e34f/20w27a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-07-01T15:07:35+00:00"}, {"id": "1.16.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/2f7a599ac111edf5ba9547b665a641e1510e8580/1.16.1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-24T10:31:40+00:00"}, {"id": "1.16", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/f658f2176d0bf1f6b397a23f9b4e40fa9bafbcf3/1.16.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-23T16:20:52+00:00"}, {"id": "1.16-rc1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9c2bb2a0593d28484d01eb08f33401b471a3c0f6/1.16-rc1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-18T12:49:28+00:00"}, {"id": "1.16-pre8", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/996641916731332d0b93ee24fbde1b32b9847d75/1.16-pre8.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-17T14:45:23+00:00"}, {"id": "1.16-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2f56dc194e996bea31d0041dc68e6989c8b9279a/1.16-pre7.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-16T15:31:35+00:00"}, {"id": "1.16-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bb1a1dfc49be48a1e692e88cec667793ab70213d/1.16-pre6.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-15T16:57:57+00:00"}, {"id": "1.16-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/951753c2eec2ab0be77851c712be9340ead07145/1.16-pre5.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-12T14:33:59+00:00"}, {"id": "1.16-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7e54d411653e7270158b5b4e97b8d223d269dcaa/1.16-pre4.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-11T15:45:55+00:00"}, {"id": "1.16-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b79b015404dab903f975c512cfdf6e8ecb7936cb/1.16-pre3.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-10T14:57:43+00:00"}, {"id": "1.16-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/54214766331731e44c965608acce461560b0de33/1.16-pre2.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-05T10:47:59+00:00"}, {"id": "1.16-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b5b7c00b2a7ee76a1fc6289ab1a0c26935637a37/1.16-pre1.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-06-04T18:17:51+00:00"}, {"id": "20w22a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d7b14fbf1339e2136dbf57a03bb48a0e04d87a6b/20w22a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-05-29T11:25:02+00:00"}, {"id": "20w21a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/425bb2c05194f970bb657a9ef70f667faca7118c/20w21a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-05-20T12:07:18+00:00"}, {"id": "20w20b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fc6b3d31fe38b18a2712a4b1c1e5e334a2ed8e6f/20w20b.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-05-14T08:16:26+00:00"}, {"id": "20w20a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/eb8d644c61521312ed83957ba2f00fb232b1bf08/20w20a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-05-13T15:11:43+00:00"}, {"id": "20w19a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0e0baab61380da18dc8b3c10b5cd3b47bf6285e6/20w19a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-05-06T16:23:24+00:00"}, {"id": "20w18a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bfcc3171ae4925e9505f890db4605c6772f97fd7/20w18a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-29T15:16:34+00:00"}, {"id": "20w17a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/899bc9acd79fdb486ba3728aa6766e06ae8a31b5/20w17a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-22T13:47:50+00:00"}, {"id": "20w16a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2450cbb413bf3fe5870987654f21ddb5b0774da0/20w16a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-15T14:13:01+00:00"}, {"id": "20w15a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8bb932faece947a16d3670e76637ac48392090b0/20w15a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-08T12:29:24+00:00"}, {"id": "20w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1156d829c742c34b7cf9455b2f8c67dd5a28269e/20w14a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-02T14:28:06+00:00"}, {"id": "20w14infinite", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/87c31d7132bab028a1d203f422358f6a9ecfa711/20w14infinite.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-04-01T12:47:08+00:00"}, {"id": "20w13b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/031b4ce9928156d3d4970332ab73df21c2685b17/20w13b.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-03-26T13:00:34+00:00"}, {"id": "20w13a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/22acd028cf6d89f354433d54b0b03cc09b629c74/20w13a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-03-25T17:05:33+00:00"}, {"id": "20w12a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bdad8dabf9d180254a5e9fdc2031845f7d030bae/20w12a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-03-18T16:42:06+00:00"}, {"id": "20w11a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/495224665ef6b2fc0a36a2ae77ecf838e6521223/20w11a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-03-11T16:28:27+00:00"}, {"id": "20w10a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a82b1308069488520e3c6a64b77490ef2a44b1d3/20w10a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-03-04T16:21:41+00:00"}, {"id": "20w09a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9385a77fc60bd08f2154b02e1456876367236d03/20w09a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-02-26T16:43:08+00:00"}, {"id": "20w08a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2ca77024d458fc5dd36760c184563161a168d721/20w08a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-02-19T13:30:09+00:00"}, {"id": "20w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/09bd102ac077c9344b6d3683c575658aeed0ad8a/20w07a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-02-14T13:20:49+00:00"}, {"id": "20w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8899bced738473644388582c4e108f84ac966e2b/20w06a.json", "time": "2021-01-13T14:09:04+00:00", "releaseTime": "2020-02-05T16:05:22+00:00"}, {"id": "1.15.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/1d78c44115b99bf28a30be482979832537dc4328/1.15.2.json", "time": "2020-08-24T14:58:42+00:00", "releaseTime": "2020-01-17T10:03:52+00:00"}, {"id": "1.15.2-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5b3043aff014e47f93c1f00c43c6ec9584851357/1.15.2-pre2.json", "time": "2020-08-24T14:59:22+00:00", "releaseTime": "2020-01-16T12:35:57+00:00"}, {"id": "1.15.2-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8016dbd102e7de14a45f862167b8d4462d3c69df/1.15.2-pre1.json", "time": "2020-08-24T14:59:20+00:00", "releaseTime": "2020-01-14T16:19:31+00:00"}, {"id": "1.15.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/693ed0b8f1ea164fa547ca73ca5b0bd9d0693f28/1.15.1.json", "time": "2020-08-24T14:58:40+00:00", "releaseTime": "2019-12-16T10:29:47+00:00"}, {"id": "1.15.1-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/36c94ce5479a187f2ab187b0535c7e086a75813a/1.15.1-pre1.json", "time": "2020-08-24T14:59:17+00:00", "releaseTime": "2019-12-12T14:02:30+00:00"}, {"id": "1.15", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/bb4fc0f28e197db137d184eb963f6df918aa7ea1/1.15.json", "time": "2020-08-24T14:58:44+00:00", "releaseTime": "2019-12-09T13:13:38+00:00"}, {"id": "1.15-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b0050ca0f88fce900b1a1b466a15e2c712cd3697/1.15-pre7.json", "time": "2020-08-24T14:59:16+00:00", "releaseTime": "2019-12-09T12:14:11+00:00"}, {"id": "1.15-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a0479e50f1e121b6800762a3355ac4e95432f558/1.15-pre6.json", "time": "2020-08-24T14:59:14+00:00", "releaseTime": "2019-12-06T12:04:30+00:00"}, {"id": "1.15-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9896d1f69aebd99e96310e99a26850066a176660/1.15-pre5.json", "time": "2020-08-24T14:59:10+00:00", "releaseTime": "2019-12-05T13:20:00+00:00"}, {"id": "1.15-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/251ca32711a16191007bf95c96849c7580e617c1/1.15-pre4.json", "time": "2020-08-24T14:59:06+00:00", "releaseTime": "2019-12-03T12:24:24+00:00"}, {"id": "1.15-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/484f38b699263e32e8621bc91282a9e689bcd7aa/1.15-pre3.json", "time": "2020-08-24T14:59:00+00:00", "releaseTime": "2019-11-28T17:17:50+00:00"}, {"id": "1.15-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/954b0ee83d3af45cc1ad1d6d303b909f9cce45a9/1.15-pre2.json", "time": "2020-08-24T14:58:57+00:00", "releaseTime": "2019-11-25T18:09:38+00:00"}, {"id": "1.15-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/918e573b67c8667d3783ebf31883b2c98ef0f239/1.15-pre1.json", "time": "2020-08-24T14:58:54+00:00", "releaseTime": "2019-11-21T17:01:17+00:00"}, {"id": "19w46b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fe1e295212a68e37412aa9ca0bee11fce2ecff4e/19w46b.json", "time": "2020-08-24T15:00:34+00:00", "releaseTime": "2019-11-14T13:29:24+00:00"}, {"id": "19w46a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f40c44d29caa0e118f76ba1cd17c4662618a95b1/19w46a.json", "time": "2020-08-24T15:00:32+00:00", "releaseTime": "2019-11-13T16:37:46+00:00"}, {"id": "19w45b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/695ad87f6cd165df4d29522f56c919ca26af6646/19w45b.json", "time": "2020-08-24T15:00:30+00:00", "releaseTime": "2019-11-08T12:42:44+00:00"}, {"id": "19w45a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/da3be62a9dc3dcebc4af51705c0e914eb54af0ae/19w45a.json", "time": "2020-08-24T15:00:28+00:00", "releaseTime": "2019-11-07T16:19:20+00:00"}, {"id": "19w44a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/694b99aa175b6cf6f1a14a8e98c0b4ffe3d17741/19w44a.json", "time": "2020-08-24T15:00:26+00:00", "releaseTime": "2019-10-30T15:31:44+00:00"}, {"id": "19w42a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2ae4a4cb351014c10e4cf234a8157c320d528bea/19w42a.json", "time": "2020-08-24T15:00:24+00:00", "releaseTime": "2019-10-16T15:30:39+00:00"}, {"id": "19w41a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2f727d5d3644f0576da91892551b4f655fea05e5/19w41a.json", "time": "2020-08-24T15:00:22+00:00", "releaseTime": "2019-10-09T15:21:35+00:00"}, {"id": "19w40a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e96e5728e5c8180727097816436b5584f483e392/19w40a.json", "time": "2020-08-24T15:00:19+00:00", "releaseTime": "2019-10-02T13:40:26+00:00"}, {"id": "19w39a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e51828598375862cc89dcdd5c0451e212277d8d0/19w39a.json", "time": "2020-08-24T15:00:17+00:00", "releaseTime": "2019-09-27T10:13:33+00:00"}, {"id": "19w38b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/44ef168e613e83a5f506db0e6a9d2bf83afb51b8/19w38b.json", "time": "2020-08-24T15:00:15+00:00", "releaseTime": "2019-09-18T14:59:13+00:00"}, {"id": "19w38a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c42941de4e1d2752363d797aacdae924e57c17da/19w38a.json", "time": "2020-08-24T15:00:13+00:00", "releaseTime": "2019-09-18T10:03:22+00:00"}, {"id": "19w37a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dcd83fdf65cb7bb3231fce119c5a99faa835d33f/19w37a.json", "time": "2020-08-24T15:00:11+00:00", "releaseTime": "2019-09-11T11:46:44+00:00"}, {"id": "19w36a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4a55c00fe33ab45fe8555ead8ff01a9bb396571b/19w36a.json", "time": "2020-08-24T15:00:09+00:00", "releaseTime": "2019-09-04T11:19:34+00:00"}, {"id": "19w35a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4f42d8761ee3f8751afc17672623f1ac55e7869d/19w35a.json", "time": "2020-06-18T12:38:53+00:00", "releaseTime": "2019-08-28T15:01:44+00:00"}, {"id": "19w34a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/33829186f0ce0ef9f5de0d2445ee1c49bf17bd41/19w34a.json", "time": "2020-06-18T12:38:53+00:00", "releaseTime": "2019-08-22T12:06:21+00:00"}, {"id": "1.14.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/361b6f18d422c3cd7323c268201f5404b06194e4/1.14.4.json", "time": "2020-08-24T14:58:39+00:00", "releaseTime": "2019-07-19T09:25:47+00:00"}, {"id": "1.14.4-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c69051042abf0340dce2e00723902e85a3d23d12/1.14.4-pre7.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-18T11:32:36+00:00"}, {"id": "1.14.4-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/10213c3e0c7e9954ba157d4e8ebe08367802ca53/1.14.4-pre6.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-15T12:39:49+00:00"}, {"id": "1.14.4-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cef180973086805b5e8618426ec82d29a367cf34/1.14.4-pre5.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-11T10:52:33+00:00"}, {"id": "1.14.4-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ee6105b0d0b709cd9d623e1bb4a1879ceaabbcb7/1.14.4-pre4.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-10T12:53:29+00:00"}, {"id": "1.14.4-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0f2f3e7780c055bf8beb3d60e8e5d558f6f9058e/1.14.4-pre3.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-08T11:21:42+00:00"}, {"id": "1.14.4-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3b8c4c8f5620a978240911a6d1a996d42c29092a/1.14.4-pre2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-04T14:41:05+00:00"}, {"id": "1.14.4-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/68e2ca4e113772dc0bb35071852df729bbb08da9/1.14.4-pre1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-07-03T13:01:01+00:00"}, {"id": "1.14.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/771d2feb29736889b66632f037e973fbf73063f7/1.14.3.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-06-24T12:52:52+00:00"}, {"id": "1.14.3-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d6a23c6a700a312c69a91d9608ca85cc5f5d6a2b/1.14.3-pre4.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-06-19T11:44:29+00:00"}, {"id": "1.14.3-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/767d65ec7037b0b46300e720fd3f2bf56afad1c6/1.14.3-pre3.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-06-14T08:03:33+00:00"}, {"id": "1.14.3-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2d3239cccc4ed0e4bcf20796584cda2c2716dd9a/1.14.3-pre2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-06-07T09:11:29+00:00"}, {"id": "1.14.3-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/baa80fcf68d12f216514d83abb5513414a733826/1.14.3-pre1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-06-03T14:34:20+00:00"}, {"id": "1.14.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/2a74bf61101997340b101677434b36c29af68bd7/1.14.2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-27T11:48:25+00:00"}, {"id": "1.14.2 Pre-Release 4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/89149d5106f7b2558c47806205797ca7e3effd80/1.14.2_Pre-Release_4.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-27T07:21:11+00:00"}, {"id": "1.14.2 Pre-Release 3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f827544a1a417c4d9330c6c41d6af747957c79ec/1.14.2_Pre-Release_3.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-22T13:12:51+00:00"}, {"id": "1.14.2 Pre-Release 2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b7b6d4a6f88a1782d065775f67e71cfb83b36ab1/1.14.2_Pre-Release_2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-17T12:21:03+00:00"}, {"id": "1.14.2 Pre-Release 1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9eec5760b10ee665d666c0b04fcacff4255e914b/1.14.2_Pre-Release_1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-16T15:40:25+00:00"}, {"id": "1.14.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/6997d2f2872eb815df5b5cdcdd17a29f80eab844/1.14.1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-13T11:10:12+00:00"}, {"id": "1.14.1 Pre-Release 2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6fda8188f21f393a9462128ee125411d54baa908/1.14.1_Pre-Release_2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-09T14:01:04+00:00"}, {"id": "1.14.1 Pre-Release 1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/03a18eb4d99c1a5e850ed179052ace5062149bb8/1.14.1_Pre-Release_1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-05-07T14:44:42+00:00"}, {"id": "1.14", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/002290f18faa9f4d7e239436d2056a4812cb7cc6/1.14.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-23T14:52:44+00:00"}, {"id": "1.14 Pre-Release 5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/62026af356e1b48bc427c6a73873c594ecb6b2fb/1.14_Pre-Release_5.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-18T11:05:19+00:00"}, {"id": "1.14 Pre-Release 4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/19b39d3e804b615350f6c163c592b5dfbcbf4e8d/1.14_Pre-Release_4.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-17T15:31:12+00:00"}, {"id": "1.14 Pre-Release 3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5a3639c873d18fe32ce0a5553d355689c88b67b7/1.14_Pre-Release_3.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-16T13:57:10+00:00"}, {"id": "1.14 Pre-Release 2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4b92b935382f7e1647b70ffec52009b8e67cb446/1.14_Pre-Release_2.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-12T11:38:53+00:00"}, {"id": "1.14 Pre-Release 1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4fc583e3bc5a2b7175c82b7d013d0c9a04571ea1/1.14_Pre-Release_1.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-10T14:24:16+00:00"}, {"id": "19w14b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2a3c391a8119cef86cf1fb3e434bb63f044092aa/19w14b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-05T10:33:58+00:00"}, {"id": "19w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/23646f8e0a8205952654ef418fec9e1d696f9083/19w14a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-04-03T13:45:00+00:00"}, {"id": "3D Shareware v1.34", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/14b4bda35d123bb53313ce099943d40cf25fc159/3D_Shareware_v1.34.json", "time": "2019-06-28T07:12:23+00:00", "releaseTime": "2019-04-01T11:18:08+00:00"}, {"id": "19w13b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9352276bd2110a6df9265446c6899c5e1865bc0c/19w13b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-29T16:53:22+00:00"}, {"id": "19w13a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/72493359732d7cdf6410695428f6f7b81b50a2cb/19w13a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-27T15:15:31+00:00"}, {"id": "19w12b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5c7226b97b2f2cd1f86d7bacae10b990fc3412e0/19w12b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-21T15:20:01+00:00"}, {"id": "19w12a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b4edadb2712470a48a25f908b28d8a66a5144866/19w12a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-20T16:47:34+00:00"}, {"id": "19w11b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/020980042400c4226cc131666da4782baa7f660a/19w11b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-14T14:26:23+00:00"}, {"id": "19w11a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/16c393fa7eda1447e5c43ff8a9237f5666a5c0dd/19w11a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-03-13T13:59:29+00:00"}, {"id": "19w09a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/828559d2e7690f2e0d33b3943712ac8b8e6bf862/19w09a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-02-27T14:44:30+00:00"}, {"id": "19w08b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c15af31e0571ee01c988425af23587d65aa5aeff/19w08b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-02-21T13:38:09+00:00"}, {"id": "19w08a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bcd1dea72c2e2b4d4d9f227be1a9cc07b2ec14c4/19w08a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-02-20T14:56:58+00:00"}, {"id": "19w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/80431007ce6851d5a6ea8f2348aefac23fc41618/19w07a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-02-13T16:12:08+00:00"}, {"id": "19w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ecb34b3150dc1bd72b429f337c76a70ef77630ef/19w06a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-02-06T16:24:13+00:00"}, {"id": "19w05a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f2108d2472d48fe1bc5cf0d8d3b00c4c9c2dec80/19w05a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-30T15:16:49+00:00"}, {"id": "19w04b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/990653458a48112ae3b64908effd267c1538edc9/19w04b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-25T12:20:15+00:00"}, {"id": "19w04a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a65141d2eabffc56f646cfc87da51b10c85c974c/19w04a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-24T15:31:52+00:00"}, {"id": "19w03c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8ca46d174fcf38e99af824ad8538b191342e6637/19w03c.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-18T11:27:13+00:00"}, {"id": "19w03b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/395a5d3ec0cb38863ce1f0aef9f5e2ce22405d65/19w03b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-17T16:43:27+00:00"}, {"id": "19w03a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/41031c5cfcc8e70e57b44d88c3ff96dced3ec30b/19w03a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-16T16:45:02+00:00"}, {"id": "19w02a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3ed68601a666b3d5be95d1a49d3b44f0deebf43b/19w02a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2019-01-09T15:52:07+00:00"}, {"id": "18w50a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2594693caaa86414767de59b8fd7674c9b97dc58/18w50a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-12-12T14:58:13+00:00"}, {"id": "18w49a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8c1c91caaddbb133b328e4fdb22e7a3e758b4d94/18w49a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-12-05T12:24:30+00:00"}, {"id": "18w48b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/71b4de2f93861ddbe6ef9deb645aed66afd0f5cc/18w48b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-30T10:37:31+00:00"}, {"id": "18w48a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d3cabeaff421b29cfabd1ed3358b6be1d700357b/18w48a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-29T13:11:38+00:00"}, {"id": "18w47b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7033ba9ea26e84f7383457dfe12519fa943b302e/18w47b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-23T10:46:41+00:00"}, {"id": "18w47a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bc43796e1d44b38495ce7006f4e1b0efdae221fe/18w47a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-21T15:45:22+00:00"}, {"id": "18w46a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/10272603c082dd98192aa05a7e4ee22c6a874b9d/18w46a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-15T13:43:14+00:00"}, {"id": "18w45a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/71db320cff7a34460bb108aaa0666c85ec3fe7de/18w45a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-11-07T14:40:06+00:00"}, {"id": "18w44a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d415d669f31e322f09598464c182b63e9c1ac8c9/18w44a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-10-31T15:29:16+00:00"}, {"id": "18w43c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9fbf22d3bb1adcd6707f5a4d5cabc4f3cb5ca29c/18w43c.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-10-26T08:40:46+00:00"}, {"id": "18w43b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e44e8de646c82a9705bc4098cbe0698bd434bcc5/18w43b.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-10-24T15:02:30+00:00"}, {"id": "18w43a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7e4be17caa10c2ee677e8f30cfa1e65e766df93a/18w43a.json", "time": "2019-08-22T12:46:36+00:00", "releaseTime": "2018-10-24T10:52:16+00:00"}, {"id": "1.13.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/26ec75fc9a8b990fa976100a211475d18bd97de0/1.13.2.json", "time": "2019-06-28T07:06:03+00:00", "releaseTime": "2018-10-22T11:41:07+00:00"}, {"id": "1.13.2-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cb351ca02354abfd0c5280b083b20dac6d9d73ee/1.13.2-pre2.json", "time": "2019-06-28T07:07:16+00:00", "releaseTime": "2018-10-18T14:46:12+00:00"}, {"id": "1.13.2-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/32161e5684d156915330b430af7b77d0bf415896/1.13.2-pre1.json", "time": "2019-06-28T07:07:14+00:00", "releaseTime": "2018-10-16T13:40:58+00:00"}, {"id": "1.13.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/2553b0a630e1d1676d932394866e4f1621a59fad/1.13.1.json", "time": "2019-06-28T07:06:01+00:00", "releaseTime": "2018-08-22T14:03:42+00:00"}, {"id": "1.13.1-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5432798617e434ec9e061b8e9461afc3df98b45f/1.13.1-pre2.json", "time": "2019-06-28T07:07:12+00:00", "releaseTime": "2018-08-20T13:52:09+00:00"}, {"id": "1.13.1-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3f47a3acd1d8775478143385569355a3ec30ea69/1.13.1-pre1.json", "time": "2019-06-28T07:07:11+00:00", "releaseTime": "2018-08-16T13:08:44+00:00"}, {"id": "18w33a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d77ff33b5a07f400ccf7483e60921143948e3412/18w33a.json", "time": "2019-06-28T07:11:06+00:00", "releaseTime": "2018-08-15T14:28:56+00:00"}, {"id": "18w32a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9dc8e10605ab503ae1b5eefbc31e376d2d2d7735/18w32a.json", "time": "2019-06-28T07:11:04+00:00", "releaseTime": "2018-08-08T13:16:57+00:00"}, {"id": "18w31a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b538d9e8bb8a82e96dd02ab00a5962602d0accfe/18w31a.json", "time": "2019-06-28T07:11:02+00:00", "releaseTime": "2018-08-01T12:54:44+00:00"}, {"id": "18w30b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c475ca09f640fdaf7ac7972a8ab1c6be10609052/18w30b.json", "time": "2019-06-28T07:11:00+00:00", "releaseTime": "2018-07-26T16:06:57+00:00"}, {"id": "18w30a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/247f631e4fc91d4e76ff06daa3750228599b6733/18w30a.json", "time": "2019-06-28T07:10:58+00:00", "releaseTime": "2018-07-25T14:29:31+00:00"}, {"id": "1.13", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/1efd5dfcae060b847706500e408a76674922de89/1.13.json", "time": "2019-06-28T07:06:04+00:00", "releaseTime": "2018-07-18T15:11:46+00:00"}, {"id": "1.13-pre10", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7a5c5769e1c420db177040c33a4516515bdc3e55/1.13-pre10.json", "time": "2019-06-28T07:06:50+00:00", "releaseTime": "2018-07-17T14:48:06+00:00"}, {"id": "1.13-pre9", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b54392801613930233d5f96b44662729bf23f7e0/1.13-pre9.json", "time": "2019-06-28T07:07:08+00:00", "releaseTime": "2018-07-16T14:17:42+00:00"}, {"id": "1.13-pre8", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/aa97bdcf593e6ff67b0b044590eae96ac81c5572/1.13-pre8.json", "time": "2019-06-28T07:07:06+00:00", "releaseTime": "2018-07-13T11:45:00+00:00"}, {"id": "1.13-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dec652f76a03e192b7b8de0e093869ca803eb4c8/1.13-pre7.json", "time": "2019-06-28T07:07:04+00:00", "releaseTime": "2018-07-10T14:21:42+00:00"}, {"id": "1.13-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/75e367814db76567ca02da12c80246cd22935111/1.13-pre6.json", "time": "2019-06-28T07:07:02+00:00", "releaseTime": "2018-07-04T12:36:00+00:00"}, {"id": "1.13-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b5f4b7d67e57a2784204af0c744e6bfb02a5f04f/1.13-pre5.json", "time": "2019-06-28T07:06:59+00:00", "releaseTime": "2018-06-28T13:58:53+00:00"}, {"id": "1.13-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/aca7f5d7d13b996eeaf6f186d208769f18bdb04c/1.13-pre4.json", "time": "2019-06-28T07:06:57+00:00", "releaseTime": "2018-06-26T13:00:55+00:00"}, {"id": "1.13-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/06c31253996b4de3188705e3d6c33577d1f9a305/1.13-pre3.json", "time": "2019-06-28T07:06:55+00:00", "releaseTime": "2018-06-21T12:57:11+00:00"}, {"id": "1.13-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/05ba232797b3cf7fa2ac879624a7b5de1d6651bd/1.13-pre2.json", "time": "2019-06-28T07:06:53+00:00", "releaseTime": "2018-06-15T09:20:00+00:00"}, {"id": "1.13-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a4d5660628eba8143c723ff40112006365d02f1d/1.13-pre1.json", "time": "2019-06-28T07:06:48+00:00", "releaseTime": "2018-06-04T15:17:34+00:00"}, {"id": "18w22c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/27a99c8d0f2a998a3fedb180804a16f2bf99b95f/18w22c.json", "time": "2019-06-28T07:10:56+00:00", "releaseTime": "2018-05-31T13:53:15+00:00"}, {"id": "18w22b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0aa1569c658a410cb2f83d1b052635d7e8392683/18w22b.json", "time": "2019-06-28T07:10:54+00:00", "releaseTime": "2018-05-30T13:48:58+00:00"}, {"id": "18w22a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a8d3d3213543f0465d5f465f8c1e80a2957eefa3/18w22a.json", "time": "2019-06-28T07:10:52+00:00", "releaseTime": "2018-05-29T13:23:55+00:00"}, {"id": "18w21b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e898f26c0a93e726836fd16d89df63837e6eee82/18w21b.json", "time": "2019-06-28T07:10:50+00:00", "releaseTime": "2018-05-25T10:09:09+00:00"}, {"id": "18w21a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7cdac8c7c494291a01f151a5dc146f38a70c4a2b/18w21a.json", "time": "2019-06-28T07:10:48+00:00", "releaseTime": "2018-05-23T13:11:49+00:00"}, {"id": "18w20c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a7e08d32440189aa8e10f0abaf7a4fa0c9e8afc1/18w20c.json", "time": "2019-06-28T07:10:46+00:00", "releaseTime": "2018-05-17T14:06:56+00:00"}, {"id": "18w20b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/86e70871ca7a1b6d2ffa33cd8df79357a29dfb5e/18w20b.json", "time": "2019-06-28T07:10:45+00:00", "releaseTime": "2018-05-16T14:35:35+00:00"}, {"id": "18w20a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a64998fc7679c161aa9dd671bec77329dd68e2cc/18w20a.json", "time": "2019-06-28T07:10:43+00:00", "releaseTime": "2018-05-15T14:02:25+00:00"}, {"id": "18w19b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dfdacf219ef2d126416e8c9e3d08feeb244a8a49/18w19b.json", "time": "2019-06-28T07:10:41+00:00", "releaseTime": "2018-05-09T10:00:51+00:00"}, {"id": "18w19a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cc868f094a6cdec8e1a24ed90dde12c8006e308c/18w19a.json", "time": "2019-06-28T07:10:39+00:00", "releaseTime": "2018-05-08T13:05:19+00:00"}, {"id": "18w16a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/97812ee3d6cc39ed5d0eb8193704691480bdf3b1/18w16a.json", "time": "2019-06-28T07:10:37+00:00", "releaseTime": "2018-04-19T14:46:35+00:00"}, {"id": "18w15a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/104ffb10f7e2017e50525ad6def27d43a1351ffb/18w15a.json", "time": "2019-06-28T07:10:35+00:00", "releaseTime": "2018-04-11T14:54:22+00:00"}, {"id": "18w14b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f1663847c676301b39c6165dfee617b65f633eb3/18w14b.json", "time": "2019-06-28T07:10:33+00:00", "releaseTime": "2018-04-05T14:44:02+00:00"}, {"id": "18w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ddb3a3037ebefd9c7921482ce7b71470157b2bae/18w14a.json", "time": "2019-06-28T07:10:32+00:00", "releaseTime": "2018-04-04T14:36:14+00:00"}, {"id": "18w11a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c508c442a75e5f9bc5645fc6b5d81c95ef9cb9d9/18w11a.json", "time": "2019-06-28T07:10:28+00:00", "releaseTime": "2018-03-13T15:10:59+00:00"}, {"id": "18w10d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/298dd4f9927310f91e999833ef96211f7e4642db/18w10d.json", "time": "2019-06-28T07:10:26+00:00", "releaseTime": "2018-03-09T15:19:12+00:00"}, {"id": "18w10c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2777b49ae9c7260f4ef39f9afbab6cdc3b0ee703/18w10c.json", "time": "2019-06-28T07:10:24+00:00", "releaseTime": "2018-03-08T15:29:23+00:00"}, {"id": "18w10b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/351e6670bac10aa5ae50017076a01c1f7f6ffec8/18w10b.json", "time": "2019-06-28T07:10:22+00:00", "releaseTime": "2018-03-07T15:56:01+00:00"}, {"id": "18w10a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9040a647a6496201cf0bc0139664d8eccf153a00/18w10a.json", "time": "2019-06-28T07:10:20+00:00", "releaseTime": "2018-03-06T15:54:24+00:00"}, {"id": "18w09a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2363421af13b87a427a32273f733f628db3bc262/18w09a.json", "time": "2019-06-28T07:10:19+00:00", "releaseTime": "2018-03-01T14:15:10+00:00"}, {"id": "18w08b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d81bdb924f53a6abb940501c5c1ed03966a2853a/18w08b.json", "time": "2019-06-28T07:10:17+00:00", "releaseTime": "2018-02-22T15:44:49+00:00"}, {"id": "18w08a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/57ebf115603deaa30e1e22bf4e13cd4824bca925/18w08a.json", "time": "2019-06-28T07:10:15+00:00", "releaseTime": "2018-02-21T14:59:00+00:00"}, {"id": "18w07c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bfa0e12abbeca98ea31931a8ff9e328bb09d017a/18w07c.json", "time": "2019-06-28T07:10:13+00:00", "releaseTime": "2018-02-16T13:23:32+00:00"}, {"id": "18w07b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/24ff49e1f821ccac495af70d7e8779e013251294/18w07b.json", "time": "2019-06-28T07:10:11+00:00", "releaseTime": "2018-02-15T14:28:42+00:00"}, {"id": "18w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/45d425c0ceb8e451886f6e90ff116f20a90d17d8/18w07a.json", "time": "2019-06-28T07:10:10+00:00", "releaseTime": "2018-02-14T17:34:13+00:00"}, {"id": "18w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/83670eeb3b4579b6f93d4228b7e2bc1f89475d71/18w06a.json", "time": "2019-06-28T07:10:08+00:00", "releaseTime": "2018-02-09T12:09:55+00:00"}, {"id": "18w05a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a9e94f4c88dd7905aa475f04ba3bfc134b70754a/18w05a.json", "time": "2019-06-28T07:10:03+00:00", "releaseTime": "2018-01-31T13:32:09+00:00"}, {"id": "18w03b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ceb0851b72357177d6d817ddda3af082ca80ca3a/18w03b.json", "time": "2019-06-28T07:10:00+00:00", "releaseTime": "2018-01-17T15:09:14+00:00"}, {"id": "18w03a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fd5fb7fae09fac64397224517ab529e3bbfa3e70/18w03a.json", "time": "2019-06-28T07:09:59+00:00", "releaseTime": "2018-01-17T14:25:24+00:00"}, {"id": "18w02a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b0ddd29e3ab04729b1948bb50d9431cce420724d/18w02a.json", "time": "2019-06-28T07:09:57+00:00", "releaseTime": "2018-01-10T11:54:55+00:00"}, {"id": "18w01a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b1f57752ac2e0ead0fdd7434140bf2f5088cff40/18w01a.json", "time": "2019-06-28T07:09:54+00:00", "releaseTime": "2018-01-03T13:29:30+00:00"}, {"id": "17w50a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e116ee9be7f2aa00af3c3c6ff7a95991b550b1b6/17w50a.json", "time": "2019-06-28T07:09:52+00:00", "releaseTime": "2017-12-11T15:28:08+00:00"}, {"id": "17w49b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f8d0a2d9bc6b178c941fb31069196574b4858732/17w49b.json", "time": "2019-06-28T07:09:49+00:00", "releaseTime": "2017-12-07T15:29:54+00:00"}, {"id": "17w49a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6de4e269122102c9cdaa49ce1a65f9b185dcc86b/17w49a.json", "time": "2019-06-28T07:09:47+00:00", "releaseTime": "2017-12-06T14:24:30+00:00"}, {"id": "17w48a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f0cd9d5fef902a57075246580a12413caba68c4b/17w48a.json", "time": "2019-06-28T07:09:45+00:00", "releaseTime": "2017-11-27T15:36:33+00:00"}, {"id": "17w47b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7081b367c5a7d140cdf58fa6788f403968808b19/17w47b.json", "time": "2019-06-28T07:09:43+00:00", "releaseTime": "2017-11-23T15:30:12+00:00"}, {"id": "17w47a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/602e8ef598d492f707621954685e029434f27ede/17w47a.json", "time": "2019-06-28T07:09:41+00:00", "releaseTime": "2017-11-22T12:40:05+00:00"}, {"id": "17w46a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5b07e94d1276496e661c99d117b8dc5df4f6d099/17w46a.json", "time": "2019-06-28T07:09:39+00:00", "releaseTime": "2017-11-15T15:21:55+00:00"}, {"id": "17w45b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f9acb09376005f47f647ebb8bc687e5ba9e515ec/17w45b.json", "time": "2019-06-28T07:09:37+00:00", "releaseTime": "2017-11-10T10:07:02+00:00"}, {"id": "17w45a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c3a0cc0ba68d054095dc52010b7b71a35b9ab17f/17w45a.json", "time": "2019-06-28T07:09:35+00:00", "releaseTime": "2017-11-08T15:48:00+00:00"}, {"id": "17w43b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5ee9c314fc10b6501711802802818c0d75d6c4e7/17w43b.json", "time": "2019-06-28T07:09:32+00:00", "releaseTime": "2017-10-26T13:36:22+00:00"}, {"id": "17w43a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e83e27bd416cc5abed43f86e01579fdeb1801ea5/17w43a.json", "time": "2019-06-28T07:09:31+00:00", "releaseTime": "2017-10-25T14:43:50+00:00"}, {"id": "1.12.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/6e69e85d0f85f4f4b9e12dd99d102092a6e15918/1.12.2.json", "time": "2019-06-28T07:05:57+00:00", "releaseTime": "2017-09-18T08:39:46+00:00"}, {"id": "1.12.2-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b3f6aa5c952b9ff8c39046b3fb7fe3b712a9909a/1.12.2-pre2.json", "time": "2019-06-28T07:06:46+00:00", "releaseTime": "2017-09-15T08:21:17+00:00"}, {"id": "1.12.2-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ce18ba69f4d0a7947d182b47d7a3bd499d24a1e2/1.12.2-pre1.json", "time": "2019-06-28T07:06:44+00:00", "releaseTime": "2017-09-13T13:33:31+00:00"}, {"id": "1.12.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/24b28f562e354309697a1c9d835dea55a185df1e/1.12.1.json", "time": "2019-06-28T07:05:56+00:00", "releaseTime": "2017-08-03T12:40:39+00:00"}, {"id": "1.12.1-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fb7202af7c5d5efd6f81e5db6aa8de04e049bc08/1.12.1-pre1.json", "time": "2019-06-28T07:06:43+00:00", "releaseTime": "2017-08-02T10:53:55+00:00"}, {"id": "17w31a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ed63bb5facba58bfeed785149e05dd33910135fc/17w31a.json", "time": "2019-06-28T07:09:29+00:00", "releaseTime": "2017-08-01T09:41:23+00:00"}, {"id": "1.12", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/367843437acbae63de3084dd6afd3dd8bd2a7479/1.12.json", "time": "2019-06-28T07:05:59+00:00", "releaseTime": "2017-06-02T13:50:27+00:00"}, {"id": "1.12-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d734d4070653b2c0e8e6a5abed905d78982203f7/1.12-pre7.json", "time": "2019-06-28T07:06:42+00:00", "releaseTime": "2017-05-31T10:56:41+00:00"}, {"id": "1.12-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3fa2c3b5ff806ce0acbffd8db0895525ed253e32/1.12-pre6.json", "time": "2019-06-28T07:06:40+00:00", "releaseTime": "2017-05-29T11:45:12+00:00"}, {"id": "1.12-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2069bb4938682be97f248baa73d970d37b61d540/1.12-pre5.json", "time": "2019-06-28T07:06:38+00:00", "releaseTime": "2017-05-19T07:43:28+00:00"}, {"id": "1.12-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9fc87076b48db5717efe92183a44049b90eae915/1.12-pre4.json", "time": "2019-06-28T07:06:37+00:00", "releaseTime": "2017-05-18T12:28:16+00:00"}, {"id": "1.12-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a2dc7f1792b986f3b1456630e0a76b9cfb37acc6/1.12-pre3.json", "time": "2019-06-28T07:06:35+00:00", "releaseTime": "2017-05-17T14:09:18+00:00"}, {"id": "1.12-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a472bb7234be82c489f5c7fca03724298a95585b/1.12-pre2.json", "time": "2019-06-28T07:06:33+00:00", "releaseTime": "2017-05-11T12:11:12+00:00"}, {"id": "1.12-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/51695897d818f3414ce5dbea33dea58682c6dc44/1.12-pre1.json", "time": "2019-06-28T07:06:32+00:00", "releaseTime": "2017-05-10T11:37:17+00:00"}, {"id": "17w18b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/03c7dbe028a8a62862d4fec5951343ff0f5012b5/17w18b.json", "time": "2019-06-28T07:09:27+00:00", "releaseTime": "2017-05-04T13:40:22+00:00"}, {"id": "17w18a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/03ca07f26b8336732e720ecd13e912e19f0d3a77/17w18a.json", "time": "2019-06-28T07:09:26+00:00", "releaseTime": "2017-05-03T14:50:23+00:00"}, {"id": "17w17b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f8751aa4fcb4f2aa0955c3fae1d4cd9a12c89979/17w17b.json", "time": "2019-06-28T07:09:24+00:00", "releaseTime": "2017-04-27T13:24:23+00:00"}, {"id": "17w17a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b2ffee6fc34b1f2cba708c544492ea939d6773fc/17w17a.json", "time": "2019-06-28T07:09:22+00:00", "releaseTime": "2017-04-26T13:48:23+00:00"}, {"id": "17w16b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/635a0c0f77e2bf6157c41e25647dfe65cc1b18f4/17w16b.json", "time": "2019-06-28T07:09:21+00:00", "releaseTime": "2017-04-21T12:02:59+00:00"}, {"id": "17w16a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4baeef9effd9d3eacdb6bef1a974f20be394278b/17w16a.json", "time": "2019-06-28T07:09:19+00:00", "releaseTime": "2017-04-20T13:58:35+00:00"}, {"id": "17w15a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b629aee8a9e4bb4711ee5583aa512d4eaaf73e2e/17w15a.json", "time": "2019-06-28T07:09:17+00:00", "releaseTime": "2017-04-12T09:30:50+00:00"}, {"id": "17w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/51f1acd9b0e5f8dff45dc80b4d73eb8e8317e733/17w14a.json", "time": "2019-06-28T07:09:15+00:00", "releaseTime": "2017-04-05T13:58:01+00:00"}, {"id": "17w13b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4b1a19a71cd90167e7464da777fc6d4bd93c8f6c/17w13b.json", "time": "2019-06-28T07:09:14+00:00", "releaseTime": "2017-03-31T11:06:35+00:00"}, {"id": "17w13a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ec0d9ff2917f223b24725b259d7aea1249f4a07c/17w13a.json", "time": "2019-06-28T07:09:12+00:00", "releaseTime": "2017-03-30T09:32:19+00:00"}, {"id": "17w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/17070716831f1f55a42c2f218fd5d7f56c3407fc/17w06a.json", "time": "2019-06-28T07:09:10+00:00", "releaseTime": "2017-02-08T13:16:29+00:00"}, {"id": "1.11.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/6bd228727ed48bd7ac7bdc0088587dad0fb7c02b/1.11.2.json", "time": "2019-06-28T07:05:53+00:00", "releaseTime": "2016-12-21T09:29:12+00:00"}, {"id": "1.11.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/363096f6590653e170bcfd56c085c6a77578ba42/1.11.1.json", "time": "2019-06-28T07:05:52+00:00", "releaseTime": "2016-12-20T14:05:34+00:00"}, {"id": "16w50a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/34b08beba7d9711dff07484e17daf9cd9681c770/16w50a.json", "time": "2019-06-28T07:09:08+00:00", "releaseTime": "2016-12-15T14:38:52+00:00"}, {"id": "1.11", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/340d2e0f200af20b1e4d5da501facc7fc1cfb0e5/1.11.json", "time": "2019-06-28T07:05:55+00:00", "releaseTime": "2016-11-14T14:34:40+00:00"}, {"id": "1.11-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fde7baf263756f1bfc20ba51a5b9bc6333b23bd0/1.11-pre1.json", "time": "2019-06-28T07:06:30+00:00", "releaseTime": "2016-11-08T13:42:50+00:00"}, {"id": "16w44a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/85cdd8a8918be3975d4edb1176cfa9971fd2681d/16w44a.json", "time": "2019-06-28T07:09:06+00:00", "releaseTime": "2016-11-03T14:17:11+00:00"}, {"id": "16w43a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5ddba06d364f30cc871465a25f7325e520a0e544/16w43a.json", "time": "2019-06-28T07:09:04+00:00", "releaseTime": "2016-10-27T09:00:51+00:00"}, {"id": "16w42a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6ffff59eb02a4fef3c6aee893136858606832183/16w42a.json", "time": "2019-06-28T07:09:03+00:00", "releaseTime": "2016-10-19T11:17:47+00:00"}, {"id": "16w41a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7d4ece5f41496402d25258e5725b88cb6190284c/16w41a.json", "time": "2019-06-28T07:09:01+00:00", "releaseTime": "2016-10-13T14:28:35+00:00"}, {"id": "16w40a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/53c8af9aa235a12b623fc6be9e02c4aafc1df3ad/16w40a.json", "time": "2019-06-28T07:08:59+00:00", "releaseTime": "2016-10-06T13:57:59+00:00"}, {"id": "16w39c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e811be4a812aa532b0bbab31d4b22b3b9f7dee70/16w39c.json", "time": "2019-06-28T07:08:58+00:00", "releaseTime": "2016-09-30T14:11:48+00:00"}, {"id": "16w39b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6ee9f1afbc2fdf74e5c07cfb7298cb84755c6cfd/16w39b.json", "time": "2019-06-28T07:08:56+00:00", "releaseTime": "2016-09-29T14:39:39+00:00"}, {"id": "16w39a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bac2bd719657ff8524cf97b1913e5a56bb150ac8/16w39a.json", "time": "2019-06-28T07:08:54+00:00", "releaseTime": "2016-09-28T13:32:06+00:00"}, {"id": "16w38a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fbd5d83a14b4d6e8f7029d3c08dd6985d09c4f40/16w38a.json", "time": "2019-06-28T07:08:53+00:00", "releaseTime": "2016-09-20T12:40:49+00:00"}, {"id": "16w36a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9d775a6488e53e42267585dd5924178c3f601d7d/16w36a.json", "time": "2019-06-28T07:08:51+00:00", "releaseTime": "2016-09-08T14:55:10+00:00"}, {"id": "16w35a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e64f1a32444286fc5fcd65dca20709ce5963d066/16w35a.json", "time": "2019-06-28T07:08:49+00:00", "releaseTime": "2016-09-01T13:13:38+00:00"}, {"id": "16w33a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3065c85819ff5854f991c5e4bfde2b6d8832d981/16w33a.json", "time": "2019-06-28T07:08:48+00:00", "releaseTime": "2016-08-17T12:48:57+00:00"}, {"id": "16w32b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a672dd946075b43da267bcd73d3953f09845767c/16w32b.json", "time": "2019-06-28T07:08:46+00:00", "releaseTime": "2016-08-11T14:34:29+00:00"}, {"id": "16w32a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/78178d605ec7bb141b91b4eed36adb9ffdf82527/16w32a.json", "time": "2019-06-28T07:08:44+00:00", "releaseTime": "2016-08-10T12:30:10+00:00"}, {"id": "1.10.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/9e23991d61e9b4eb9dfee56cb8ee7392fb925aff/1.10.2.json", "time": "2019-06-28T07:05:49+00:00", "releaseTime": "2016-06-23T09:17:32+00:00"}, {"id": "1.10.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/ee31c565a9aa614676b786c55a0be77268743b60/1.10.1.json", "time": "2019-06-28T07:05:48+00:00", "releaseTime": "2016-06-22T10:13:22+00:00"}, {"id": "1.10", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/0590cc1c11f1be246af9d972f919693bf6b0d1f6/1.10.json", "time": "2019-06-28T07:05:51+00:00", "releaseTime": "2016-06-08T13:06:18+00:00"}, {"id": "1.10-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bd196d2494f334adcefd78089b0d371a22bee56b/1.10-pre2.json", "time": "2019-06-28T07:06:28+00:00", "releaseTime": "2016-06-07T14:56:34+00:00"}, {"id": "1.10-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/08a9c29b2cd4df7c9ad51ab0be5f9683c20d4c3f/1.10-pre1.json", "time": "2019-06-28T07:06:27+00:00", "releaseTime": "2016-06-02T14:45:16+00:00"}, {"id": "16w21b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c9e280d280279b0cb1b4906d33fdab47524dd719/16w21b.json", "time": "2019-06-28T07:08:43+00:00", "releaseTime": "2016-05-26T12:47:22+00:00"}, {"id": "16w21a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ccdf81a69335bc84fae0ae69663ae82f9e277a0d/16w21a.json", "time": "2019-06-28T07:08:41+00:00", "releaseTime": "2016-05-25T13:12:09+00:00"}, {"id": "16w20a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a1958213b24176f0cd6698929ae965caec5eb53f/16w20a.json", "time": "2019-06-28T07:08:40+00:00", "releaseTime": "2016-05-18T12:45:14+00:00"}, {"id": "1.9.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/7f40b382dedcfe9eca74a5b14d615075ec34c108/1.9.4.json", "time": "2019-06-28T07:06:24+00:00", "releaseTime": "2016-05-10T10:17:16+00:00"}, {"id": "1.9.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/e8bab05ecee645e3c9b962f532ca7fd6c52e120e/1.9.3.json", "time": "2019-06-28T07:06:23+00:00", "releaseTime": "2016-05-10T08:33:35+00:00"}, {"id": "1.9.3-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/84e5b1bf3974e0ef38f9badce9db14d68419a57e/1.9.3-pre3.json", "time": "2019-06-28T07:08:04+00:00", "releaseTime": "2016-05-03T09:28:11+00:00"}, {"id": "1.9.3-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e1a60758446450cd5631d5191216b00b1e87a633/1.9.3-pre2.json", "time": "2019-06-28T07:08:03+00:00", "releaseTime": "2016-04-27T13:33:20+00:00"}, {"id": "1.9.3-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9f5e4882ac87d6e479f60e62705f0b6bd3f96d47/1.9.3-pre1.json", "time": "2019-06-28T07:08:01+00:00", "releaseTime": "2016-04-21T12:41:42+00:00"}, {"id": "16w15b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/eb2ded7b829a5938af1f83587c4c63d27a953024/16w15b.json", "time": "2019-06-28T07:08:38+00:00", "releaseTime": "2016-04-13T13:56:41+00:00"}, {"id": "16w15a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/93791968f6648db8039e972d13dfc405b1516f8d/16w15a.json", "time": "2019-06-28T07:08:37+00:00", "releaseTime": "2016-04-11T14:38:28+00:00"}, {"id": "16w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c62d4d7fd9df479b0f5084e2c833a22474b25c23/16w14a.json", "time": "2019-06-28T07:08:35+00:00", "releaseTime": "2016-04-07T12:47:51+00:00"}, {"id": "1.RV-Pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3c1973d91e234fa30eb12be0dce7587b0b3c75bd/1.RV-Pre1.json", "time": "2019-06-28T07:08:06+00:00", "releaseTime": "2016-03-31T16:18:53+00:00"}, {"id": "1.9.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/3cc8cee91366290508c8767e8826c6352c2b89c5/1.9.2.json", "time": "2019-06-28T07:06:22+00:00", "releaseTime": "2016-03-30T15:23:55+00:00"}, {"id": "1.9.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/a7c5c055718d8e7d709f3f2338b4e8f1125b5aae/1.9.1.json", "time": "2019-06-28T07:06:20+00:00", "releaseTime": "2016-03-30T13:43:07+00:00"}, {"id": "1.9.1-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2c5e8a1d144de3c9b2e3c543675313ac821d967b/1.9.1-pre3.json", "time": "2019-06-28T07:08:00+00:00", "releaseTime": "2016-03-11T09:20:36+00:00"}, {"id": "1.9.1-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cb1f20ffabf06b466406a93041ce10c4f7d7b1de/1.9.1-pre2.json", "time": "2019-06-28T07:07:58+00:00", "releaseTime": "2016-03-10T15:06:03+00:00"}, {"id": "1.9.1-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/440cb683d6c525e5c2201e2be89d75451c30c426/1.9.1-pre1.json", "time": "2019-06-28T07:07:57+00:00", "releaseTime": "2016-03-09T16:27:29+00:00"}, {"id": "1.9", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/fab85b386a3de3009e5944b0183ce063faa09691/1.9.json", "time": "2019-06-28T07:06:25+00:00", "releaseTime": "2016-02-29T13:49:54+00:00"}, {"id": "1.9-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6a64da9184804a50d0b3fd9d71725c5e38862f8d/1.9-pre4.json", "time": "2019-06-28T07:07:56+00:00", "releaseTime": "2016-02-26T15:21:11+00:00"}, {"id": "1.9-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2afcc13afbad403ade52d562b5737dc7c40d357f/1.9-pre3.json", "time": "2019-06-28T07:07:55+00:00", "releaseTime": "2016-02-24T15:52:36+00:00"}, {"id": "1.9-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/479af80b2ad5442eedf5bfb3b1b16cb219ba0a1f/1.9-pre2.json", "time": "2019-06-28T07:07:53+00:00", "releaseTime": "2016-02-18T17:41:00+00:00"}, {"id": "1.9-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7c1e51a0fd773629192004941858d7e39b130166/1.9-pre1.json", "time": "2019-06-28T07:07:52+00:00", "releaseTime": "2016-02-17T15:23:19+00:00"}, {"id": "16w07b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7a90eb9033a0174be4133da67a3bb8ff4520467c/16w07b.json", "time": "2019-06-28T07:08:34+00:00", "releaseTime": "2016-02-16T15:22:39+00:00"}, {"id": "16w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/002431778380004494d981d4449e9d02f9ed73de/16w07a.json", "time": "2019-06-28T07:08:32+00:00", "releaseTime": "2016-02-15T15:48:46+00:00"}, {"id": "16w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f90799db6ea46ee93a3abade178475864c30427b/16w06a.json", "time": "2019-06-28T07:08:31+00:00", "releaseTime": "2016-02-10T15:06:41+00:00"}, {"id": "16w05b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f2d853e1e3d55de9f220e923eee762de5ff4cf42/16w05b.json", "time": "2019-06-28T07:08:29+00:00", "releaseTime": "2016-02-04T15:28:02+00:00"}, {"id": "16w05a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/119bce41454a1d3ade4fbab1894540cff4ed1380/16w05a.json", "time": "2019-06-28T07:08:27+00:00", "releaseTime": "2016-02-03T15:48:38+00:00"}, {"id": "16w04a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dbe7c4755088d3cea55c40b207915e601ed573dc/16w04a.json", "time": "2019-06-28T09:31:11+00:00", "releaseTime": "2016-01-28T15:37:24+00:00"}, {"id": "16w03a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0c68af2406f0ee25b93305e28dcb3978275a23ca/16w03a.json", "time": "2019-06-28T09:31:10+00:00", "releaseTime": "2016-01-20T14:29:24+00:00"}, {"id": "16w02a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2f6007d145fb6dc0406bedc21e1d5345c84cd5d7/16w02a.json", "time": "2019-06-28T09:31:09+00:00", "releaseTime": "2016-01-13T15:15:16+00:00"}, {"id": "15w51b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3fe2e181cbe3daa24a3f824a547fa241268686b2/15w51b.json", "time": "2019-06-28T09:31:05+00:00", "releaseTime": "2015-12-17T15:30:41+00:00"}, {"id": "15w51a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7070c87a526910524cbec04c3e0b76759a0208f3/15w51a.json", "time": "2019-06-28T09:31:04+00:00", "releaseTime": "2015-12-17T14:02:37+00:00"}, {"id": "15w50a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/89807df9342360d793089116e8c226223059c4c1/15w50a.json", "time": "2019-06-28T09:31:02+00:00", "releaseTime": "2015-12-09T15:35:57+00:00"}, {"id": "15w49b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7b707a788fbee737fdf209b03af308c940a38ba6/15w49b.json", "time": "2019-06-28T09:31:01+00:00", "releaseTime": "2015-12-03T15:23:22+00:00"}, {"id": "1.8.9", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/856d9bec08b0d567de39f46efaf4b76066b53059/1.8.9.json", "time": "2019-06-28T09:30:03+00:00", "releaseTime": "2015-12-03T09:24:39+00:00"}, {"id": "15w49a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4ccaa5b6ce63f7863d8535e85069581c0f04c3ab/15w49a.json", "time": "2019-06-28T09:31:00+00:00", "releaseTime": "2015-12-02T15:09:37+00:00"}, {"id": "15w47c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9d3d456943c1c9c0dd3662e3f99dea1ce0bbeb57/15w47c.json", "time": "2019-06-28T09:30:58+00:00", "releaseTime": "2015-11-20T12:46:56+00:00"}, {"id": "15w47b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c52201eca7acd017743fb9b9a66700c729c8fe78/15w47b.json", "time": "2019-06-28T09:30:57+00:00", "releaseTime": "2015-11-19T14:48:03+00:00"}, {"id": "15w47a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/704b41ca962e73deeaea78d3c6fc07f01e7f02c8/15w47a.json", "time": "2019-06-28T09:30:53+00:00", "releaseTime": "2015-11-18T15:53:41+00:00"}, {"id": "15w46a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ed28a3f252a40cd4dfa3a84f9c7a1aab5f79493b/15w46a.json", "time": "2019-06-28T09:30:52+00:00", "releaseTime": "2015-11-12T12:11:47+00:00"}, {"id": "15w45a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/15829ef167c98687ca0c4c7d140225efe2769bed/15w45a.json", "time": "2019-06-28T09:30:51+00:00", "releaseTime": "2015-11-05T13:04:07+00:00"}, {"id": "15w44b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a2d3fd6e371e1a789f432227328f6967c5b6bc7e/15w44b.json", "time": "2019-06-28T09:30:50+00:00", "releaseTime": "2015-10-30T11:23:17+00:00"}, {"id": "15w44a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/57a72f59f661a1b00d6c152f3663fc4af35714ed/15w44a.json", "time": "2019-06-28T09:30:48+00:00", "releaseTime": "2015-10-28T15:09:36+00:00"}, {"id": "15w43c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/57b03175602261e9f2787cd513e05fe6ee0c8b6d/15w43c.json", "time": "2019-06-28T09:30:47+00:00", "releaseTime": "2015-10-23T15:35:55+00:00"}, {"id": "15w43b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cf68e682555c704dec3796db1b2ae7f6f84b31ed/15w43b.json", "time": "2019-06-28T09:30:46+00:00", "releaseTime": "2015-10-22T14:11:58+00:00"}, {"id": "15w43a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/06fddff71f0c2590cbee9b179b076e4c2516c72a/15w43a.json", "time": "2019-06-28T09:30:45+00:00", "releaseTime": "2015-10-21T15:28:52+00:00"}, {"id": "15w42a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/544aa5c98d30017dd12769feed0f6ac411cb120e/15w42a.json", "time": "2019-06-28T09:30:43+00:00", "releaseTime": "2015-10-14T13:25:14+00:00"}, {"id": "15w41b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1e77da8ae623253dceb946a831499821b9ff3469/15w41b.json", "time": "2019-06-28T09:30:42+00:00", "releaseTime": "2015-10-07T14:07:26+00:00"}, {"id": "15w41a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1667759ebf20581022f06b926976f8a0906950b4/15w41a.json", "time": "2019-06-28T09:30:41+00:00", "releaseTime": "2015-10-07T13:19:53+00:00"}, {"id": "15w40b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/722edb06697f9552919310222e6e384885a122d2/15w40b.json", "time": "2019-06-28T09:30:40+00:00", "releaseTime": "2015-09-30T14:13:54+00:00"}, {"id": "15w40a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/979332ff22b5883583db3427feb76da226d9c510/15w40a.json", "time": "2019-06-28T09:30:38+00:00", "releaseTime": "2015-09-30T13:13:54+00:00"}, {"id": "15w39c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9c6872f8758ca25a5c7d4378700d2cbf7b9e88f7/15w39c.json", "time": "2019-06-28T09:30:37+00:00", "releaseTime": "2015-09-23T13:13:54+00:00"}, {"id": "15w39b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5a78fbe82c699c64438d34fbb1fecdff07a20e74/15w39b.json", "time": "2019-06-28T07:08:20+00:00", "releaseTime": "2015-09-21T15:09:52+00:00"}, {"id": "15w39a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/75423b4d58f4247fba33e71822b970e5c2c0d841/15w39a.json", "time": "2019-06-28T07:08:20+00:00", "releaseTime": "2015-09-21T13:16:32+00:00"}, {"id": "15w38b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5324ca4063759d9d44557d8514db4ff36823ea68/15w38b.json", "time": "2019-06-28T09:30:36+00:00", "releaseTime": "2015-09-17T14:22:31+00:00"}, {"id": "15w38a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f6ca23e9ea8a6ba939eba48c9c38bbffdb3c2bd8/15w38a.json", "time": "2019-06-28T09:30:35+00:00", "releaseTime": "2015-09-16T14:22:31+00:00"}, {"id": "15w37a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e94380c8f89d89e5ec3ef0a087af5907c67a3a97/15w37a.json", "time": "2019-06-28T09:30:34+00:00", "releaseTime": "2015-09-10T14:22:31+00:00"}, {"id": "15w36d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/70730c79f021c92eea9c099f1cabb908ce7a2016/15w36d.json", "time": "2019-06-28T09:30:32+00:00", "releaseTime": "2015-09-04T14:22:31+00:00"}, {"id": "15w36c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8ab2e79205adf5e84857eec0ccc9e24612f34db2/15w36c.json", "time": "2019-06-28T09:30:31+00:00", "releaseTime": "2015-09-02T16:07:22+00:00"}, {"id": "15w36b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/834c0125a54c72543a5956f8f84a132983c51a01/15w36b.json", "time": "2019-06-28T09:30:30+00:00", "releaseTime": "2015-09-02T15:36:25+00:00"}, {"id": "15w36a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/851de2edecdd714d0deaeb6138a8aca5da02575f/15w36a.json", "time": "2019-06-28T09:30:29+00:00", "releaseTime": "2015-09-02T14:46:40+00:00"}, {"id": "15w35e", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e5fde3e58e56bd04ddda7bee585d7034a3a0e43f/15w35e.json", "time": "2019-06-28T09:30:28+00:00", "releaseTime": "2015-08-28T18:14:02+00:00"}, {"id": "15w35d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/408cbdd6dba59c8826ac7e960461f62bf89e0f93/15w35d.json", "time": "2019-06-28T09:30:27+00:00", "releaseTime": "2015-08-28T16:25:35+00:00"}, {"id": "15w35c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8ae6715d0a632afaf4322125887a935d2414b2c3/15w35c.json", "time": "2019-06-28T09:30:25+00:00", "releaseTime": "2015-08-28T11:21:00+00:00"}, {"id": "15w35b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7f4f70d63fb85b02aa6512382c7815923ad0151f/15w35b.json", "time": "2019-06-28T09:30:24+00:00", "releaseTime": "2015-08-24T15:39:18+00:00"}, {"id": "15w35a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4ab25b24d191d46add8c53bb8714c5fd113bd2e6/15w35a.json", "time": "2019-06-28T09:30:23+00:00", "releaseTime": "2015-08-24T14:19:31+00:00"}, {"id": "15w34d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/eb6f497f5c40fe804fe859b62edae4f8a0b18cb8/15w34d.json", "time": "2019-06-28T09:30:22+00:00", "releaseTime": "2015-08-21T15:27:55+00:00"}, {"id": "15w34c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/85b06fb6e7527063bf76adc7bad1f2644affc166/15w34c.json", "time": "2019-06-28T09:30:21+00:00", "releaseTime": "2015-08-21T12:45:20+00:00"}, {"id": "15w34b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/08021851a9711f2665d7dce0fe0cbf7528bf482d/15w34b.json", "time": "2019-06-28T09:30:19+00:00", "releaseTime": "2015-08-20T14:00:03+00:00"}, {"id": "15w34a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/71b1b3cc02415227a5600d97c84eb211b741a49f/15w34a.json", "time": "2019-06-28T09:30:18+00:00", "releaseTime": "2015-08-19T12:56:01+00:00"}, {"id": "15w33c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2b27de469db8b259764d97fb7570f668a1cc7606/15w33c.json", "time": "2019-06-28T09:30:17+00:00", "releaseTime": "2015-08-14T13:10:46+00:00"}, {"id": "15w33b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a06b1d00ba90e10c3aa83bdfd9469cefffde8ba7/15w33b.json", "time": "2019-06-28T09:30:16+00:00", "releaseTime": "2015-08-12T15:29:11+00:00"}, {"id": "15w33a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a31c9b43de60bdc2410d63716f522b2242843b38/15w33a.json", "time": "2019-06-28T07:08:18+00:00", "releaseTime": "2015-08-12T14:05:07+00:00"}, {"id": "15w32c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/79372029c5f7164c4106b3445c6a72fd89b91641/15w32c.json", "time": "2019-06-28T09:30:15+00:00", "releaseTime": "2015-08-07T14:08:17+00:00"}, {"id": "15w32b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7b39a2921fd7f29cc0cead1045adc1d08f55d7fb/15w32b.json", "time": "2019-06-28T09:30:14+00:00", "releaseTime": "2015-08-06T13:51:47+00:00"}, {"id": "15w32a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c04d45676b3c64735e07f485207530359fd208f2/15w32a.json", "time": "2019-06-28T09:30:12+00:00", "releaseTime": "2015-08-05T12:22:42+00:00"}, {"id": "15w31c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/c617cf4d2350d0936b0cd532e204d4c0db9a8695/15w31c.json", "time": "2019-06-28T09:30:11+00:00", "releaseTime": "2015-07-31T13:45:08+00:00"}, {"id": "15w31b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/705e90b4e738b47cf768926cd1f54ed56e6562d2/15w31b.json", "time": "2019-06-28T09:30:10+00:00", "releaseTime": "2015-07-30T13:38:32+00:00"}, {"id": "15w31a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bd5a158581e6ceec4c34b32774153661b63913e3/15w31a.json", "time": "2019-06-28T09:30:08+00:00", "releaseTime": "2015-07-29T13:24:33+00:00"}, {"id": "1.8.8", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/389ee2576f1c7ac6efe0edcec79f2e465d2a5278/1.8.8.json", "time": "2019-06-28T09:30:02+00:00", "releaseTime": "2015-07-27T10:31:28+00:00"}, {"id": "1.8.7", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/87c78678d155ff55fc91fc64a7a84f2daf855f1e/1.8.7.json", "time": "2019-06-28T09:30:00+00:00", "releaseTime": "2015-06-05T10:10:44+00:00"}, {"id": "1.8.6", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/13b52ffde81121125d69aec94589abfba7e04147/1.8.6.json", "time": "2019-06-28T09:29:59+00:00", "releaseTime": "2015-05-25T10:31:19+00:00"}, {"id": "1.8.5", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/ced2d59fde6e68ca9e84bbb00e5c7dc9c052df06/1.8.5.json", "time": "2019-06-28T09:29:58+00:00", "releaseTime": "2015-05-22T11:15:28+00:00"}, {"id": "1.8.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/bf6b4b4bef435804faacc6fb8d350119a7482262/1.8.4.json", "time": "2019-06-28T09:29:57+00:00", "releaseTime": "2015-04-17T11:37:50+00:00"}, {"id": "15w14a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/18fff5c4aaa556b97a66d6651cbf6a3484ac97e4/15w14a.json", "time": "2019-06-28T07:08:17+00:00", "releaseTime": "2015-04-01T07:08:00+00:00"}, {"id": "1.8.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/94f0e372077d0fe6cfeaad990b2c25ba67b3531c/1.8.3.json", "time": "2019-06-28T09:29:56+00:00", "releaseTime": "2015-02-20T14:00:09+00:00"}, {"id": "1.8.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/05655de45c43872c48eea1e07ae9740bc4cdf47e/1.8.2.json", "time": "2019-06-28T09:29:54+00:00", "releaseTime": "2015-02-19T15:47:29+00:00"}, {"id": "1.8.2-pre7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/15e11b9224f6eebee835685523ce209cf16bf7e8/1.8.2-pre7.json", "time": "2019-06-28T07:07:50+00:00", "releaseTime": "2015-02-16T13:01:35+00:00"}, {"id": "1.8.2-pre6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f8568849a5cf9aae4693f72704ca43e438057b85/1.8.2-pre6.json", "time": "2019-06-28T07:07:50+00:00", "releaseTime": "2015-01-30T11:58:24+00:00"}, {"id": "1.8.2-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f507249b1e38774fe1acb4f923190a4466fd7200/1.8.2-pre5.json", "time": "2019-06-28T07:07:50+00:00", "releaseTime": "2015-01-26T15:03:24+00:00"}, {"id": "1.8.2-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cbad80725e00af8857ddfbf15bd160099b630e07/1.8.2-pre4.json", "time": "2019-06-28T07:07:50+00:00", "releaseTime": "2015-01-16T14:19:59+00:00"}, {"id": "1.8.2-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6c40eb3030a4c327c03d0ac50b13199cfef69051/1.8.2-pre3.json", "time": "2019-06-28T07:07:50+00:00", "releaseTime": "2015-01-15T16:44:33+00:00"}, {"id": "1.8.2-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/544bba3b67c7b08a3445432b7071393b9c8ed86a/1.8.2-pre2.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2015-01-15T15:07:31+00:00"}, {"id": "1.8.2-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ac9ed8bd2a93295eb15caba10af6b92e6cec2eb7/1.8.2-pre1.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-12-18T11:29:41+00:00"}, {"id": "1.8.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/cc3bf2b602bcb4d55b4581ea9bb55c4e4b2d9bc9/1.8.1.json", "time": "2019-06-28T09:29:53+00:00", "releaseTime": "2014-11-24T14:13:31+00:00"}, {"id": "1.8.1-pre5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6988d729f5e1013395e6d04c903d2b224491da21/1.8.1-pre5.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-11-19T14:30:48+00:00"}, {"id": "1.8.1-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/384982851d1ba287a6e8f57a23d980bc21989101/1.8.1-pre4.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-11-06T14:10:50+00:00"}, {"id": "1.8.1-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a2f10c2bb65925c9fccf2395608dcc3b393e76a7/1.8.1-pre3.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-10-23T12:59:42+00:00"}, {"id": "1.8.1-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5799aa67b9a0e18abb9c9705babfd291a43c0b07/1.8.1-pre2.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-10-16T14:19:27+00:00"}, {"id": "1.8.1-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8689f4a30cec09a4339f06a4c8100b81d407cad2/1.8.1-pre1.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-10-15T13:25:11+00:00"}, {"id": "1.8", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/c6309181ce8df8a06ed556e315cd4636c4082b9a/1.8.json", "time": "2019-06-28T09:30:05+00:00", "releaseTime": "2014-09-02T08:24:35+00:00"}, {"id": "1.8-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3b5e366a0f265c4dce1354ba76e1a53dae1f1c1a/1.8-pre3.json", "time": "2019-06-28T07:07:49+00:00", "releaseTime": "2014-08-28T09:40:54+00:00"}, {"id": "1.8-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8a41c8e0f33834284ecc64c042dfe03a5ad5998d/1.8-pre2.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-08-25T14:52:18+00:00"}, {"id": "1.8-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b33940927ffd7f5112af8e90a8e726a57a542ccb/1.8-pre1.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-08-21T13:56:26+00:00"}, {"id": "14w34d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2a8b971cbe57230242c7a6f7f9da8796f95400d4/14w34d.json", "time": "2019-06-28T07:08:17+00:00", "releaseTime": "2014-08-20T12:46:59+00:00"}, {"id": "14w34c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/73382e160ea059e990f6af8dc068c155506e0bad/14w34c.json", "time": "2019-06-28T07:08:17+00:00", "releaseTime": "2014-08-19T15:31:24+00:00"}, {"id": "14w34b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9d27f8e4593e28316ea458bf66cf666bc78d44b3/14w34b.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-18T15:14:28+00:00"}, {"id": "14w34a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/91086b10591fc00bd66b9eb62b49d40a6ef19e4b/14w34a.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-18T14:14:11+00:00"}, {"id": "14w33c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f578b2cfcc8c7e03f185f51135c533e780f7fee0/14w33c.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-15T18:00:26+00:00"}, {"id": "14w33b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/cc33663d42af1a69adc7fa934b34e11cafabaac4/14w33b.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-15T16:23:51+00:00"}, {"id": "14w33a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d428ae184b2362dbd4a822a6955f98162040c523/14w33a.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-13T15:08:14+00:00"}, {"id": "14w32d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8d49aa8007af2738aa0d14ce4f248622f4cc2ebe/14w32d.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-08T15:13:41+00:00"}, {"id": "14w32c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/28096d1beba37533f16bc08ad80f9a5ccceca791/14w32c.json", "time": "2019-06-28T07:08:16+00:00", "releaseTime": "2014-08-08T14:11:20+00:00"}, {"id": "14w32b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9010ff6f3dc5e1fce9dc071438a24baeb93491d6/14w32b.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-08-07T14:45:17+00:00"}, {"id": "14w32a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d64a982daf815491ef04cdf8a38b1c915da83ba1/14w32a.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-08-06T14:01:16+00:00"}, {"id": "14w31a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ef279ffa71f8f36481dad0de9744e166805d54fc/14w31a.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-30T15:38:05+00:00"}, {"id": "14w30c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/76b580097ce6f4481828425518a139cf3cedee35/14w30c.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-24T14:39:09+00:00"}, {"id": "14w30b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8d57bc2e01916ff6fce4f370ae1cbee639a76428/14w30b.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-23T15:03:03+00:00"}, {"id": "14w30a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8d57966d0f23a9f97af540709f1b51bd8d02b21d/14w30a.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-23T13:15:42+00:00"}, {"id": "14w29b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/55f170c41313f25eb4ec8a4a52cc477c8da00178/14w29b.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-16T17:27:40+00:00"}, {"id": "14w29a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5222c2bfda606abf4c181bd4d2da5c2f583da9cb/14w29a.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-16T15:18:17+00:00"}, {"id": "14w28b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/82ef4b981d95ccab9e7e5fadef82c89dfebf9604/14w28b.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-10T14:28:48+00:00"}, {"id": "14w28a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1bb62510021eb93df67c5ead257d829c21064911/14w28a.json", "time": "2019-06-28T07:08:15+00:00", "releaseTime": "2014-07-09T15:42:36+00:00"}, {"id": "14w27b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/551af51dcb3c047908f4a175233436f32b56b1c7/14w27b.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-07-02T18:34:56+00:00"}, {"id": "14w27a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4e4033a046bca69c81d57555d372d2c89f5d8c33/14w27a.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-07-02T16:07:20+00:00"}, {"id": "14w26c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fe4a2cfb1ee0ddbeebcb227a9ae9d871a0673f7f/14w26c.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-06-26T15:05:03+00:00"}, {"id": "14w26b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f4c2e4092c1a97a09fd9b7a389c30359fe4fbefe/14w26b.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-06-25T15:08:39+00:00"}, {"id": "14w26a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/140b76f6e82e853412d21cfea3c2f98334e852de/14w26a.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-06-25T13:59:27+00:00"}, {"id": "14w25b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2565bfeb09df816d4313c37af293fc8a9597c0ba/14w25b.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-06-19T12:29:48+00:00"}, {"id": "14w25a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6a1030badde86081dfa929cf3c8da92352e27310/14w25a.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-06-18T15:52:28+00:00"}, {"id": "14w21b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ade99be51a33692842377f66f8a381165520bfa8/14w21b.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-05-22T15:17:55+00:00"}, {"id": "14w21a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6c5899eeb043abbc218cb74ee712d049458ad3fd/14w21a.json", "time": "2019-06-28T07:08:14+00:00", "releaseTime": "2014-05-22T14:44:33+00:00"}, {"id": "14w20b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/069b90b7de445d8b403ee81b97477cdfa1526f8b/14w20b.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-05-15T16:47:21+00:00"}, {"id": "14w20a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a2af33f2a37beef83a8d10832a677072415a24fc/14w20a.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-05-15T14:01:20+00:00"}, {"id": "1.7.10", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/2e818dc89e364c7efcfa54bec7e873c5f00b3840/1.7.10.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2014-05-14T17:29:23+00:00"}, {"id": "1.7.10-pre4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1aadefe92e61950c9ea178db4d562c4c1a0bb5ff/1.7.10-pre4.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-05-14T16:29:23+00:00"}, {"id": "1.7.10-pre3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3283163b0e4f3cbfb13f32ff3d19bd1d1c83c177/1.7.10-pre3.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-05-14T15:29:23+00:00"}, {"id": "1.7.10-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/09d4e1fcd0b02cab2709a19558b20136268168cc/1.7.10-pre2.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-05-14T14:29:23+00:00"}, {"id": "1.7.10-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b1832b49dbc5dae395b34cc6bb4aa32e3b450324/1.7.10-pre1.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2014-05-14T13:29:23+00:00"}, {"id": "14w19a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/14bb3b1e4b05852ba81e3fccf55e36cf1b731eef/14w19a.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-05-08T14:24:19+00:00"}, {"id": "14w18b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/1d2d5c9fb333d6f08312aeefdead9adbe041d0e6/14w18b.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-05-02T11:38:17+00:00"}, {"id": "14w18a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/108308cc8f8d1e28710926710c123a2be4247971/14w18a.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-04-30T10:25:35+00:00"}, {"id": "14w17a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8ab598d1696783c449b778b641ae3c6df914b1de/14w17a.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-04-24T15:44:49+00:00"}, {"id": "14w11b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/90f60ef6202a2f83feac88e6ae4fc18fa0c9425a/14w11b.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-04-14T14:36:19+00:00"}, {"id": "1.7.9", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/930a26a3c81803e2f6b9a4069ac14c2e7aaf3b8a/1.7.9.json", "time": "2019-06-28T07:06:17+00:00", "releaseTime": "2014-04-14T13:29:23+00:00"}, {"id": "1.7.8", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/b9b245eb23540c2bb1f5886b1d3a353870c8b684/1.7.8.json", "time": "2019-06-28T07:06:17+00:00", "releaseTime": "2014-04-09T07:58:16+00:00"}, {"id": "1.7.7", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/ef55209910a073339aadf8394bb3504f6c03048c/1.7.7.json", "time": "2019-06-28T07:06:17+00:00", "releaseTime": "2014-04-09T07:52:16+00:00"}, {"id": "1.7.6", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/4cdba7fb4ea885d508bf7469812bdcee6b490681/1.7.6.json", "time": "2019-06-28T07:06:17+00:00", "releaseTime": "2014-04-09T07:52:06+00:00"}, {"id": "14w11a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5fa270226ea95656860ce49fd69d408e25f62933/14w11a.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-03-13T14:02:50+00:00"}, {"id": "1.7.6-pre2", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8eedd564a29fbf6185d0a95d683d24e4322cb884/1.7.6-pre2.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-03-08T11:00:01+00:00"}, {"id": "1.7.6-pre1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ca0399bf77ba4598018eb81a89897b57ae2b22ab/1.7.6-pre1.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2014-03-08T11:00:00+00:00"}, {"id": "14w10c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d0bf7b7151f2f9bbadad8b095bb0f06bd22c28b9/14w10c.json", "time": "2019-06-28T07:08:13+00:00", "releaseTime": "2014-03-07T13:49:55+00:00"}, {"id": "14w10b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9388d70d55a06ebf7cfe0b602622f696e33676d7/14w10b.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-03-06T16:25:39+00:00"}, {"id": "14w10a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f857660a1be0a034e58e79bce8acfd846fd38cd2/14w10a.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-03-06T14:23:04+00:00"}, {"id": "14w08a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/efabf06c42017d6e108952beb19f1e505eedafd6/14w08a.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-02-26T17:00:00+00:00"}, {"id": "1.7.5", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/a0481eaa9979795bb567398a02cc3d7a3775403a/1.7.5.json", "time": "2019-06-28T07:06:17+00:00", "releaseTime": "2014-02-26T09:22:17+00:00"}, {"id": "14w07a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b3f18dabae1e9c1b4888e26f2a7ee0fc4ca13cdd/14w07a.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-02-14T11:05:07+00:00"}, {"id": "14w06b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2bc8fbcea17ac7a3a950c313ce7e9a6e4ae297c4/14w06b.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-02-06T17:30:42+00:00"}, {"id": "14w06a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0bc79bdfdf67e18e5786f701f460b19ee4af50a4/14w06a.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-02-06T14:30:17+00:00"}, {"id": "14w05b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ce7fca43310f73f6532c6f8f94f850a86532ae80/14w05b.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-01-31T14:05:50+00:00"}, {"id": "14w05a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/fb2600e556a199c81b238795ee3a3a05ddb02c59/14w05a.json", "time": "2019-06-28T07:08:12+00:00", "releaseTime": "2014-01-30T15:32:41+00:00"}, {"id": "14w04b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b6df6484e2ae6a57f4cfd5f3da29de238846702a/14w04b.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-24T15:48:46+00:00"}, {"id": "14w04a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/3be1cf3e471a51e4a8346337a58d9379175f4bd4/14w04a.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-23T15:26:13+00:00"}, {"id": "14w03b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/44d7d06106c00398e96ae0ec46b936e4f22fd8be/14w03b.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-16T16:36:19+00:00"}, {"id": "14w03a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6ee35b2eb136f1ec3246ff71e357149be156e64f/14w03a.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-16T14:45:13+00:00"}, {"id": "14w02c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/965c31544504b579f64926d0ac3c611de5c0d84c/14w02c.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-10T15:42:36+00:00"}, {"id": "14w02b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7d7d7362484c27ba4df5250e55c6ce7f9ee507cc/14w02b.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-09T15:45:55+00:00"}, {"id": "14w02a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/32084e58b99ce15a667ed1ef39c3366c84350651/14w02a.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2014-01-09T14:44:41+00:00"}, {"id": "1.7.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/b06faa2910235ba9ecfab434e54e04a0d5f6187d/1.7.4.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-12-09T12:28:10+00:00"}, {"id": "1.7.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/6ad7a69e99996ddb88824a764a869c7ea410ffb3/1.7.3.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-12-06T13:55:34+00:00"}, {"id": "13w49a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ba7947f99ec9a16b9d2f2e1f2bef7d71c523ea54/13w49a.json", "time": "2019-06-28T07:08:11+00:00", "releaseTime": "2013-12-05T14:34:41+00:00"}, {"id": "13w48b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6d3d2f6b7fa888b2c6c5bd457e2b6baaf4405faf/13w48b.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-26T18:36:08+00:00"}, {"id": "13w48a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e1330699e090befe8deb8b4606dbc21e59ed8e5b/13w48a.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-25T16:53:39+00:00"}, {"id": "13w47e", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/880bdce57f43afb0d5a083fba090c99e7b99f514/13w47e.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-22T15:16:38+00:00"}, {"id": "13w47d", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0ccb6fd168823b91d26934e43af326665ba48963/13w47d.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-22T13:51:15+00:00"}, {"id": "13w47c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/dd754b7d7f95b056556a6044ab4de763a9bead73/13w47c.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-21T17:10:33+00:00"}, {"id": "13w47b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/231f5e4d3df49da8b84e71cae2d90d14b575460e/13w47b.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-21T16:57:41+00:00"}, {"id": "13w47a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b871593e6fe9faf9e1557b4cfe272e7c1e05fd20/13w47a.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-11-21T15:59:58+00:00"}, {"id": "1.7.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/83a7d28760ed623225e7cb2e29db140cc68540e8/1.7.2.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-10-25T13:00:00+00:00"}, {"id": "1.7.1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4772d17d3ffdc243d22d136ccec04b0d1093bb25/1.7.1.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2013-10-23T12:01:07+00:00"}, {"id": "1.7", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/5d831c6ad5d1d3547168e981f7786555ae154c05/1.7.json", "time": "2019-06-28T07:07:48+00:00", "releaseTime": "2013-10-22T15:04:05+00:00"}, {"id": "13w43a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6c1693fe1f674b821699782ddee5370f432041fc/13w43a.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-10-21T16:34:47+00:00"}, {"id": "13w42b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b4010b058dd098ae49ead32d1c03deda74a0285a/13w42b.json", "time": "2019-06-28T07:08:10+00:00", "releaseTime": "2013-10-18T16:34:08+00:00"}, {"id": "13w42a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/d6d9998807948f87aaf279dd0555dfdbf1c3baaf/13w42a.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-10-17T18:33:05+00:00"}, {"id": "13w41b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e0b86f8f6029b81a980afeb661774aa7ebb9067b/13w41b.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-10-11T15:09:17+00:00"}, {"id": "13w41a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b81e1a63c1e420f5fb5c9b5c0aaa5bc7eb187e7c/13w41a.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-10-10T14:21:43+00:00"}, {"id": "13w39b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f2bb7d91452ebcd98bc77b0e69d279b1146c02a4/13w39b.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-09-27T12:15:58+00:00"}, {"id": "13w39a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2f4e00c7f6e3bc4a707c027ae2b527bcede4adda/13w39a.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-09-26T15:11:19+00:00"}, {"id": "13w38c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/a9e87e0699f19fea280878f5deb744c5d5d3ccb1/13w38c.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-09-20T15:11:34+00:00"}, {"id": "13w38b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/6f426be1993b140ab5d10459c91eb1f542d58c82/13w38b.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-09-20T13:45:40+00:00"}, {"id": "13w38a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e6dc1d9f9c8efeec67af438d5bf61be082f6e8a4/13w38a.json", "time": "2019-06-28T07:08:09+00:00", "releaseTime": "2013-09-19T16:34:21+00:00"}, {"id": "1.6.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/b71bae449192fbbe1582ff32fb3765edf0b9b0a8/1.6.4.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-09-19T15:52:37+00:00"}, {"id": "1.6.3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/903d6ba1bc87c301d88fa418f8b33446201c7d4e/1.6.3.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2013-09-13T10:54:41+00:00"}, {"id": "13w37b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b8d28154ee056af6af3c8c37815418fe0e9f34f8/13w37b.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-09-13T10:54:41+00:00"}, {"id": "13w37a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2f33c613a4bb81ef5f56be03a8f578208ada382a/13w37a.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-09-12T14:23:14+00:00"}, {"id": "13w36b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/4a538e23057a596fc8c7e04d8a7738d866467f51/13w36b.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-09-06T12:31:58+00:00"}, {"id": "13w36a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/bc915c4dc167dfba92fcc0ae3aa051ae0f9f089b/13w36a.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-09-05T13:05:40+00:00"}, {"id": "1.6.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/c0729761bf65dc58138ce508645dba1442fa78b8/1.6.2.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-07-05T13:09:02+00:00"}, {"id": "1.6.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/7fd8e0c76f62813eb0465e31bb74b160c01472d6/1.6.1.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-06-28T14:48:41+00:00"}, {"id": "1.6", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/20116297638f7c70cd046e25a6ac90fee4cae61a/1.6.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2013-06-25T13:08:56+00:00"}, {"id": "13w26a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b349702aef5e3adaebec30c79338300423943930/13w26a.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-06-24T16:06:06+00:00"}, {"id": "13w25c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/934788bc580ef0a19725ee5bd31f02a0b866e0bf/13w25c.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-06-20T15:23:37+00:00"}, {"id": "13w25b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/8b7870ddd0d0b38779479ad782d65ad80e688cf7/13w25b.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-06-18T15:13:27+00:00"}, {"id": "13w25a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/65c0e5fff89b477ac6f8ddb336f0e718d525d311/13w25a.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-06-17T14:08:06+00:00"}, {"id": "13w24b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/e1294b52803771cfb06767c4c40dced70475cb25/13w24b.json", "time": "2019-06-28T07:08:08+00:00", "releaseTime": "2013-06-14T12:19:13+00:00"}, {"id": "13w24a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/74666ab85cc5539f08aec638eabd63a552ed4125/13w24a.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-06-13T15:32:23+00:00"}, {"id": "13w23b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b19c87c7bfe0c0b202f79fc4b870b0ae97b00e53/13w23b.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-06-08T00:32:01+00:00"}, {"id": "13w23a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/400a136ff102882dfa9bb8990aef32b81309d46a/13w23a.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-06-07T16:04:20+00:00"}, {"id": "13w22a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f8277e55fae1555de47b44f5e6620f13b79fbe4e/13w22a.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-30T14:38:40+00:00"}, {"id": "13w21b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/eab4bc12a78d862fadb36192c5351e35888eab15/13w21b.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-27T08:50:42+00:00"}, {"id": "13w21a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/ff59021171bd73aa155e40f84a924e1ab3f5307d/13w21a.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-23T15:38:28+00:00"}, {"id": "13w19a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/9360f33fa1391cbbfead0e0033c5a1e763f28d19/13w19a.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-10T14:48:02+00:00"}, {"id": "13w18c", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/79ab628c68cefd8daa25d186f7961299ef4e63a9/13w18c.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-03T09:19:35+00:00"}, {"id": "13w18b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/2eea88342657ab8327af70ac2e1416859e0ef02a/13w18b.json", "time": "2019-06-28T07:08:07+00:00", "releaseTime": "2013-05-02T17:12:25+00:00"}, {"id": "13w18a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/0fdbf2d4561027558ba9475c5d318540c743dec9/13w18a.json", "time": "2019-06-28T07:08:06+00:00", "releaseTime": "2013-05-02T15:45:59+00:00"}, {"id": "13w17a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/f65b6bd3c813d67b026a3c9ec12e3280c495cf87/13w17a.json", "time": "2019-06-28T07:08:06+00:00", "releaseTime": "2013-04-25T15:50:00+00:00"}, {"id": "1.5.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/a611948faa091ef3a0af43d39f77589c5e402170/1.5.2.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-04-25T15:45:00+00:00"}, {"id": "13w16b", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/b2c1241c6ca9d119a9f2df431cdf18a56f883d0d/13w16b.json", "time": "2019-06-28T07:08:06+00:00", "releaseTime": "2013-04-23T21:51:22+00:00"}, {"id": "13w16a", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/7efbf7a86354b08f0a5011c96752c92cabb2e67c/13w16a.json", "time": "2019-06-28T07:08:06+00:00", "releaseTime": "2013-04-21T12:49:30+00:00"}, {"id": "1.5.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/46b50f586db97821f22d2c94914c3a31f733a264/1.5.1.json", "time": "2019-06-28T07:06:16+00:00", "releaseTime": "2013-03-20T10:00:00+00:00"}, {"id": "1.5", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/00fa1c125d5ad5ccdbc55f1d1b53b6f52c85bd22/1.5.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2013-03-06T22:00:00+00:00"}, {"id": "1.4.7", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/89802d57ccee3d03ec59d2ab1f44386234adb399/1.4.7.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-12-27T22:00:00+00:00"}, {"id": "1.4.6", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/a7d02971582fcdf14ea275cc549cb57604a37079/1.4.6.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-12-19T22:00:00+00:00"}, {"id": "1.4.5", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/19555cce1f6d04e2b417ac2e9e06b6b752d5a2de/1.4.5.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-12-19T22:00:00+00:00"}, {"id": "1.4.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/578d09d5753e590ea043a68bdaaea45a5b9711ab/1.4.4.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-12-13T22:00:00+00:00"}, {"id": "1.4.3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/180deba5c263367e914217be0701bd9e1a44f13b/1.4.3.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2012-11-30T22:00:00+00:00"}, {"id": "1.4.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/aec7405cf74ae5f79b13f6e8c88f66920eac0e1b/1.4.2.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-11-24T22:00:00+00:00"}, {"id": "1.4.1", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/859f584890b4db227f267026510c6ac2a5076d94/1.4.1.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2012-11-22T22:00:00+00:00"}, {"id": "1.4", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/070986801bc1d42eac872758cf12f00afa7b5f35/1.4.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2012-11-18T22:00:00+00:00"}, {"id": "1.3.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/2bd0ca9b77465a29df4b9449772d008f8724dd19/1.3.2.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-08-15T22:00:00+00:00"}, {"id": "1.3.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/be773d2fff5c6e4db9929ae4ea780f8837323b6b/1.3.1.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-07-31T22:00:00+00:00"}, {"id": "1.3", "type": "snapshot", "url": "https://launchermeta.mojang.com/v1/packages/aeb1bb40dc59420433ae46a0f133392508218bbe/1.3.json", "time": "2019-06-28T07:07:47+00:00", "releaseTime": "2012-07-25T22:00:00+00:00"}, {"id": "1.2.5", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/886723c6385e62bb8dbe8026abf685140602404b/1.2.5.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-03-29T22:00:00+00:00"}, {"id": "1.2.4", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/3cc81a28957e8c7d94bdd4f6b2c51ef8cae54f9b/1.2.4.json", "time": "2019-06-28T07:06:15+00:00", "releaseTime": "2012-03-21T22:00:00+00:00"}, {"id": "1.2.3", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/4100a29330f76c93ef3bdc47d11fa016fd73de99/1.2.3.json", "time": "2019-06-28T07:06:14+00:00", "releaseTime": "2012-03-01T22:00:00+00:00"}, {"id": "1.2.2", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/897ce0e56d1cecc9e720f1934c09ea395008aa9e/1.2.2.json", "time": "2019-06-28T07:06:14+00:00", "releaseTime": "2012-02-29T22:00:01+00:00"}, {"id": "1.2.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/dc5f9e134da9e18a2db42ddc246aba5cdfe28d3c/1.2.1.json", "time": "2019-06-28T07:06:14+00:00", "releaseTime": "2012-02-29T22:00:00+00:00"}, {"id": "1.1", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/1c1aaa3dea5155b549d4baf3491e3f5f564c3b8b/1.1.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2012-01-11T22:00:00+00:00"}, {"id": "1.0", "type": "release", "url": "https://launchermeta.mojang.com/v1/packages/edfc56a64dfc6430665d745264732db53b0d1b41/1.0.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-11-17T22:00:00+00:00"}, {"id": "b1.8.1", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/5b5a652a385b3d04af8e05bb773696a227ebc300/b1.8.1.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-09-18T22:00:00+00:00"}, {"id": "b1.8", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/c2ce53a6d847e3c3efb640dc7d32e47e72e0a24f/b1.8.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-09-14T22:00:00+00:00"}, {"id": "b1.7.3", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/0de35233bea254fd0011cceb4aa96e0a32b7efd2/b1.7.3.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-07-07T22:00:00+00:00"}, {"id": "b1.7.2", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/b9ac061f45d78c16739c95871d1540c681a187c8/b1.7.2.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-06-30T22:00:00+00:00"}, {"id": "b1.7", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/3b7900fbef699471069015beef2a0d62cb2efabf/b1.7.json", "time": "2019-06-28T07:05:45+00:00", "releaseTime": "2011-06-29T22:00:00+00:00"}, {"id": "b1.6.6", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/2c39299d7841e5273f5a6347373ba89eb48149d2/b1.6.6.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-30T22:00:00+00:00"}, {"id": "b1.6.5", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/f52059e5de7e06cbceba3642895005a36c40a6ef/b1.6.5.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-27T22:00:00+00:00"}, {"id": "b1.6.4", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/3a6546e2e4be5492c974359880f5cd6f1c513478/b1.6.4.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-25T22:00:04+00:00"}, {"id": "b1.6.3", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/4aa947cc55a28139e06ba6cde47b2c5aa3d9941c/b1.6.3.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-25T22:00:03+00:00"}, {"id": "b1.6.2", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/299360b97a57c73c0a6f258313200f40a37ab758/b1.6.2.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-25T22:00:02+00:00"}, {"id": "b1.6.1", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/72fc5a50e6a2fc9cdb5d77dcaa1f4cd4391536d3/b1.6.1.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-25T22:00:01+00:00"}, {"id": "b1.6", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/70c6be33812e5a030db15b28ccd72d30a5dcbca7/b1.6.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-05-25T22:00:00+00:00"}, {"id": "b1.5_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/cda4fc0e6f35c8645a013045be7c746e1a5b63d3/b1.5_01.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-04-19T22:00:00+00:00"}, {"id": "b1.5", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/cd33026e81d260495f859a446a1f17e3071a17ea/b1.5.json", "time": "2019-06-28T07:05:44+00:00", "releaseTime": "2011-04-18T22:00:00+00:00"}, {"id": "b1.4_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/7a7fbff959b9576845d83b215cc82ecf6bca5bcf/b1.4_01.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-04-04T22:00:00+00:00"}, {"id": "b1.4", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/ce8cd5c165f2941d343cd98ec76a5b93d9a95c8c/b1.4.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-03-30T22:00:00+00:00"}, {"id": "b1.3_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/f551611d75278e2847cca77421a51b99f4bb32de/b1.3_01.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-02-22T22:00:00+00:00"}, {"id": "b1.3b", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/a803c5a24b04ccab17269183b872cdaa38b32ae3/b1.3b.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-02-21T22:00:00+00:00"}, {"id": "b1.2_02", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/afeabd62ef6bab19c8d570ab39a5e4161b27b85d/b1.2_02.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-01-20T22:00:00+00:00"}, {"id": "b1.2_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/e9ea31d80bb8979bf3042165094d2e10b2899eaf/b1.2_01.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-01-13T22:00:00+00:00"}, {"id": "b1.2", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/703f0c0797d0b83dac8304b1c35ee4dcee6a2413/b1.2.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2011-01-12T22:00:00+00:00"}, {"id": "b1.1_02", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/219e087b54dc2ca9a51a0204238cccaa035b5cef/b1.1_02.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2010-12-21T22:00:01+00:00"}, {"id": "b1.1_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/d0d10f21a0f8115bdfbc2f0ddef2d93833af2e9d/b1.1_01.json", "time": "2019-06-28T07:05:43+00:00", "releaseTime": "2010-12-21T22:00:00+00:00"}, {"id": "b1.0.2", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/f8d933ed690495b66f76d0a5045e40c18881a26a/b1.0.2.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2010-12-20T22:00:00+00:00"}, {"id": "b1.0_01", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/c7559faa3f520837456b2a3736c663a856812049/b1.0_01.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2010-12-19T22:00:01+00:00"}, {"id": "b1.0", "type": "old_beta", "url": "https://launchermeta.mojang.com/v1/packages/5be70efae7eea5f18ce164fb264eaa9563a054ee/b1.0.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2010-12-19T22:00:00+00:00"}, {"id": "a1.2.6", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/d385e176aa7d3d3702bac78ad1ba906a77de13df/a1.2.6.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2010-12-02T22:00:00+00:00"}, {"id": "a1.2.5", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/491a4961f00770bd130206c013795f35af948493/a1.2.5.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2010-11-30T22:00:00+00:00"}, {"id": "a1.2.4_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/e802a257031c5b9297c971599cc2573c2efece2c/a1.2.4_01.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2010-11-29T22:00:00+00:00"}, {"id": "a1.2.3_04", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/467403a159661d486fbe49480faf0909ea533759/a1.2.3_04.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2010-11-25T22:00:00+00:00"}, {"id": "a1.2.3_02", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/31fa028661857f2e3d3732d07a6d36ec21d6dbdc/a1.2.3_02.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2010-11-24T22:00:00+00:00"}, {"id": "a1.2.3_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/2dbccc4579a4481dc8d72a962d396de044648522/a1.2.3_01.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-23T22:00:01+00:00"}, {"id": "a1.2.3", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/48f077bf27e0a01a0bb2051e0ac17a96693cb730/a1.2.3.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-23T22:00:00+00:00"}, {"id": "a1.2.2b", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/0fbd340ae9087db32535ed0fb2d119240e7e0aaa/a1.2.2b.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-09T22:00:01+00:00"}, {"id": "a1.2.2a", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/6679a974769ad2c6b88025ccbb60c72612dcee1f/a1.2.2a.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-09T22:00:00+00:00"}, {"id": "a1.2.1_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/79e993b71f867e777a0ac9e2816bfd3df5c1aaed/a1.2.1_01.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-04T22:00:01+00:00"}, {"id": "a1.2.1", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/f601478f5b0bf55ba0a302a4d1a8ce402c9311c1/a1.2.1.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-04T22:00:00+00:00"}, {"id": "a1.2.0_02", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/48465dfa2e2066e3b06e8fca934f2bbd7d03e65c/a1.2.0_02.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-11-03T22:00:00+00:00"}, {"id": "a1.2.0_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/e31556ae6f925d4dc7a06a5110cce731eca6eaa8/a1.2.0_01.json", "time": "2019-06-28T07:05:40+00:00", "releaseTime": "2010-10-30T22:00:00+00:00"}, {"id": "a1.2.0", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/a0e7c34fba8c11fa8b84a56a01ed8505ad34b52a/a1.2.0.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-10-29T22:00:00+00:00"}, {"id": "a1.1.2_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/c28a71888f39178cfc6f882fd62f49de920d138e/a1.1.2_01.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-09-22T22:00:00+00:00"}, {"id": "a1.1.2", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/1231fefa206b10993e4b77b13f86fc72759db038/a1.1.2.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-09-19T22:00:00+00:00"}, {"id": "a1.1.0", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/a30685ddf58121f25dd845e5361a3d262409489d/a1.1.0.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-09-12T22:00:00+00:00"}, {"id": "a1.0.17_04", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/7c85d4575c9cc951135c3e6e958e1fcb2ed4e4ae/a1.0.17_04.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-08-22T22:00:00+00:00"}, {"id": "a1.0.17_02", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/54d1b6731a61a0b513ec0f677b58249be6c94086/a1.0.17_02.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-08-19T22:00:00+00:00"}, {"id": "a1.0.16", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/139fcc1a590a1166b872046bf4b82cfb04452061/a1.0.16.json", "time": "2019-06-28T07:05:38+00:00", "releaseTime": "2010-08-11T22:00:00+00:00"}, {"id": "a1.0.15", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/786cd66bd91d3bd8ebd5d7fb10ec63daf671b646/a1.0.15.json", "time": "2019-06-28T07:05:38+00:00", "releaseTime": "2010-08-03T22:00:00+00:00"}, {"id": "a1.0.14", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/eff58a647f38df437241e769a9703baa40e0efd8/a1.0.14.json", "time": "2019-06-28T07:05:38+00:00", "releaseTime": "2010-07-29T22:00:00+00:00"}, {"id": "a1.0.11", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/3467dbde729f4e43047e54627ca20c82c9ee9a66/a1.0.11.json", "time": "2019-06-28T07:05:38+00:00", "releaseTime": "2010-07-22T22:00:00+00:00"}, {"id": "a1.0.5_01", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/269ea3fdb671777a7bd0e97d4046cc27dc909694/a1.0.5_01.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-07-12T22:00:00+00:00"}, {"id": "a1.0.4", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/a1f71c0a68d59c0b6570073b440fb55ff889ba5a/a1.0.4.json", "time": "2019-06-28T07:05:39+00:00", "releaseTime": "2010-07-08T22:00:00+00:00"}, {"id": "inf-20100618", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/065ce5795aaf172080a4975cefac0d248bee7a3b/inf-20100618.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2010-06-15T22:00:00+00:00"}, {"id": "c0.30_01c", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/0bb9bdebc3e124818fd31779a4bb394283050a02/c0.30_01c.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-12-21T22:00:00+00:00"}, {"id": "c0.0.13a", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/5d77dd27f9684b4cbfbecc29a2c8c28d36a5e9c2/c0.0.13a.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2009-05-30T22:00:00+00:00"}, {"id": "c0.0.13a_03", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/3e038a3d4ce26771a8019c8c348a18844b950fdc/c0.0.13a_03.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2009-05-21T22:00:00+00:00"}, {"id": "c0.0.11a", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/d700384628b420acbe14388efc3b563e85ff7961/c0.0.11a.json", "time": "2019-06-28T07:05:41+00:00", "releaseTime": "2009-05-16T22:00:00+00:00"}, {"id": "rd-161348", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/a937d17cca60af0a7d45d04b49a849af16b08a28/rd-161348.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-05-16T11:48:00+00:00"}, {"id": "rd-160052", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/c33dd04acfdbf34dcdfcca64db8545339ea24f02/rd-160052.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-05-15T22:52:00+00:00"}, {"id": "rd-20090515", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/1bcd01f323df5c5092e9f0967b3d310d5bc0013a/rd-20090515.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-05-14T22:00:00+00:00"}, {"id": "rd-132328", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/77baa48d9cbbc6c3165c294e5bcdab2ca6903d57/rd-132328.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-05-13T21:28:00+00:00"}, {"id": "rd-132211", "type": "old_alpha", "url": "https://launchermeta.mojang.com/v1/packages/0f2a46082313d0ec67972f9f63c3fa6591f9bb85/rd-132211.json", "time": "2019-06-28T07:05:42+00:00", "releaseTime": "2009-05-13T20:11:00+00:00"}]}
amidst
src\test\java\amidst\devtools\BiomeProfileSerializer.java
package amidst.devtools; import amidst.settings.biomeprofile.BiomeProfile; public class BiomeProfileSerializer { private final BiomeProfile profile; public BiomeProfileSerializer(BiomeProfile profile) { this.profile = profile; } public void run() { profile.validate(); System.out.println(profile.serialize()); } }
amidst
src\test\java\amidst\devtools\DevToolRunner.java
package amidst.devtools; import amidst.AmidstVersion; import amidst.ResourceLoader; import amidst.devtools.settings.DevToolSettings; import amidst.mojangapi.file.MinecraftInstallation; import amidst.mojangapi.file.Version; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.versionfeatures.DefaultVersionFeatures; import amidst.mojangapi.world.versionfeatures.FeatureKey; import amidst.parsing.FormatException; import amidst.settings.biomeprofile.BiomeProfile; import org.junit.Ignore; import org.junit.Test; import java.io.IOException; import java.nio.file.Paths; /** * Eclipse does not allow to run the main directly as a Java Application, * because it is placed in the test directory. Ensure that these tests are * ignored when creating a commit, so they will be ignored by travis ci. */ public class DevToolRunner { @Ignore @Test public void generateInstalledVersionsList() throws FormatException, IOException { new GenerateInstalledVersionsList(MinecraftInstallation.newLocalMinecraftInstallation(null)).run(); } @Ignore @Test public void generateRecognisedVersionList() throws FormatException, IOException { new GenerateRecognisedVersionList(versionsDirectory(), librariesDirectory(), Version.newRemoteVersionList()).run(); } @Ignore @Test public void generateUpdateInformationJson() { new GenerateUpdateInformationJson(amidstVersion()).run(); } @Ignore @Test public void generateWorldTestData() throws FormatException, IOException { new GenerateWorldTestData(versionsDirectory(), librariesDirectory(), Version.newRemoteVersionList()).run(); } @Ignore @Test public void checkMinecraftJarFileDownloadAvailability() throws FormatException, IOException { new MinecraftJarDownloadAvailabilityChecker(Version.newRemoteVersionList()).run(); } @Ignore @Test public void downloadMinecraftJarFiles() throws FormatException, IOException { new MinecraftJarDownloader(versionsDirectory(), Version.newRemoteVersionList()).run(); } @Ignore @Test public void checkMinecraftVersionCompatibility() throws FormatException, IOException { new MinecraftVersionCompatibilityChecker(versionsDirectory(), librariesDirectory(), Version.newRemoteVersionList()).run(); } @Ignore @Test public void generateBiomeColorImages() throws IOException { new GenerateBiomeColorImages(DefaultVersionFeatures.builder(null, null).create(RecognisedVersion.UNKNOWN).get(FeatureKey.BIOME_LIST).iterable(), Paths.get(biomeColorImagesDirectory())).run(); } @Ignore @Test public void benchmarkWorldGeneration() throws FormatException, IOException { new WorldGenerationBencher(benchmarksDirectory(), versionsDirectory(), librariesDirectory(), Version.newRemoteVersionList()).run(); } @Ignore @Test public void serializeBiomeProfile() { new BiomeProfileSerializer(BiomeProfile.createExampleProfile()).run(); } private String librariesDirectory() { return DevToolSettings.INSTANCE.getMinecraftLibrariesDirectory(); } private String versionsDirectory() { return DevToolSettings.INSTANCE.getMinecraftVersionsDirectory(); } private String biomeColorImagesDirectory() { return DevToolSettings.INSTANCE.getBiomeColorImagesDirectory(); } private String benchmarksDirectory() { return DevToolSettings.INSTANCE.getBenchmarksDirectory(); } private AmidstVersion amidstVersion() { return AmidstVersion.from(ResourceLoader.getProperties("/amidst/metadata.properties")); } }
amidst
src\test\java\amidst\devtools\GenerateBiomeColorImages.java
package amidst.devtools; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import javax.imageio.ImageIO; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.world.biome.Biome; import amidst.mojangapi.world.biome.UnknownBiomeIdException; import amidst.settings.biomeprofile.BiomeProfile; import amidst.settings.biomeprofile.BiomeProfileSelection; @NotThreadSafe public class GenerateBiomeColorImages { private static final int WIDTH = 100; private static final int HEIGHT = 30; private final Iterable<Biome> biomes; private final Path root; public GenerateBiomeColorImages(Iterable<Biome> biomes, Path root) { this.biomes = biomes; this.root = root; } public void run() throws IOException { try { StringBuilder b = new StringBuilder(); b.append("Biome name | Biome id | Biome color\n"); b.append("---------|-----------:|:----------:\n"); BiomeProfileSelection colorProvider = new BiomeProfileSelection(BiomeProfile.getDefaultProfile()); for (Biome biome : biomes) { int index = biome.getId(); String name = biome.getName(); Color color = colorProvider.getBiomeColor(biome.getId()).getColor(); appendLine(b, index, name); createAndSaveImage(index, color); } System.out.println(b.toString()); } catch (UnknownBiomeIdException e) { e.printStackTrace(); } } private void appendLine(StringBuilder b, int index, String name) { b.append(name); b.append(" | "); b.append(index); b.append(" | "); appendImageReference(b, index, name); b.append("\n"); } private void appendImageReference(StringBuilder b, int index, String name) { b.append("![" + name + "](biome-color-images/" + index + ".png)"); } private void createAndSaveImage(int index, Color color) throws IOException { ImageIO.write(createImage(color), "png", new BufferedOutputStream(Files.newOutputStream(root.resolve(index + ".png")))); } private BufferedImage createImage(Color color) { BufferedImage result = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = result.createGraphics(); g2d.setColor(color); g2d.fillRect(0, 0, WIDTH, HEIGHT); g2d.dispose(); return result; } }
amidst
src\test\java\amidst\devtools\GenerateInstalledVersionsList.java
package amidst.devtools; import java.io.IOException; import amidst.mojangapi.file.MinecraftInstallation; import amidst.parsing.FormatException; public class GenerateInstalledVersionsList { private final MinecraftInstallation minecraftInstallation; public GenerateInstalledVersionsList(MinecraftInstallation minecraftInstallation) { this.minecraftInstallation = minecraftInstallation; } public void run() throws FormatException, IOException { minecraftInstallation.readInstalledVersionsAsLauncherProfiles().stream().map(p -> p.getVersionName()).forEach( System.out::println); } }
amidst
src\test\java\amidst\devtools\GenerateRecognisedVersionList.java
package amidst.devtools; import amidst.devtools.utils.RecognisedVersionEnumBuilder; import amidst.logging.AmidstLogger; import amidst.mojangapi.file.DotMinecraftDirectoryNotFoundException; import amidst.mojangapi.file.MinecraftInstallation; import amidst.mojangapi.file.Version; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.parsing.FormatException; import java.io.IOException; import java.net.URLClassLoader; import java.nio.file.Paths; import java.util.LinkedList; import java.util.List; public class GenerateRecognisedVersionList { private final String prefix; private final List<Version> versionList; private final MinecraftInstallation minecraftInstallation; private final List<String> versionsWithError = new LinkedList<>(); private final List<String> downloadFailed = new LinkedList<>(); private final RecognisedVersionEnumBuilder builder = RecognisedVersionEnumBuilder.createPopulated(); public GenerateRecognisedVersionList(String prefix, String libraries, List<Version> versionList) throws DotMinecraftDirectoryNotFoundException { this.prefix = prefix; this.versionList = versionList; this.minecraftInstallation = MinecraftInstallation .newCustomMinecraftInstallation(Paths.get(libraries), Paths.get(prefix), null); } public void run() { populate(); print(); } private void populate() { for (Version version : versionList) { process(version); } builder.calculateMaxLength(); } private void process(Version version) { try { version.fetchRemoteVersion().downloadClient(prefix); } catch (IOException | FormatException e) { e.printStackTrace(); downloadFailed.add(version.getId()); return; } try { process(version.getId()); } catch (ClassNotFoundException | NoClassDefFoundError | FormatException | IOException e) { e.printStackTrace(); versionsWithError.add(version.getId()); } } private void process(String versionId) throws ClassNotFoundException, FormatException, IOException { AmidstLogger.info("version " + versionId); URLClassLoader classLoader = minecraftInstallation.newLauncherProfile(versionId).newClassLoader(); String magicString = RecognisedVersion.generateMagicString(classLoader); builder.addLauncherVersionId(versionId, magicString); } private void print() { System.out.println(); System.out.println(); System.out.println(); print("============ New", builder.renderNew()); print("============ Renamed", builder.renderRenamed()); print("============ Complete", builder.renderComplete()); print("============ Error", versionsWithError); print("============ Download Failed", downloadFailed); printMessages(); } private void print(String title, Iterable<String> lines) { System.out.println(title); System.out.println(); for (String line : lines) { System.out.println(line); } System.out.println(); } private void printMessages() { System.out.println(); System.out.println( "If any version are listed in the error section, this might be due to missing libraries.\n" + "Start the given minecraft version with the launcher.\n" + "This should download the missing libraries. Afterwards, try again."); System.out.println(); System.out .println("When copying the magic string from this output, make sure to escape all special characters."); System.out.println(); System.out.println("Versions without a match are probably removed from the launcher."); System.out.println(); System.out.println( "You might have to reorder the output, e.g. when a security fix for an old version came out, after the snapshots for the next version started."); } }
amidst
src\test\java\amidst\devtools\GenerateUpdateInformationJson.java
package amidst.devtools; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import amidst.AmidstVersion; import amidst.gui.main.UpdateInformationJson; public class GenerateUpdateInformationJson { private static final String DOWNLOAD_URL = "https://github.com/toolbox4minecraft/amidst/releases"; private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); private final AmidstVersion version; public GenerateUpdateInformationJson(AmidstVersion version) { this.version = version; } public void run() { if (version.isPreRelease()) { throw new RuntimeException( "Update information documents can only be created for stable releases (not a pre-release)."); } UpdateInformationJson json = new UpdateInformationJson( version.getMajor(), version.getMinor(), version.getPatch(), "", DOWNLOAD_URL); System.out.println(GSON.toJson(json)); } }
amidst
src\test\java\amidst\devtools\GenerateWorldTestData.java
package amidst.devtools; import amidst.mojangapi.file.DotMinecraftDirectoryNotFoundException; import amidst.mojangapi.file.LauncherProfile; import amidst.mojangapi.file.MinecraftInstallation; import amidst.mojangapi.file.Version; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceCreationException; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.minecraftinterface.MinecraftInterfaces; import amidst.mojangapi.world.testworld.TestWorldCache; import amidst.mojangapi.world.testworld.TestWorldDeclaration; import amidst.parsing.FormatException; import java.io.IOException; import java.nio.file.Paths; import java.util.LinkedList; import java.util.List; public class GenerateWorldTestData { private final String prefix; private final List<Version> versionList; private final MinecraftInstallation minecraftInstallation; private final List<String> failed = new LinkedList<>(); private final List<String> successful = new LinkedList<>(); public GenerateWorldTestData(String prefix, String libraries, List<Version> versionList) throws DotMinecraftDirectoryNotFoundException { this.prefix = prefix; this.versionList = versionList; this.minecraftInstallation = MinecraftInstallation .newCustomMinecraftInstallation(Paths.get(libraries), Paths.get(prefix), null); } public void run() { for (Version version : versionList) { for (TestWorldDeclaration declaration : TestWorldDeclaration.values()) { if (declaration.getRecognisedVersion().getName().equals(version.getId())) { generate(declaration, version); } } } print("============ Successful ============", successful); print("============== Failed ==============", failed); } private void generate(TestWorldDeclaration declaration, Version version) { try { version.fetchRemoteVersion().downloadClient(prefix); LauncherProfile launcherProfile = minecraftInstallation.newLauncherProfile(version.getId()); MinecraftInterface minecraftInterface = MinecraftInterfaces.fromLocalProfile(launcherProfile); TestWorldCache.createAndPut(declaration, minecraftInterface); successful.add(version.getId()); } catch ( MinecraftInterfaceCreationException | MinecraftInterfaceException | FormatException | IOException e) { e.printStackTrace(); failed.add(version.getId()); } } private void print(String title, Iterable<String> lines) { System.out.println(title); for (String line : lines) { System.out.println(line); } System.out.println(); } }
amidst
src\test\java\amidst\devtools\MinecraftJarDownloadAvailabilityChecker.java
package amidst.devtools; import amidst.devtools.utils.VersionStateRenderer; import amidst.mojangapi.file.RemoteVersion; import amidst.mojangapi.file.Version; import amidst.parsing.FormatException; import java.io.IOException; import java.util.List; public class MinecraftJarDownloadAvailabilityChecker { private VersionStateRenderer renderer = new VersionStateRenderer(); private List<Version> versionList; public MinecraftJarDownloadAvailabilityChecker(List<Version> versionList) { this.versionList = versionList; } public void run() { for (Version version : versionList) { checkVersion(version); } } private void checkVersion(Version version) { boolean hasServer = false; boolean hasClient = false; try { RemoteVersion remoteVersion = version.fetchRemoteVersion(); hasServer = remoteVersion.hasServer(); hasClient = remoteVersion.hasClient(); } catch (IOException | FormatException e) { e.printStackTrace(); } System.out.println(renderer.render(version, hasServer, hasClient)); } }
amidst
src\test\java\amidst\devtools\MinecraftJarDownloader.java
package amidst.devtools; import amidst.devtools.utils.VersionStateRenderer; import amidst.mojangapi.file.RemoteVersion; import amidst.mojangapi.file.Version; import amidst.parsing.FormatException; import java.io.IOException; import java.util.List; public class MinecraftJarDownloader { private VersionStateRenderer renderer = new VersionStateRenderer(); private String prefix; private List<Version> versionList; public MinecraftJarDownloader(String prefix, List<Version> versionList) { this.prefix = prefix; this.versionList = versionList; } public void run() { for (Version version : versionList) { downloadVersion(version); } } private void downloadVersion(Version version) { boolean hasServer = false; boolean hasClient = false; try { RemoteVersion remoteVersion = version.fetchRemoteVersion(); hasServer = tryDownload(remoteVersion, true); hasClient = tryDownload(remoteVersion, false); } catch (IOException | FormatException e) { e.printStackTrace(); } System.out.println(renderer.render(version, hasServer, hasClient)); } private boolean tryDownload(RemoteVersion version, boolean server) { try { if (server) { version.downloadServer(prefix); } else { version.downloadClient(prefix); } return true; } catch (IOException e) { e.printStackTrace(); return false; } } }
amidst
src\test\java\amidst\devtools\MinecraftVersionCompatibilityChecker.java
package amidst.devtools; import amidst.clazz.Classes; import amidst.clazz.real.JarFileParsingException; import amidst.clazz.symbolic.declaration.SymbolicClassDeclaration; import amidst.clazz.translator.ClassTranslator; import amidst.mojangapi.file.DotMinecraftDirectoryNotFoundException; import amidst.mojangapi.file.LauncherProfile; import amidst.mojangapi.file.MinecraftInstallation; import amidst.mojangapi.file.Version; import amidst.mojangapi.minecraftinterface.MinecraftInterfaces; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.parsing.FormatException; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.EnumMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; /** * This only checks if there is exactly one class in the jar file for each * class, defined by the class translator. Optional classes can be missing. * However, it does not check if the class has all the required constructors, * methods and fields. It also does not try to use the found classes. */ public class MinecraftVersionCompatibilityChecker { private final String prefix; private final List<Version> versionList; private final MinecraftInstallation minecraftInstallation; public MinecraftVersionCompatibilityChecker(String prefix, String libraries, List<Version> versionList) throws DotMinecraftDirectoryNotFoundException { this.prefix = prefix; this.versionList = versionList; this.minecraftInstallation = MinecraftInstallation .newCustomMinecraftInstallation(Paths.get(libraries), Paths.get(prefix), null); } public void run() { Map<VersionStatus, List<Version>> statuses = new EnumMap<>(VersionStatus.class); for (Version version : versionList) { statuses.computeIfAbsent(checkOne(version), k -> new ArrayList<>()).add(version); } displayVersionList("============== SUPPORTED VERSIONS ==============", statuses.get(VersionStatus.SUPPORTED)); displayVersionList("============= UNSUPPORTED VERSIONS =============", statuses.get(VersionStatus.UNSUPPORTED)); displayVersionList("============= UNRECOGNISED VERSIONS ============", statuses.get(VersionStatus.UNRECOGNISED)); displayVersionList("================ FAILED VERSIONS ===============", statuses.get(VersionStatus.FAILED)); } private VersionStatus checkOne(Version version) { try { version.fetchRemoteVersion().downloadClient(prefix); } catch (IOException | FormatException e) { return VersionStatus.UNSUPPORTED; } try { LauncherProfile launcherProfile = minecraftInstallation.newLauncherProfile(version.getId()); RecognisedVersion recognisedVersion = RecognisedVersion.from(launcherProfile.newClassLoader()); if(!recognisedVersion.isKnown()) return VersionStatus.UNRECOGNISED; Path jarFile = version.getClientJarFile(Paths.get(prefix)); ClassTranslator translator = MinecraftInterfaces.getClassTranslatorFromVersion(recognisedVersion); if(isSupported(Classes.countMatches(jarFile, translator))) return VersionStatus.SUPPORTED; } catch (JarFileParsingException | FormatException | IOException | ClassNotFoundException e) { e.printStackTrace(); return VersionStatus.FAILED; } return VersionStatus.UNSUPPORTED; } private boolean isSupported(Map<SymbolicClassDeclaration, Integer> matchesMap) { for (Entry<SymbolicClassDeclaration, Integer> entry : matchesMap.entrySet()) { if (entry.getValue() > 1) { return false; } else if (entry.getValue() == 0 && !entry.getKey().isOptional()) { return false; } } return true; } private void displayVersionList(String message, List<Version> versions) { System.out.println(); System.out.println(message); for (Version version : versions) { System.out.println(version.getId()); } } private static enum VersionStatus { SUPPORTED, UNSUPPORTED, UNRECOGNISED, FAILED, } }
amidst
src\test\java\amidst\devtools\WorldGenerationBencher.java
package amidst.devtools; import amidst.AmidstSettings; import amidst.Application; import amidst.CommandLineParameters; import amidst.gui.main.MainWindow; import amidst.mojangapi.RunningLauncherProfile; import amidst.mojangapi.file.DotMinecraftDirectoryNotFoundException; import amidst.mojangapi.file.LauncherProfile; import amidst.mojangapi.file.MinecraftInstallation; import amidst.mojangapi.file.Version; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceCreationException; import amidst.mojangapi.minecraftinterface.MinecraftInterfaces; import amidst.mojangapi.mocking.BenchmarkingMinecraftInterface; import amidst.mojangapi.mocking.json.BiomeRequestRecordJson; import amidst.mojangapi.world.WorldBuilder; import amidst.mojangapi.world.WorldOptions; import amidst.mojangapi.world.WorldSeed; import amidst.mojangapi.world.WorldType; import amidst.mojangapi.world.coordinates.CoordinatesInWorld; import amidst.parsing.FormatException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import javax.swing.SwingUtilities; import javax.swing.Timer; import java.io.IOException; import java.io.Writer; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.concurrent.Semaphore; import java.util.prefs.Preferences; public class WorldGenerationBencher { private static final Gson GSON = new GsonBuilder().create(); private static final WorldOptions WORLD_OPTIONS = new WorldOptions( WorldSeed.fromSaveGame(123456), WorldType.DEFAULT); private final String prefix; private final List<Version> versionList; private final MinecraftInstallation minecraftInstallation; private final Path outDir; private final List<BiomeRequestRecordJson> records = new ArrayList<>(); private final List<Version> successful = new ArrayList<>(); private final List<Version> failed = new ArrayList<>(); private final Semaphore fullyLoadedBarrier = new Semaphore(0); public WorldGenerationBencher(String outDir, String prefix, String libraries, List<Version> versionList) throws DotMinecraftDirectoryNotFoundException { this.prefix = prefix; this.versionList = versionList; this.outDir = Paths.get(outDir); this.minecraftInstallation = MinecraftInstallation .newCustomMinecraftInstallation(Paths.get(libraries), Paths.get(prefix), null); } public void run() throws FormatException, IOException { Application app = startAmidst(); for(Version version: versionList) { benchmarkOne(app, version); } displayVersionList("===== VERSIONS SUCCESSFUL =====", successful); displayVersionList("======= VERSIONS FAILED =======", failed); } private void benchmarkOne(Application app, Version version) { RunningLauncherProfile profile; try { version.fetchRemoteVersion().downloadClient(prefix); LauncherProfile launcherProfile = minecraftInstallation.newLauncherProfile(version.getId()); profile = new RunningLauncherProfile( WorldBuilder.createSilentPlayerless(), launcherProfile, new BenchmarkingMinecraftInterface(MinecraftInterfaces.fromLocalProfile(launcherProfile), records), Optional.empty()); } catch (FormatException | IOException | MinecraftInterfaceCreationException e) { e.printStackTrace(); failed.add(version); return; } if(!version.getId().equals(profile.getRecognisedVersion().getName())) return; //dummy run + real run, only the data gathered on the real run counts for(int i = 0; i < 2; i++) { records.clear(); long startTime = System.nanoTime(); SwingUtilities.invokeLater(() -> launchMainWindow(app, profile)); fullyLoadedBarrier.acquireUninterruptibly(); adjustRecords(startTime); } try { saveRecords(version); } catch (IOException e) { failed.add(version); return; } successful.add(version); } private void launchMainWindow(Application app, RunningLauncherProfile profile) { MainWindow window = app.displayMainWindow(profile); window.getWorldSwitcher().displayWorld(WORLD_OPTIONS); for(int i = 0; i < 10; i++) { window.getViewerFacade().adjustZoom(1); } window.getViewerFacade().centerOn(CoordinatesInWorld.origin()); Timer timer = new Timer(1000, e -> {}); timer.setRepeats(true); timer.setInitialDelay(1000); timer.addActionListener(e -> { if(window.getViewerFacade().isFullyLoaded()) { timer.stop(); fullyLoadedBarrier.release(); } }); timer.start(); } private Application startAmidst() throws FormatException, IOException { AmidstSettings settings = new AmidstSettings(Preferences.userNodeForPackage(getClass())); CommandLineParameters params = new CommandLineParameters(); return new Application(params, settings); } private void adjustRecords(long startTime) { for(BiomeRequestRecordJson record: records) { record.startTime -= startTime; } } private void saveRecords(Version version) throws IOException { Path file = outDir.resolve("worldgen-" + version.getId() + ".json"); try (Writer writer = Files.newBufferedWriter(file)) { GSON.toJson(records, writer); } } private void displayVersionList(String message, List<Version> versions) { System.out.println(); System.out.println(message); for (Version version : versions) { System.out.println(version.getId()); } } }
amidst
src\test\java\amidst\logging\MessageFormatterTest.java
package amidst.logging; import org.junit.Assert; import org.junit.Test; public class MessageFormatterTest { @Test public void testEmptyMessage() { String message = ""; String expected = ""; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } @Test public void testSimplyMessage() { String message = "{}"; String expected = "p1"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } @Test public void testBeforeMessage() { String message = "{}m1"; String expected = "p1m1"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } @Test public void testAfterMessage() { String message = "m1{}"; String expected = "m1p1"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } @Test public void testBetweenMessages() { String message = "m1{}m2"; String expected = "m1p1m2"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } @Test public void testChain1() { String message = "m1{}m2{}m3{}m4{}m5{}"; String expected = "m1p1m2p2m3p3m4p4m5p5"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1", "p2", "p3", "p4", "p5")); } @Test public void testChain2() { String message = "m1{}m2{}m3{}m4{}m5"; String expected = "m1p1m2p2m3p3m4p4m5"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1", "p2", "p3", "p4")); } @Test public void testChain3() { String message = "{}m1{}m2{}m3{}m4{}m5"; String expected = "p1m1p2m2p3m3p4m4p5m5"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1", "p2", "p3", "p4", "p5")); } @Test public void testChain4() { String message = "{}m1{}m2{}m3{}m4{}"; String expected = "p1m1p2m2p3m3p4m4p5"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1", "p2", "p3", "p4", "p5")); } @Test public void testTooManyParts() { String message = "m1{}m2"; String expected = "m1p1m2"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1", "p2")); } @Test public void testTooFewParts() { String message = "m1{}m2{}"; String expected = "m1p1m2{}"; Assert.assertEquals(expected, MessageFormatter.format(message, "p1")); } }
amidst
src\test\java\amidst\devtools\settings\DevToolSettings.java
package amidst.devtools.settings; import java.util.Properties; import amidst.ResourceLoader; import amidst.documentation.Immutable; @Immutable public enum DevToolSettings { INSTANCE; private final Properties properties = ResourceLoader.getProperties("/amidst/devtools/devtools.properties"); public String getMinecraftVersionsDirectory() { return properties.getProperty("amidst.devtools.directory.versions"); } public String getMinecraftLibrariesDirectory() { return properties.getProperty("amidst.devtools.directory.libraries"); } public String getBiomeColorImagesDirectory() { return properties.getProperty("amidst.devtools.directory.biome.color.images"); } public String getBenchmarksDirectory() { return properties.getProperty("amidst.devtools.directory.benchmarks"); } }
amidst
src\test\java\amidst\devtools\utils\RecognisedVersionEnumBuilder.java
package amidst.devtools.utils; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.function.Function; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.minecraftinterface.RecognisedVersion; /** * First, add all known, then add all launcher version ids. */ @NotThreadSafe public class RecognisedVersionEnumBuilder { public static RecognisedVersionEnumBuilder createPopulated() { RecognisedVersionEnumBuilder result = new RecognisedVersionEnumBuilder(); for (RecognisedVersion recognisedVersion : RecognisedVersion.values()) { result.addKnown(recognisedVersion); } return result; } private final Map<String, RecognisedVersionEnumEntryBuilder> builders = new LinkedHashMap<>(); private int maxNameLength; private int maxDeclarationLength; public void addKnown(RecognisedVersion recognisedVersion) { if (recognisedVersion.isKnown()) { builders.put( recognisedVersion.getMagicString(), RecognisedVersionEnumEntryBuilder.known(recognisedVersion)); } } public void addLauncherVersionId(String versionId, String magicString) { RecognisedVersionEnumEntryBuilder builder = builders.get(magicString); if (builder != null) { builder.addMatch(versionId); } else { builders.put(magicString, RecognisedVersionEnumEntryBuilder.unknown(versionId, magicString)); } } public void calculateMaxLength() { maxNameLength = getMaxNameLength(); maxDeclarationLength = renderDeclarationsAndGetMaxLength(maxNameLength); } private int getMaxNameLength() { int result = 0; for (RecognisedVersionEnumEntryBuilder builder : builders.values()) { result = Math.max(result, builder.getName().length()); } return result; } private int renderDeclarationsAndGetMaxLength(int maxNameLength) { int result = 0; for (RecognisedVersionEnumEntryBuilder builder : builders.values()) { result = Math.max(result, builder.renderDeclarationAndGetLength(maxNameLength)); } return result; } public Iterable<String> renderNew() { List<String> result = new LinkedList<>(); render(result, b -> !b.isKnown(), b -> b.renderLine(maxNameLength, maxDeclarationLength)); return result; } public Iterable<String> renderRenamed() { List<String> result = new LinkedList<>(); render(result, b -> b.isRenamed(), b -> b.renderLine(maxNameLength, maxDeclarationLength)); return result; } public Iterable<String> renderComplete() { List<String> result = new LinkedList<>(); render(result, b -> !b.isKnown(), b -> b.renderLine(maxNameLength, maxDeclarationLength)); render(result, b -> b.isKnown(), b -> b.renderLine(maxNameLength, maxDeclarationLength)); return result; } private void render( List<String> result, Function<RecognisedVersionEnumEntryBuilder, Boolean> condition, Function<RecognisedVersionEnumEntryBuilder, String> renderer) { for (RecognisedVersionEnumEntryBuilder builder : builders.values()) { if (condition.apply(builder)) { result.add(renderer.apply(builder)); } } } }
amidst
src\test\java\amidst\devtools\utils\RecognisedVersionEnumEntryBuilder.java
package amidst.devtools.utils; import java.util.LinkedList; import java.util.List; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.minecraftinterface.RecognisedVersion; @NotThreadSafe public class RecognisedVersionEnumEntryBuilder { public static RecognisedVersionEnumEntryBuilder known(RecognisedVersion recognisedVersion) { return new RecognisedVersionEnumEntryBuilder( true, recognisedVersion.getName(), recognisedVersion.getMagicString()); } public static RecognisedVersionEnumEntryBuilder unknown(String versionId, String magicString) { RecognisedVersionEnumEntryBuilder result = new RecognisedVersionEnumEntryBuilder(false, versionId, magicString); result.addMatch(versionId); return result; } private final boolean isKnown; private final String knownName; private final String magicString; private final List<String> matches = new LinkedList<>(); private String declaration; public RecognisedVersionEnumEntryBuilder(boolean isKnown, String knownName, String magicString) { this.isKnown = isKnown; this.knownName = knownName; this.magicString = magicString; } public boolean isKnown() { return isKnown; } public String getName() { if (matches.isEmpty()) { return knownName; } else { return matches.get(0); } } public String getMagicString() { return magicString; } public boolean isRenamed() { return !getName().equals(knownName); } public void addMatch(String versionId) { matches.add(versionId); } public int renderDeclarationAndGetLength(int maxNameLength) { String enumIdentifier = createEnumIdentifier(maxNameLength); String name = quoteName(maxNameLength); declaration = enumIdentifier + "(" + name + "\"" + magicString + "\"),"; return declaration.length(); } private String createEnumIdentifier(int maxNameLength) { return addPadding(RecognisedVersion.createEnumIdentifier(getName()), maxNameLength + 1); } private String quoteName(int maxNameLength) { return addPadding("\"" + getName() + "\",", maxNameLength + 4); } public String renderLine(int maxNameLength, int maxDeclarationLength) { return addPadding(declaration, maxDeclarationLength) + getComment(maxNameLength); } private String getComment(int maxNameLength) { if (matches.isEmpty()) { return " // matches the launcher version id: "; } else { StringBuilder b = new StringBuilder(); b.append(" // matches the launcher version id: "); int length = maxNameLength + 3; b.append(addPadding(matches.get(0), length)); for (int i = 1; i < matches.size(); i++) { b.append(addPadding(matches.get(i), length)); } return b.toString(); } } private String addPadding(String declaration, int length) { return declaration + getStringOfLength(' ', length - declaration.length()); } private String getStringOfLength(char c, int length) { String result = ""; for (int i = 0; i < length; i++) { result += c; } return result; } }
amidst
src\test\java\amidst\devtools\utils\VersionStateRenderer.java
package amidst.devtools.utils; import amidst.mojangapi.file.Version; public class VersionStateRenderer { public String render(Version version, boolean hasServer, boolean hasClient) { return toBox(hasServer, 'S') + " " + toBox(hasClient, 'C') + " " + version.getType().getTypeChar() + " " + version.getId(); } private String toBox(boolean value, char c) { if (value) { return "[" + c + "]"; } else { return "[ ]"; } } }
amidst
src\test\java\amidst\mojangapi\mocking\BenchmarkingMinecraftInterface.java
package amidst.mojangapi.mocking; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.function.Function; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.mocking.json.BiomeRequestRecordJson; import amidst.mojangapi.world.Dimension; import amidst.mojangapi.world.WorldOptions; @ThreadSafe public class BenchmarkingMinecraftInterface implements MinecraftInterface { private final MinecraftInterface inner; private final List<BiomeRequestRecordJson> records; public BenchmarkingMinecraftInterface(MinecraftInterface inner, List<BiomeRequestRecordJson> records) { this.inner = inner; this.records = Collections.synchronizedList(records); } @Override public MinecraftInterface.WorldAccessor createWorldAccessor(WorldOptions worldOptions) throws MinecraftInterfaceException { return new WorldAccessor(inner.createWorldAccessor(worldOptions)); } @Override public RecognisedVersion getRecognisedVersion() { return inner.getRecognisedVersion(); } private class WorldAccessor implements MinecraftInterface.WorldAccessor { private final MinecraftInterface.WorldAccessor innerWorld; private WorldAccessor(MinecraftInterface.WorldAccessor innerWorld) { this.innerWorld = innerWorld; } @Override public<T> T getBiomeData(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, Function<int[], T> biomeDataMapper) throws MinecraftInterfaceException { long start = System.nanoTime(); return innerWorld.getBiomeData(dimension, x, y, width, height, useQuarterResolution, biomeData -> { long end = System.nanoTime(); String thread = Thread.currentThread().getName(); records.add(new BiomeRequestRecordJson(x, y, width, height, useQuarterResolution, start, end-start, thread)); return biomeDataMapper.apply(biomeData); }); } @Override public Set<Dimension> supportedDimensions() { return innerWorld.supportedDimensions(); } } }
amidst
src\test\java\amidst\mojangapi\mocking\BiomeDataJsonBuilder.java
package amidst.mojangapi.mocking; import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.world.Dimension; import amidst.mojangapi.world.testworld.storage.json.AreaJson; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; @NotThreadSafe public class BiomeDataJsonBuilder { private final SortedMap<AreaJson, short[]> quarterBiomeData = new TreeMap<>(); private final SortedMap<AreaJson, short[]> fullBiomeData = new TreeMap<>(); public void store(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, int[] biomeData) { store(getBiomeDataMap(useQuarterResolution), dimension, x, y, width, height, biomeData); } private Map<AreaJson, short[]> getBiomeDataMap(boolean useQuarterResolution) { if (useQuarterResolution) { return quarterBiomeData; } else { return fullBiomeData; } } private void store(Map<AreaJson, short[]> biomeDataMap, Dimension dimension, int x, int y, int width, int height, int[] biomeData) { // Store biome data, and trim the array to exclude potential garbage data // at the end, which isn't deterministic biomeDataMap.put(new AreaJson(dimension, x, y, width, height), BiomeDataJson.int2short(biomeData, width*height)); } public BiomeDataJson createQuarterBiomeData() { return new BiomeDataJson(quarterBiomeData); } public BiomeDataJson createFullBiomeData() { return new BiomeDataJson(fullBiomeData); } }
amidst
src\test\java\amidst\mojangapi\mocking\FakeMinecraftInterface.java
package amidst.mojangapi.mocking; import java.util.EnumSet; import java.util.Set; import java.util.function.Function; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.Dimension; import amidst.mojangapi.world.WorldOptions; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; import amidst.mojangapi.world.testworld.storage.json.WorldMetadataJson; @ThreadSafe public class FakeMinecraftInterface implements MinecraftInterface { private final WorldMetadataJson worldMetadataJson; private final BiomeDataJson quarterBiomeData; private final BiomeDataJson fullBiomeData; public FakeMinecraftInterface( WorldMetadataJson worldMetadataJson, BiomeDataJson quarterBiomeData, BiomeDataJson fullBiomeData) { this.worldMetadataJson = worldMetadataJson; this.quarterBiomeData = quarterBiomeData; this.fullBiomeData = fullBiomeData; } @Override public MinecraftInterface.WorldAccessor createWorldAccessor(WorldOptions worldOptions) throws MinecraftInterfaceException { if (worldMetadataJson.getSeed() == worldOptions.getWorldSeed().getLong() && worldMetadataJson.getWorldType().equals(worldOptions.getWorldType()) && worldOptions.getGeneratorOptions().isEmpty()) { return new WorldAccessor(); } else { throw new MinecraftInterfaceException("the world has to match"); } } @Override public RecognisedVersion getRecognisedVersion() { return worldMetadataJson.getRecognisedVersion(); } private class WorldAccessor implements MinecraftInterface.WorldAccessor { private WorldAccessor() { } @Override public<T> T getBiomeData(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, Function<int[], T> biomeDataMapper) throws MinecraftInterfaceException { BiomeDataJson biomes = useQuarterResolution ? quarterBiomeData : fullBiomeData; return biomeDataMapper.apply(biomes.get(dimension, x, y, width, height)); } @Override public Set<Dimension> supportedDimensions() { return EnumSet.allOf(Dimension.class); } } }
amidst
src\test\java\amidst\mojangapi\mocking\FakeWorldBuilder.java
package amidst.mojangapi.mocking; import java.util.Map; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.world.World; import amidst.mojangapi.world.WorldBuilder; import amidst.mojangapi.world.testworld.TestWorldDeclaration; import amidst.mojangapi.world.testworld.TestWorldEntryNames; import amidst.mojangapi.world.testworld.file.TestWorldDirectory; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; import amidst.mojangapi.world.testworld.storage.json.WorldMetadataJson; @ThreadSafe public class FakeWorldBuilder { public static FakeWorldBuilder create(TestWorldDirectoryDeclaration directoryDeclaration) { return new FakeWorldBuilder(WorldBuilder.createSilentPlayerless(), directoryDeclaration); } private final WorldBuilder builder; private final TestWorldDirectoryDeclaration directoryDeclaration; public FakeWorldBuilder(WorldBuilder builder, TestWorldDirectoryDeclaration directoryDeclaration) { this.builder = builder; this.directoryDeclaration = directoryDeclaration; } public World createRealWorld(TestWorldDeclaration worldDeclaration, MinecraftInterface realMinecraftInterface) throws MinecraftInterfaceException { return builder.from( realMinecraftInterface, worldDeclaration.getWorldOptions()); } public World createFakeWorld(TestWorldDirectory worldDeclaration) throws MinecraftInterfaceException { Map<String, Object> data = worldDeclaration.getData(); // @formatter:off WorldMetadataJson worldMetadata = get(TestWorldEntryNames.METADATA, WorldMetadataJson.class, data); BiomeDataJson quarterBiomeData = get(TestWorldEntryNames.QUARTER_RESOLUTION_BIOME_DATA, BiomeDataJson.class, data); BiomeDataJson fullBiomeData = get(TestWorldEntryNames.FULL_RESOLUTION_BIOME_DATA, BiomeDataJson.class, data); // @formatter:on return createFakeWorld(worldMetadata, quarterBiomeData, fullBiomeData); } private <T> T get(String name, Class<T> clazz, Map<String, Object> data) { return directoryDeclaration.getEntryDeclaration(name, clazz).extractFromDataMap(data); } private World createFakeWorld( WorldMetadataJson worldMetadata, BiomeDataJson quarterBiomeData, BiomeDataJson fullBiomeData) throws MinecraftInterfaceException { return builder.from( createFakeMinecraftInterface(worldMetadata, quarterBiomeData, fullBiomeData), worldMetadata.intoWorldOptions()); } private static FakeMinecraftInterface createFakeMinecraftInterface( WorldMetadataJson worldMetadataJson, BiomeDataJson quarterBiomeData, BiomeDataJson fullBiomeData) { return new FakeMinecraftInterface(worldMetadataJson, quarterBiomeData, fullBiomeData); } }
amidst
src\test\java\amidst\mojangapi\mocking\FragmentCornerWalker.java
package amidst.mojangapi.mocking; import java.util.function.Consumer; import amidst.documentation.Immutable; import amidst.fragment.Fragment; import amidst.mojangapi.world.coordinates.CoordinatesInWorld; @Immutable public class FragmentCornerWalker { public static FragmentCornerWalker walkFragmentsAroundOrigin(int fragmentsAroundOrigin) { long blocksAroundOrigin = fragmentsAroundOrigin * Fragment.SIZE; CoordinatesInWorld startCorner = CoordinatesInWorld.from(-blocksAroundOrigin, -blocksAroundOrigin); CoordinatesInWorld endCorner = startCorner.add(2 * blocksAroundOrigin, 2 * blocksAroundOrigin); return new FragmentCornerWalker(startCorner, endCorner); } private final CoordinatesInWorld startCorner; private final CoordinatesInWorld endCorner; public FragmentCornerWalker(CoordinatesInWorld startCorner, CoordinatesInWorld endCorner) { this.startCorner = startCorner; this.endCorner = endCorner; } public <T> void walk(Consumer<CoordinatesInWorld> consumer) { for (long x = startCorner.getX(); x < endCorner.getX(); x += Fragment.SIZE) { for (long y = startCorner.getY(); y < endCorner.getY(); y += Fragment.SIZE) { consumer.accept(CoordinatesInWorld.from(x, y)); } } } }
amidst
src\test\java\amidst\mojangapi\mocking\RequestStoringMinecraftInterface.java
package amidst.mojangapi.mocking; import java.util.Set; import java.util.function.Function; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.Dimension; import amidst.mojangapi.world.WorldOptions; @ThreadSafe public class RequestStoringMinecraftInterface implements MinecraftInterface { private final MinecraftInterface realMinecraftInterface; private final BiomeDataJsonBuilder builder; public RequestStoringMinecraftInterface(MinecraftInterface realMinecraftInterface, BiomeDataJsonBuilder builder) { this.realMinecraftInterface = realMinecraftInterface; this.builder = builder; } private void store(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, int[] biomeData) { builder.store(dimension, x, y, width, height, useQuarterResolution, biomeData); } @Override public synchronized MinecraftInterface.WorldAccessor createWorldAccessor(WorldOptions worldOptions) throws MinecraftInterfaceException { return new WorldAccessor(realMinecraftInterface.createWorldAccessor(worldOptions)); } @Override public synchronized RecognisedVersion getRecognisedVersion() { return realMinecraftInterface.getRecognisedVersion(); } private class WorldAccessor implements MinecraftInterface.WorldAccessor { private final MinecraftInterface.WorldAccessor realMinecraftWorld; private WorldAccessor(MinecraftInterface.WorldAccessor realMinecraftWorld) { this.realMinecraftWorld = realMinecraftWorld; } @Override public synchronized<T> T getBiomeData(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, Function<int[], T> biomeDataMapper) throws MinecraftInterfaceException { return realMinecraftWorld.getBiomeData(dimension, x, y, width, height, useQuarterResolution, biomeData -> { store(dimension, x, y, width, height, useQuarterResolution, biomeData); return biomeDataMapper.apply(biomeData); }); } @Override public Set<Dimension> supportedDimensions() { return realMinecraftWorld.supportedDimensions(); } } }
amidst
src\test\java\amidst\mojangapi\mocking\json\BiomeRequestRecordJson.java
package amidst.mojangapi.mocking.json; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; @Immutable public class BiomeRequestRecordJson { public volatile int x; public volatile int y; public volatile int width; public volatile int height; public volatile boolean isQuarterResolution; public volatile long startTime; public volatile long duration; public volatile String threadName; @GsonConstructor public BiomeRequestRecordJson() { } public BiomeRequestRecordJson(int x, int y, int width, int height, boolean isQuarterResolution, long startTime, long duration, String threadName) { this.x = x; this.y = y; this.width = width; this.height = height; this.isQuarterResolution = isQuarterResolution; this.startTime = startTime; this.duration = duration; this.threadName = threadName; } }
amidst
src\test\java\amidst\mojangapi\world\test\CoordinateUtilsTest.java
package amidst.mojangapi.world.test; import org.junit.Assert; import org.junit.Test; import amidst.mojangapi.world.coordinates.CoordinateUtils; public class CoordinateUtilsTest { @Test public void testCoordinateConversion() { Assert.assertTrue(ensureCoordinateConversionWorks()); } private static boolean ensureCoordinateConversionWorks() { for (long inWorld = -1000; inWorld < 1000; inWorld++) { long inFragment = CoordinateUtils.toFragmentRelative(inWorld); long inWorldOfFragment = CoordinateUtils.toFragmentCorner(inWorld); long actualInWorld = CoordinateUtils.toWorld(inWorldOfFragment, inFragment); if (inWorld != actualInWorld) { return false; } } return true; } }
amidst
src\test\java\amidst\mojangapi\world\test\RecognisedVersionTest.java
package amidst.mojangapi.world.test; import org.junit.Assert; import org.junit.Test; import amidst.mojangapi.minecraftinterface.RecognisedVersion; public class RecognisedVersionTest { @Test public void shouldPreventNameCollisions() { RecognisedVersion.generateNameToRecognisedVersionMap(); } @Test public void shouldPreventMagicStringCollisions() { RecognisedVersion.generateMagicStringToRecognisedVersionMap(); } @Test public void shouldPreventDifferencesInIdentifierAndName() { for (RecognisedVersion recognisedVersion : RecognisedVersion.values()) { if (recognisedVersion.isKnown()) { String expectedIdentifier = RecognisedVersion.createEnumIdentifier(recognisedVersion.getName()); String actualIdentifier = recognisedVersion.name(); Assert.assertEquals(expectedIdentifier, actualIdentifier); } } } }
amidst
src\test\java\amidst\mojangapi\world\test\TestWorldEntryEquality.java
package amidst.mojangapi.world.test; import static org.junit.Assert.fail; import org.junit.Test; import amidst.mojangapi.world.testworld.TestWorld; import amidst.mojangapi.world.testworld.TestWorldCache; import amidst.mojangapi.world.testworld.TestWorldDeclaration; public class TestWorldEntryEquality { @Test public void shouldGenerateSameEntries() { for (TestWorldDeclaration worldDeclaration : TestWorldDeclaration.values()) { TestWorld testWorld = TestWorldCache.get(worldDeclaration); for (String name : worldDeclaration.getSupportedEntryNames()) { if (!testWorld.isDirectoryAndWorldEntryEqual(name)) { fail("entry changed: [world: " + worldDeclaration + ", entry: " + name + "]"); } } } } }
amidst
src\test\java\amidst\mojangapi\world\test\VersionFeaturesTest.java
package amidst.mojangapi.world.test; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Set; import java.util.function.Function; import org.junit.Test; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.Dimension; import amidst.mojangapi.world.WorldOptions; import amidst.mojangapi.world.WorldSeed; import amidst.mojangapi.world.WorldType; import amidst.mojangapi.world.versionfeatures.DefaultVersionFeatures; import amidst.mojangapi.world.versionfeatures.FeatureKey; import amidst.mojangapi.world.versionfeatures.VersionFeatures; public class VersionFeaturesTest { @Test public void shouldHaveAllRequiredFeatures() throws IllegalAccessException { List<FeatureKey<?>> requiredFeatures = getRequiredFeatures(); VersionFeatures.Builder versionFeaturesBuilder = createVersionFeaturesBuilder(); for (RecognisedVersion recognisedVersion: RecognisedVersion.values()) { VersionFeatures versionFeatures = versionFeaturesBuilder.create(recognisedVersion); for (FeatureKey<?> requiredFeature: requiredFeatures) { // will throw if the feature doesn't exist or is null. versionFeatures.get(requiredFeature); } } } public VersionFeatures.Builder createVersionFeaturesBuilder() { WorldOptions worldOptions = new WorldOptions(WorldSeed.fromSaveGame(0), WorldType.DEFAULT); MinecraftInterface.WorldAccessor minecraftWorld = new MockMinecraftWorldAccessor(); return DefaultVersionFeatures.builder(worldOptions, minecraftWorld); } public List<FeatureKey<?>> getRequiredFeatures() throws IllegalAccessException { List<FeatureKey<?>> features = new ArrayList<>(); for (Field field: FeatureKey.class.getDeclaredFields()) { int modifiers = field.getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) { if (field.getType().isAssignableFrom(FeatureKey.class)) { features.add((FeatureKey<?>) field.get(null)); } } } return features; } private static class MockMinecraftWorldAccessor implements MinecraftInterface.WorldAccessor { @Override public<T> T getBiomeData(Dimension dimension, int x, int y, int width, int height, boolean useQuarterResolution, Function<int[], T> biomeDataMapper) { throw new UnsupportedOperationException(); } @Override public Set<Dimension> supportedDimensions() { return EnumSet.allOf(Dimension.class); } } }
amidst
src\test\java\amidst\mojangapi\world\testworld\DefaultTestWorldDirectoryDeclaration.java
package amidst.mojangapi.world.testworld; import java.util.function.Function; import amidst.documentation.Immutable; import amidst.mojangapi.world.World; import amidst.mojangapi.world.icon.producer.WorldIconProducer; import amidst.mojangapi.world.icon.type.DefaultWorldIconTypes; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.io.TestWorldEntrySerializer; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; import amidst.mojangapi.world.testworld.storage.json.CoordinatesCollectionJson; import amidst.mojangapi.world.testworld.storage.json.EndIslandsJson; import amidst.mojangapi.world.testworld.storage.json.SlimeChunksJson; import amidst.mojangapi.world.testworld.storage.json.WorldMetadataJson; @Immutable public enum DefaultTestWorldDirectoryDeclaration { INSTANCE; public static TestWorldDirectoryDeclaration get() { return INSTANCE.declaration; } /** * This should always be 0. Only change it when trying to find a good test * world. */ private static final int MINIMAL_NUMBER_OF_COORDINATES = 0; private static final int OVERWORLD_FRAGMENTS_AROUND_ORIGIN = 10; private static final int END_FRAGMENTS_AROUND_ORIGIN = 4; private final TestWorldDirectoryDeclaration declaration = createDeclaration(); private TestWorldDirectoryDeclaration createDeclaration() { // @formatter:off return TestWorldDirectoryDeclaration.builder() .entry(TestWorldEntryNames.METADATA, WorldMetadataJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readMetaData) .extractor(WorldMetadataJson::from) .skipEqualityCheck() .entry(TestWorldEntryNames.QUARTER_RESOLUTION_BIOME_DATA, BiomeDataJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readBiomeData) .extractor(biomeDataExtractor()) .skipEqualityCheck() .entry(TestWorldEntryNames.FULL_RESOLUTION_BIOME_DATA, BiomeDataJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readBiomeData) .extractor(biomeDataExtractor()) .skipEqualityCheck() .entry(TestWorldEntryNames.END_ISLANDS, EndIslandsJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readEndIslands) .extractor(endIslandExtractor()) .equalityChecker(EndIslandsJson::equals) .entry(TestWorldEntryNames.SLIME_CHUNKS, SlimeChunksJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readSlimeChunks) .extractor(SlimeChunksJson::from) .equalityChecker(SlimeChunksJson::equals) .entry(TestWorldEntryNames.SPAWN, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(CoordinatesCollectionJson::extractWorldSpawn) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.STRONGHOLDS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(CoordinatesCollectionJson::extractStrongholds) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.VILLAGES, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getVillageProducer, DefaultWorldIconTypes.VILLAGE)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.WITCH_HUTS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.WITCH)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.JUNGLE_TEMPLES, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.JUNGLE)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.DESERT_TEMPLES, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.DESERT)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.IGLOOS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.IGLOO)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.OCEAN_RUINS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.OCEAN_RUINS)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.SHIPWRECKS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getTempleProducer, DefaultWorldIconTypes.SHIPWRECK)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.MINESHAFTS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getMineshaftProducer, DefaultWorldIconTypes.MINESHAFT)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.OCEAN_MONUMENTS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getOceanMonumentProducer, DefaultWorldIconTypes.OCEAN_MONUMENT)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.WOODLAND_MANSIONS, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getWoodlandMansionProducer, DefaultWorldIconTypes.WOODLAND_MANSION)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.NETHER_FORTRESSES, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(worldIconExtractor(World::getNetherFortressProducer, DefaultWorldIconTypes.NETHER_FORTRESS)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.LIKELY_END_CITY, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(endCityExtractor(DefaultWorldIconTypes.END_CITY)) .equalityChecker(CoordinatesCollectionJson::equals) .entry(TestWorldEntryNames.POSSIBLE_END_CITY, CoordinatesCollectionJson.class) .serializer(TestWorldEntrySerializer::writeJson) .deserializer(TestWorldEntrySerializer::readCoordinatesCollection) .extractor(endCityExtractor(DefaultWorldIconTypes.POSSIBLE_END_CITY)) .equalityChecker(CoordinatesCollectionJson::equals) .create(); // @formatter:on } private Function<World, BiomeDataJson> biomeDataExtractor() { return world -> { throw new UnsupportedOperationException( "the biome data are extracted with a special mechanism: the class RequestStoringMinecraftInterface"); }; } private Function<World, EndIslandsJson> endIslandExtractor() { return world -> EndIslandsJson.extract(world.getEndIslandOracle(), END_FRAGMENTS_AROUND_ORIGIN); } private Function<World, CoordinatesCollectionJson> worldIconExtractor( Function<World, WorldIconProducer<Void>> producer, DefaultWorldIconTypes worldIconType) { return world -> CoordinatesCollectionJson.extractWorldIcons( producer.apply(world), worldIconType.getLabel(), corner -> null, OVERWORLD_FRAGMENTS_AROUND_ORIGIN, MINIMAL_NUMBER_OF_COORDINATES); } private Function<World, CoordinatesCollectionJson> endCityExtractor(DefaultWorldIconTypes worldIconType) { return world -> CoordinatesCollectionJson.extractWorldIcons( world.getEndCityProducer(), worldIconType.getLabel(), corner -> world.getEndIslandOracle().getAt(corner), END_FRAGMENTS_AROUND_ORIGIN, MINIMAL_NUMBER_OF_COORDINATES); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\TestWorld.java
package amidst.mojangapi.world.testworld; import amidst.documentation.ThreadSafe; import amidst.mojangapi.world.World; import amidst.mojangapi.world.testworld.file.TestWorldDirectory; @ThreadSafe public class TestWorld { private final World world; private final TestWorldDirectory directory; public TestWorld(World world, TestWorldDirectory directory) { this.world = world; this.directory = directory; } public World getWorld() { return world; } public TestWorldDirectory getDirectory() { return directory; } public <T> T getEntryValue(String name, Class<T> clazz) { return directory.getEntryValue(name, clazz); } public <T> T extractFromWorld(String name, Class<T> clazz) { return directory.extractFromWorld(name, clazz, world); } public boolean isDirectoryAndWorldEntryEqual(String name) { return directory.isDirectoryAndWorldEntryEqual(name, world); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\TestWorldBuilder.java
package amidst.mojangapi.world.testworld; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.mocking.BiomeDataJsonBuilder; import amidst.mojangapi.mocking.FakeWorldBuilder; import amidst.mojangapi.mocking.RequestStoringMinecraftInterface; import amidst.mojangapi.world.World; import amidst.mojangapi.world.testworld.file.TestWorldDirectory; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.io.TestWorldDirectoryReader; import amidst.mojangapi.world.testworld.io.TestWorldDirectoryWriter; @ThreadSafe public class TestWorldBuilder { public static TestWorldBuilder from(TestWorldDirectoryDeclaration directoryDeclaration) { return new TestWorldBuilder(directoryDeclaration, FakeWorldBuilder.create(directoryDeclaration)); } private final TestWorldDirectoryDeclaration directoryDeclaration; private final FakeWorldBuilder worldBuilder; public TestWorldBuilder(TestWorldDirectoryDeclaration directoryDeclaration, FakeWorldBuilder worldBuilder) { this.directoryDeclaration = directoryDeclaration; this.worldBuilder = worldBuilder; } public TestWorldDirectoryReader createReader() { return new TestWorldDirectoryReader(directoryDeclaration); } public TestWorldDirectoryWriter createWriter() { return new TestWorldDirectoryWriter(directoryDeclaration); } public TestWorldDirectory createDirectory( TestWorldDeclaration worldDeclaration, MinecraftInterface realMinecraftInterface) throws MinecraftInterfaceException { BiomeDataJsonBuilder builder = new BiomeDataJsonBuilder(); RequestStoringMinecraftInterface minecraftInterface = new RequestStoringMinecraftInterface( realMinecraftInterface, builder); World realWorld = worldBuilder.createRealWorld(worldDeclaration, minecraftInterface); return directoryDeclaration .create(worldDeclaration, realWorld, builder.createQuarterBiomeData(), builder.createFullBiomeData()); } public TestWorld createTestWorld(TestWorldDirectory directory) throws MinecraftInterfaceException { World world = worldBuilder.createFakeWorld(directory); return new TestWorld(world, directory); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\TestWorldCache.java
package amidst.mojangapi.world.testworld; import java.io.FileNotFoundException; import java.io.IOException; import java.util.concurrent.ConcurrentHashMap; import amidst.documentation.ThreadSafe; import amidst.mojangapi.minecraftinterface.MinecraftInterface; import amidst.mojangapi.minecraftinterface.MinecraftInterfaceException; import amidst.mojangapi.world.testworld.io.TestWorldDirectoryReader; import amidst.mojangapi.world.testworld.io.TestWorldDirectoryWriter; @ThreadSafe public enum TestWorldCache { INSTANCE; public static TestWorld get(TestWorldDeclaration declaration) { try { return INSTANCE.createIfNecessaryAndGet(declaration); } catch (IOException | MinecraftInterfaceException e) { throw new RuntimeException("unable to load testdata", e); } } public static void createAndPut(TestWorldDeclaration declaration, MinecraftInterface realMinecraftInterface) throws MinecraftInterfaceException, FileNotFoundException, IOException { INSTANCE.doCreateAndPut(declaration, realMinecraftInterface); } private final TestWorldBuilder builder = TestWorldBuilder.from(DefaultTestWorldDirectoryDeclaration.get()); private final TestWorldDirectoryReader reader = builder.createReader(); private final TestWorldDirectoryWriter writer = builder.createWriter(); private final ConcurrentHashMap<TestWorldDeclaration, TestWorld> cache = new ConcurrentHashMap<>(); public void doCreateAndPut(TestWorldDeclaration declaration, MinecraftInterface realMinecraftInterface) throws MinecraftInterfaceException, FileNotFoundException, IOException { writer.write(declaration, builder.createDirectory(declaration, realMinecraftInterface)); } public TestWorld createIfNecessaryAndGet(TestWorldDeclaration declaration) throws IOException, MinecraftInterfaceException { TestWorld result = cache.get(declaration); if (result != null) { return result; } else { create(declaration); return cache.get(declaration); } } private synchronized void create(TestWorldDeclaration declaration) throws IOException, MinecraftInterfaceException { cache.putIfAbsent(declaration, builder.createTestWorld(reader.read(declaration))); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\TestWorldDeclaration.java
package amidst.mojangapi.world.testworld; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Collections; import java.util.List; import amidst.documentation.Immutable; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.WorldOptions; import amidst.mojangapi.world.WorldSeed; import amidst.mojangapi.world.WorldType; @Immutable public enum TestWorldDeclaration { // @formatter:off /** * Not all worlds will have data in all entries. However, we should ensure * that the behavior is kept like this. */ WORLD1(RecognisedVersion._1_8_9, "amidst-test-seed", WorldType.DEFAULT, TestWorldEntryNames.ALL ), WORLD2(RecognisedVersion._1_9_pre2, "4805355321235747910", WorldType.DEFAULT, TestWorldEntryNames.ALL ), /** * This misses an ocean monument if the quarter-resolution map is used for the structure test. */ WORLD3(RecognisedVersion._1_9_pre2, "-1364077613", WorldType.DEFAULT, TestWorldEntryNames.ALL ), /** * This illustrates the buggy stronghold generation mechanism of the 1.9 snapshots. */ WORLD4(RecognisedVersion._15w51b, "1", WorldType.DEFAULT, TestWorldEntryNames.ALL ), /** * This illustrates the fixed stronghold generation mechanism of the 1.9 snapshots. */ WORLD5(RecognisedVersion._1_9_pre2, "1", WorldType.DEFAULT, TestWorldEntryNames.ALL ), /** * This seed contains all biomes in a 1024 radius around spawn. Source: * http://www.minecraftforum.net/forums/minecraft-discussion/seeds/2500520-1-8-x-rare-seed-all-biomes-within-1024-blocks */ WORLD6(RecognisedVersion._1_9_pre2, "24922", WorldType.DEFAULT, TestWorldEntryNames.ALL ), /** * Similar to 24922 */ WORLD7(RecognisedVersion._1_9_pre2, "-9223372036681075344", WorldType.DEFAULT, TestWorldEntryNames.ALL ); // @formatter:on private static final String RESOURCE_PREFIX = "/amidst/mojangapi/world/testworld/storage/"; private static final String ZIP_FILE_EXTENSION = ".zip"; private final RecognisedVersion recognisedVersion; private final WorldOptions worldOptions; private final List<String> supportedEntryNames; private final java.nio.file.Path directory; private final String directoryString; private TestWorldDeclaration( RecognisedVersion recognisedVersion, String seed, WorldType worldType, String... supported) { this.recognisedVersion = recognisedVersion; WorldSeed worldSeed = WorldSeed.fromUserInput(seed); this.worldOptions = new WorldOptions(worldSeed, worldType); this.supportedEntryNames = Collections.unmodifiableList(Arrays.asList(supported)); this.directory = Paths.get( "src", "test", "resources", "amidst", "mojangapi", "world", "testworld", "storage", recognisedVersion.getName(), "" + worldSeed.getLong()); this.directoryString = RESOURCE_PREFIX + recognisedVersion.getName() + "/" + worldSeed.getLong() + "/"; } public RecognisedVersion getRecognisedVersion() { return recognisedVersion; } public WorldOptions getWorldOptions() { return worldOptions; } public boolean isSupported(String name) { return supportedEntryNames.contains(name); } public Iterable<String> getSupportedEntryNames() { return supportedEntryNames; } public void createDirectoryIfNecessary() { try { Files.createDirectories(directory); } catch (IOException e) { throw new RuntimeException("Couldn't create test worlds directory", e); } } public Path getDirectory() { return directory; } public Path getZipFile(String name) { return directory.resolve(name + ZIP_FILE_EXTENSION); } public String getZipResourceName(String name) { return directoryString + name + ZIP_FILE_EXTENSION; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\TestWorldEntryNames.java
package amidst.mojangapi.world.testworld; import amidst.documentation.Immutable; @Immutable public class TestWorldEntryNames { public static final String METADATA = "metadata"; public static final String QUARTER_RESOLUTION_BIOME_DATA = "quarter-resolution-biome-data"; public static final String FULL_RESOLUTION_BIOME_DATA = "full-resolution-biome-data"; public static final String END_ISLANDS = "end-islands"; public static final String SLIME_CHUNKS = "slime-chunks"; public static final String SPAWN = "spawn"; public static final String STRONGHOLDS = "strongholds"; public static final String VILLAGES = "villages"; public static final String WITCH_HUTS = "witch-huts"; public static final String JUNGLE_TEMPLES = "jungle-temples"; public static final String DESERT_TEMPLES = "desert-temples"; public static final String IGLOOS = "igloos"; public static final String OCEAN_RUINS = "ocean-ruins"; public static final String SHIPWRECKS = "shipwrecks"; public static final String MINESHAFTS = "mineshafts"; public static final String OCEAN_MONUMENTS = "ocean-monuments"; public static final String WOODLAND_MANSIONS = "woodland-mansions"; public static final String NETHER_FORTRESSES = "nether-fortresses"; public static final String LIKELY_END_CITY = "likely-end-city"; public static final String POSSIBLE_END_CITY = "possible-end-city"; public static final String[] ALL = { TestWorldEntryNames.METADATA, TestWorldEntryNames.QUARTER_RESOLUTION_BIOME_DATA, TestWorldEntryNames.FULL_RESOLUTION_BIOME_DATA, TestWorldEntryNames.END_ISLANDS, TestWorldEntryNames.SLIME_CHUNKS, TestWorldEntryNames.SPAWN, TestWorldEntryNames.STRONGHOLDS, TestWorldEntryNames.VILLAGES, TestWorldEntryNames.WITCH_HUTS, TestWorldEntryNames.JUNGLE_TEMPLES, TestWorldEntryNames.DESERT_TEMPLES, TestWorldEntryNames.IGLOOS, TestWorldEntryNames.OCEAN_RUINS, TestWorldEntryNames.SHIPWRECKS, TestWorldEntryNames.MINESHAFTS, TestWorldEntryNames.OCEAN_MONUMENTS, TestWorldEntryNames.WOODLAND_MANSIONS, TestWorldEntryNames.NETHER_FORTRESSES, TestWorldEntryNames.LIKELY_END_CITY, TestWorldEntryNames.POSSIBLE_END_CITY }; }
amidst
src\test\java\amidst\mojangapi\world\testworld\file\TestWorldDirectory.java
package amidst.mojangapi.world.testworld.file; import java.util.Map; import amidst.documentation.ThreadSafe; import amidst.mojangapi.world.World; @ThreadSafe public class TestWorldDirectory { private final TestWorldDirectoryDeclaration declaration; private final Map<String, Object> data; public TestWorldDirectory(TestWorldDirectoryDeclaration declaration, Map<String, Object> data) { this.declaration = declaration; this.data = data; } public Map<String, Object> getData() { return data; } public <T> T getEntryValue(String name, Class<T> clazz) { return declaration.getEntryDeclaration(name, clazz).extractFromDataMap(data); } public <T> T extractFromWorld(String name, Class<T> clazz, World world) { return declaration.getEntryDeclaration(name, clazz).extractFromWorld(world); } public boolean isDirectoryAndWorldEntryEqual(String name, World world) { return declaration.isDataMapAndWorldEntryEqual(name, data, world); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\file\TestWorldDirectoryDeclaration.java
package amidst.mojangapi.world.testworld.file; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import amidst.documentation.Immutable; import amidst.mojangapi.world.World; import amidst.mojangapi.world.testworld.TestWorldDeclaration; import amidst.mojangapi.world.testworld.TestWorldEntryNames; import amidst.mojangapi.world.testworld.file.builder.TestWorldDirectoryDeclarationBuilder; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; @Immutable public class TestWorldDirectoryDeclaration { public static TestWorldDirectoryDeclarationBuilder builder() { return new TestWorldDirectoryDeclarationBuilder(); } private final Map<String, TestWorldEntryDeclaration<?>> entries; public TestWorldDirectoryDeclaration(Map<String, TestWorldEntryDeclaration<?>> entries) { this.entries = entries; } public Iterable<TestWorldEntryDeclaration<?>> getEntryDeclarations() { return entries.values(); } public boolean containsEntry(String name) { return entries.containsKey(name); } public <T> TestWorldEntryDeclaration<T> getEntryDeclaration(String name, Class<T> clazz) { TestWorldEntryDeclaration<?> entry = entries.get(name); if (entry != null) { return entry.getAsEntryWithClazz(clazz); } else { throw new IllegalArgumentException("unknown entry: " + name); } } public TestWorldDirectory create( TestWorldDeclaration worldDeclaration, World world, BiomeDataJson quarterBiomeData, BiomeDataJson fullBiomeData) { Map<String, Object> data = new HashMap<>(); for (Entry<String, TestWorldEntryDeclaration<?>> entry : entries.entrySet()) { String name = entry.getKey(); if (name.equals(TestWorldEntryNames.QUARTER_RESOLUTION_BIOME_DATA)) { data.put(name, quarterBiomeData); } else if (name.equals(TestWorldEntryNames.FULL_RESOLUTION_BIOME_DATA)) { data.put(name, fullBiomeData); } else if (worldDeclaration.isSupported(name)) { TestWorldEntryDeclaration<?> entryDeclaration = entry.getValue(); data.put(name, entryDeclaration.extractFromWorld(world)); } } return new TestWorldDirectory(this, data); } public boolean isDataMapAndWorldEntryEqual(String name, Map<String, Object> data, World world) { return entries.get(name).isDataMapAndWorldEntryEqual(data, world); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\file\TestWorldEntryDeclaration.java
package amidst.mojangapi.world.testworld.file; import java.io.InputStream; import java.io.OutputStream; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.BiPredicate; import java.util.function.Function; import amidst.documentation.Immutable; import amidst.mojangapi.world.World; @Immutable public class TestWorldEntryDeclaration<T> { private final String name; private final Class<T> clazz; private final BiConsumer<OutputStream, T> serializer; private final Function<InputStream, T> deserializer; private final Function<World, T> extractor; private final BiPredicate<T, T> equalityChecker; private final boolean skipEqualityCheck; public TestWorldEntryDeclaration( String name, Class<T> clazz, BiConsumer<OutputStream, T> serializer, Function<InputStream, T> deserializer, Function<World, T> extractor, BiPredicate<T, T> equalityChecker, boolean skipEqualityCheck) { this.name = name; this.clazz = clazz; this.serializer = serializer; this.deserializer = deserializer; this.extractor = extractor; this.equalityChecker = equalityChecker; this.skipEqualityCheck = skipEqualityCheck; } public String getName() { return name; } public void writeToStream(OutputStream os, Map<String, Object> data) { serializer.accept(os, extractFromDataMap(data)); } public T readFromStream(InputStream is) { return deserializer.apply(is); } public T extractFromWorld(World world) { return extractor.apply(world); } public T extractFromDataMap(Map<String, Object> data) { return getAsClazz(getEntry(data)); } private Object getEntry(Map<String, Object> data) { if (data.containsKey(name)) { return data.get(name); } else { throw new IllegalArgumentException("unknown entry: " + name); } } @SuppressWarnings("unchecked") private T getAsClazz(Object object) { if (isMatchingClazz(object.getClass())) { return (T) object; } else { throw new ClassCastException(clazz + " is not assignable from " + object.getClass()); } } @SuppressWarnings("unchecked") public <E> TestWorldEntryDeclaration<E> getAsEntryWithClazz(Class<E> clazz) { if (isMatchingClazz(clazz)) { return (TestWorldEntryDeclaration<E>) this; } else { throw new ClassCastException(clazz + " is not assignable from " + clazz); } } private boolean isMatchingClazz(Class<?> clazz) { return this.clazz.isAssignableFrom(clazz); } public boolean isDataMapAndWorldEntryEqual(Map<String, Object> data, World world) { if (skipEqualityCheck) { return true; } else { return equalityChecker.test(extractFromDataMap(data), extractFromWorld(world)); } } }
amidst
src\test\java\amidst\mojangapi\world\testworld\io\TestWorldDirectoryReader.java
package amidst.mojangapi.world.testworld.io; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.zip.ZipInputStream; import amidst.ResourceLoader; import amidst.documentation.ThreadSafe; import amidst.mojangapi.world.testworld.TestWorldDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldDirectory; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldEntryDeclaration; @ThreadSafe public class TestWorldDirectoryReader { private static final String JSON_FILE_EXTENSION = ".json"; private final TestWorldDirectoryDeclaration directoryDeclaration; public TestWorldDirectoryReader(TestWorldDirectoryDeclaration directoryDeclaration) { this.directoryDeclaration = directoryDeclaration; } public TestWorldDirectory read(TestWorldDeclaration worldDeclaration) throws IOException { return new TestWorldDirectory(directoryDeclaration, readAll(worldDeclaration)); } private Map<String, Object> readAll(TestWorldDeclaration worldDeclaration) throws IOException { Map<String, Object> result = new HashMap<>(); for (TestWorldEntryDeclaration<?> entryDeclaration : directoryDeclaration.getEntryDeclarations()) { if (worldDeclaration.isSupported(entryDeclaration.getName())) { readEntry(result, worldDeclaration, entryDeclaration); } } return result; } private void readEntry( Map<String, Object> result, TestWorldDeclaration worldDeclaration, TestWorldEntryDeclaration<?> entryDeclaration) throws IOException, FileNotFoundException { String name = entryDeclaration.getName(); String zipResourceName = worldDeclaration.getZipResourceName(name); try (ZipInputStream zipInputStream = createZipInputStream(zipResourceName)) { String actualFilename = zipInputStream.getNextEntry().getName(); String expectedFilename = name + JSON_FILE_EXTENSION; if (actualFilename.equals(expectedFilename)) { result.put(name, entryDeclaration.readFromStream(zipInputStream)); } else { throw new FileNotFoundException(zipResourceName + " does not contain the file " + expectedFilename); } } } private ZipInputStream createZipInputStream(String zipFilename) { return new ZipInputStream(ResourceLoader.getResourceAsStream(zipFilename), StandardCharsets.UTF_8); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\io\TestWorldDirectoryWriter.java
package amidst.mojangapi.world.testworld.io; import java.io.BufferedOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import amidst.documentation.ThreadSafe; import amidst.mojangapi.world.testworld.TestWorldDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldDirectory; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldEntryDeclaration; @ThreadSafe public class TestWorldDirectoryWriter { private static final String JSON_FILE_EXTENSION = ".json"; private final TestWorldDirectoryDeclaration directoryDeclaration; public TestWorldDirectoryWriter(TestWorldDirectoryDeclaration directoryDeclaration) { this.directoryDeclaration = directoryDeclaration; } public void write(TestWorldDeclaration worldDeclaration, TestWorldDirectory directory) throws FileNotFoundException, IOException { worldDeclaration.createDirectoryIfNecessary(); writeAll(worldDeclaration, directory.getData()); } private void writeAll(TestWorldDeclaration worldDeclaration, Map<String, Object> data) throws FileNotFoundException, IOException { for (TestWorldEntryDeclaration<?> entryDeclaration : directoryDeclaration.getEntryDeclarations()) { if (worldDeclaration.isSupported(entryDeclaration.getName())) { writeEntry(data, worldDeclaration, entryDeclaration); } } } private void writeEntry( Map<String, Object> data, TestWorldDeclaration worldDeclaration, TestWorldEntryDeclaration<?> entryDeclaration) throws IOException, FileNotFoundException { String name = entryDeclaration.getName(); Path zipFile = worldDeclaration.getZipFile(name); try (ZipOutputStream zipOutputStream = createZipOutputStream(zipFile)) { zipOutputStream.putNextEntry(createZipEntry(name)); entryDeclaration.writeToStream(zipOutputStream, data); zipOutputStream.closeEntry(); } } private ZipOutputStream createZipOutputStream(Path zipFile) throws IOException { return new ZipOutputStream(new BufferedOutputStream(Files.newOutputStream(zipFile)), StandardCharsets.UTF_8); } private ZipEntry createZipEntry(String name) { ZipEntry result = new ZipEntry(name + JSON_FILE_EXTENSION); result.setTime(0); return result; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\io\TestWorldEntrySerializer.java
package amidst.mojangapi.world.testworld.io; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import amidst.documentation.Immutable; import amidst.mojangapi.world.testworld.storage.json.BiomeDataJson; import amidst.mojangapi.world.testworld.storage.json.CoordinatesCollectionJson; import amidst.mojangapi.world.testworld.storage.json.EndIslandsJson; import amidst.mojangapi.world.testworld.storage.json.SlimeChunksJson; import amidst.mojangapi.world.testworld.storage.json.WorldMetadataJson; @Immutable public enum TestWorldEntrySerializer { ; /*- * We need complex keys for the BiomeDataJson which contains a Map<AreaJson, short[]> */ private static final Gson GSON = new GsonBuilder().enableComplexMapKeySerialization().create(); public static WorldMetadataJson readMetaData(InputStream is) { return readJson(is, WorldMetadataJson.class); } public static BiomeDataJson readBiomeData(InputStream is) { return readJson(is, BiomeDataJson.class); } public static EndIslandsJson readEndIslands(InputStream is) { return readJson(is, EndIslandsJson.class); } public static SlimeChunksJson readSlimeChunks(InputStream is) { return readJson(is, SlimeChunksJson.class); } public static CoordinatesCollectionJson readCoordinatesCollection(InputStream is) { return readJson(is, CoordinatesCollectionJson.class); } private static <T> T readJson(InputStream is, Class<T> clazz) { try (InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { return GSON.fromJson(reader, clazz); } catch (IOException e) { throw new UncheckedIOException(e); } } public static void writeJson(OutputStream os, Object data) { try { // do not use the try-with-resource mechanism, because this will // also close the output stream OutputStreamWriter writer = new OutputStreamWriter(os, StandardCharsets.UTF_8); GSON.toJson(data, writer); writer.flush(); } catch (IOException e) { throw new UncheckedIOException(e); } } }
amidst
src\test\java\amidst\mojangapi\world\testworld\file\builder\TestWorldDirectoryDeclarationBuilder.java
package amidst.mojangapi.world.testworld.file.builder; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldEntryDeclaration; @NotThreadSafe public class TestWorldDirectoryDeclarationBuilder { private final Map<String, TestWorldEntryDeclarationBuilder<?>> builders = new HashMap<>(); public TestWorldDirectoryDeclaration create() { Map<String, TestWorldEntryDeclaration<?>> result = new HashMap<>(); for (Entry<String, TestWorldEntryDeclarationBuilder<?>> entry : builders.entrySet()) { result.put(entry.getKey(), entry.getValue().constructThis()); } return new TestWorldDirectoryDeclaration(Collections.unmodifiableMap(result)); } public <T> TestWorldEntryDeclarationBuilder<T> entry(String name, Class<T> clazz) { TestWorldEntryDeclarationBuilder<T> builder = new TestWorldEntryDeclarationBuilder<>(this, name, clazz); builders.put(name, builder); return builder; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\file\builder\TestWorldEntryDeclarationBuilder.java
package amidst.mojangapi.world.testworld.file.builder; import java.io.InputStream; import java.io.OutputStream; import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.BiPredicate; import java.util.function.Function; import amidst.documentation.NotThreadSafe; import amidst.mojangapi.world.World; import amidst.mojangapi.world.testworld.file.TestWorldDirectoryDeclaration; import amidst.mojangapi.world.testworld.file.TestWorldEntryDeclaration; @NotThreadSafe public class TestWorldEntryDeclarationBuilder<T> { private final TestWorldDirectoryDeclarationBuilder parent; private final String name; private final Class<T> clazz; private BiConsumer<OutputStream, T> serializer; private Function<InputStream, T> deserializer; private Function<World, T> extractor; private BiPredicate<T, T> equalityChecker; private boolean skipEqualityCheck; public TestWorldEntryDeclarationBuilder(TestWorldDirectoryDeclarationBuilder parent, String name, Class<T> clazz) { this.parent = parent; this.name = name; this.clazz = clazz; } public TestWorldEntryDeclarationBuilder<T> serializer(BiConsumer<OutputStream, T> serializer) { this.serializer = serializer; return this; } public TestWorldEntryDeclarationBuilder<T> deserializer(Function<InputStream, T> deserializer) { this.deserializer = deserializer; return this; } public TestWorldEntryDeclarationBuilder<T> extractor(Function<World, T> extractor) { this.extractor = extractor; return this; } public TestWorldEntryDeclarationBuilder<T> equalityChecker(BiPredicate<T, T> equalityChecker) { this.skipEqualityCheck = false; this.equalityChecker = equalityChecker; return this; } public TestWorldEntryDeclarationBuilder<T> skipEqualityCheck() { this.skipEqualityCheck = true; this.equalityChecker = (a, b) -> { throw new UnsupportedOperationException("cannot check for equality"); }; return this; } TestWorldEntryDeclaration<T> constructThis() { Objects.requireNonNull(name); Objects.requireNonNull(clazz); Objects.requireNonNull(serializer); Objects.requireNonNull(deserializer); Objects.requireNonNull(extractor); Objects.requireNonNull(equalityChecker); return new TestWorldEntryDeclaration<>( name, clazz, serializer, deserializer, extractor, equalityChecker, skipEqualityCheck); } public TestWorldDirectoryDeclaration create() { return parent.create(); } public <E> TestWorldEntryDeclarationBuilder<E> entry(String name, Class<E> clazz) { return parent.entry(name, clazz); } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\AreaJson.java
package amidst.mojangapi.world.testworld.storage.json; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.mojangapi.world.Dimension; @Immutable public class AreaJson implements Comparable<AreaJson> { // Default to Overworld, to support old areas private volatile int dimension = Dimension.OVERWORLD.getId(); private volatile long x; private volatile long y; private volatile long width; private volatile long height; @GsonConstructor public AreaJson() { } public AreaJson(Dimension dimension, long x, long y, long width, long height) { this.dimension = dimension.getId(); this.x = x; this.y = y; this.width = width; this.height = height; } public Dimension getDimension() { return Dimension.fromId(dimension); } public long getX() { return x; } public long getY() { return y; } public long getWidth() { return width; } public long getHeight() { return height; } @Override public int compareTo(AreaJson o) { if (this == o) { return 0; } else if (this.dimension < o.dimension) { return -1; } else if (this.dimension > o.dimension) { return 1; } else if (this.x < o.x) { return -1; } else if (this.x > o.x) { return 1; } else if (this.y < o.y) { return -1; } else if (this.y > o.y) { return 1; } else if (this.width < o.width) { return -1; } else if (this.width > o.width) { return 1; } else if (this.height < o.height) { return -1; } else if (this.height > o.height) { return 1; } else { return 0; } } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + dimension; result = prime * result + (int) (height ^ (height >>> 32)); result = prime * result + (int) (width ^ (width >>> 32)); result = prime * result + (int) (x ^ (x >>> 32)); result = prime * result + (int) (y ^ (y >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AreaJson)) { return false; } AreaJson other = (AreaJson) obj; if (dimension != other.dimension) { return false; } if (height != other.height) { return false; } if (width != other.width) { return false; } if (x != other.x) { return false; } if (y != other.y) { return false; } return true; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\BiomeDataJson.java
package amidst.mojangapi.world.testworld.storage.json; import java.util.SortedMap; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.mojangapi.world.Dimension; @Immutable public class BiomeDataJson { private static int[] short2int(short[] in) { int[] result = new int[in.length]; for (int i = 0; i < in.length; i++) { result[i] = in[i]; } return result; } public static short[] int2short(int[] in, int outLen) { short[] result = new short[outLen]; for (int i = 0; i < outLen; i++) { result[i] = (short) in[i]; } return result; } private volatile SortedMap<AreaJson, short[]> biomeData; @GsonConstructor public BiomeDataJson() { } public BiomeDataJson(SortedMap<AreaJson, short[]> biomeData) { this.biomeData = biomeData; } public int[] get(Dimension dimension, int x, int y, int width, int height) { AreaJson area = new AreaJson(dimension, x, y, width, height); short[] result = biomeData.get(area); if (result != null) { return short2int(result); } else { throw new IllegalArgumentException("the requested area was not stored"); } } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\CoordinatesCollectionJson.java
package amidst.mojangapi.world.testworld.storage.json; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; import java.util.function.Function; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.logging.AmidstLogger; import amidst.logging.AmidstMessageBox; import amidst.mojangapi.mocking.FragmentCornerWalker; import amidst.mojangapi.world.World; import amidst.mojangapi.world.coordinates.CoordinatesInWorld; import amidst.mojangapi.world.icon.WorldIcon; import amidst.mojangapi.world.icon.producer.NameFilteredWorldIconCollector; import amidst.mojangapi.world.icon.producer.WorldIconProducer; @Immutable public class CoordinatesCollectionJson { public static CoordinatesCollectionJson extractWorldSpawn(World world) { CoordinatesInWorld spawn = world.getSpawnWorldIcon().getCoordinates(); return new CoordinatesCollectionJson(createSortedSet(spawn)); } public static CoordinatesCollectionJson extractStrongholds(World world) { List<WorldIcon> strongholds = world.getStrongholdWorldIcons(); return new CoordinatesCollectionJson(createSortedSet(strongholds)); } public static <T> CoordinatesCollectionJson extractWorldIcons( WorldIconProducer<T> producer, String name, Function<CoordinatesInWorld, T> additionalDataFactory, int fragmentsAroundOrigin, int minimalNumberOfCoordinates) { NameFilteredWorldIconCollector consumer = new NameFilteredWorldIconCollector(name); FragmentCornerWalker.walkFragmentsAroundOrigin(fragmentsAroundOrigin).walk( corner -> producer.produce(corner, consumer, additionalDataFactory.apply(corner))); SortedSet<CoordinatesInWorld> coordinates = createSortedSet(consumer.get()); if (coordinates.size() < minimalNumberOfCoordinates) { String message = "not enough coordinates for '" + name + "'"; AmidstLogger.error(message); AmidstMessageBox.displayError("Error", message); } return new CoordinatesCollectionJson(coordinates); } private static SortedSet<CoordinatesInWorld> createSortedSet(List<WorldIcon> icons) { SortedSet<CoordinatesInWorld> result = new TreeSet<>(); for (WorldIcon icon : icons) { result.add(icon.getCoordinates()); } return result; } private static SortedSet<CoordinatesInWorld> createSortedSet(CoordinatesInWorld coordinates) { SortedSet<CoordinatesInWorld> result = new TreeSet<>(); result.add(coordinates); return result; } private volatile SortedSet<CoordinatesInWorld> coordinates; @GsonConstructor public CoordinatesCollectionJson() { } public CoordinatesCollectionJson(SortedSet<CoordinatesInWorld> coordinates) { this.coordinates = coordinates; } public boolean contains(CoordinatesInWorld coordinates) { for (CoordinatesInWorld coordinatesArrayEntry : this.coordinates) { if (coordinates.equals(coordinatesArrayEntry)) { return true; } } return false; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((coordinates == null) ? 0 : coordinates.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CoordinatesCollectionJson)) { return false; } CoordinatesCollectionJson other = (CoordinatesCollectionJson) obj; if (coordinates == null) { if (other.coordinates != null) { return false; } } else if (!coordinates.equals(other.coordinates)) { return false; } return true; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\EndIslandsJson.java
package amidst.mojangapi.world.testworld.storage.json; import java.util.List; import java.util.SortedMap; import java.util.TreeMap; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.mojangapi.mocking.FragmentCornerWalker; import amidst.mojangapi.world.coordinates.CoordinatesInWorld; import amidst.mojangapi.world.oracle.EndIsland; import amidst.mojangapi.world.oracle.EndIslandOracle; @Immutable public class EndIslandsJson { public static EndIslandsJson extract(EndIslandOracle oracle, int fragmentsAroundOrigin) { SortedMap<CoordinatesInWorld, List<EndIsland>> result = new TreeMap<>(); FragmentCornerWalker.walkFragmentsAroundOrigin(fragmentsAroundOrigin).walk( corner -> result.put(corner, oracle.getAt(corner))); return new EndIslandsJson(result); } private volatile SortedMap<CoordinatesInWorld, List<EndIsland>> endIslands; @GsonConstructor public EndIslandsJson() { } public EndIslandsJson(SortedMap<CoordinatesInWorld, List<EndIsland>> endIslands) { this.endIslands = endIslands; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((endIslands == null) ? 0 : endIslands.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EndIslandsJson)) { return false; } EndIslandsJson other = (EndIslandsJson) obj; if (endIslands == null) { if (other.endIslands != null) { return false; } } else if (!endIslands.equals(other.endIslands)) { return false; } return true; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\SlimeChunksJson.java
package amidst.mojangapi.world.testworld.storage.json; import java.util.Arrays; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.mojangapi.world.World; import amidst.mojangapi.world.coordinates.Resolution; import amidst.mojangapi.world.oracle.SlimeChunkOracle; @Immutable public class SlimeChunksJson { public static SlimeChunksJson from(World world) { SlimeChunkOracle oracle = world.getSlimeChunkOracle(); int steps = Resolution.CHUNK.getStepsPerFragment(); boolean[][] isSlimeChunk = new boolean[2 * steps][2 * steps]; for (int x = 0; x < isSlimeChunk.length; x++) { for (int y = 0; y < isSlimeChunk[x].length; y++) { isSlimeChunk[x][y] = oracle.isSlimeChunk(x - steps, y - steps); } } return new SlimeChunksJson(isSlimeChunk); } private volatile boolean[][] isSlimeChunk; @GsonConstructor public SlimeChunksJson() { } public SlimeChunksJson(boolean[][] isSlimeChunk) { this.isSlimeChunk = isSlimeChunk; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(isSlimeChunk); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SlimeChunksJson)) { return false; } SlimeChunksJson other = (SlimeChunksJson) obj; if (!Arrays.deepEquals(isSlimeChunk, other.isSlimeChunk)) { return false; } return true; } }
amidst
src\test\java\amidst\mojangapi\world\testworld\storage\json\WorldMetadataJson.java
package amidst.mojangapi.world.testworld.storage.json; import amidst.documentation.GsonConstructor; import amidst.documentation.Immutable; import amidst.mojangapi.minecraftinterface.RecognisedVersion; import amidst.mojangapi.world.World; import amidst.mojangapi.world.WorldOptions; import amidst.mojangapi.world.WorldSeed; import amidst.mojangapi.world.WorldType; @Immutable public class WorldMetadataJson { public static WorldMetadataJson from(World world) { return new WorldMetadataJson( world.getRecognisedVersion(), world.getWorldOptions().getWorldSeed().getLong(), world.getWorldOptions().getWorldType()); } private volatile RecognisedVersion recognisedVersion; private volatile long seed; private volatile WorldType worldType; @GsonConstructor public WorldMetadataJson() { } public WorldMetadataJson(RecognisedVersion recognisedVersion, long seed, WorldType worldType) { this.recognisedVersion = recognisedVersion; this.seed = seed; this.worldType = worldType; } public RecognisedVersion getRecognisedVersion() { return recognisedVersion; } public long getSeed() { return seed; } public WorldType getWorldType() { return worldType; } public WorldOptions intoWorldOptions() { return new WorldOptions(WorldSeed.fromUserInput(seed + ""), worldType); } }
Amulet-Map-Editor
setup.py
from typing import List, Tuple from setuptools import setup, find_packages from wheel.bdist_wheel import bdist_wheel from Cython.Build import cythonize import glob import sys import numpy import subprocess import logging import re import os import versioneer first_party = { "amulet-core", "amulet-nbt", "pymctranslate", "minecraft-resource-pack", } def freeze_requirements(packages: List[str]) -> List[str]: # Pip install the requirements to find the newest compatible versions # This makes sure that the source versions are using the same dependencies as the compiled version. # This also makes sure that the source version is using the newest version of the dependency. if any("~=" in r and r.split("~=", 1)[0].lower() in first_party for r in packages): print("pip-install") try: # make sure pip is up to date subprocess.run([sys.executable, "-m", "pip", "install", "--upgrade", "pip"]) # run pip install subprocess.run( [sys.executable, "-m", "pip", "install", *packages, "--upgrade"] ) # run pip freeze installed = ( subprocess.check_output( [sys.executable, "-m", "pip", "freeze"], encoding="utf-8" ) .strip() .split("\n") ) requirements_map = {r.split("==")[0].lower(): r for r in installed} print(installed, requirements_map) for index, requirement in enumerate(packages): if "~=" in requirement: lib = requirement.split("~=")[0].strip().lower() if lib in first_party and lib in requirements_map: packages[index] = requirements_map[lib] print(f"Modified packages to {packages}") except Exception as e: print("Failed to bake versions:", e) return packages GCCPattern = re.compile(r"gcc version (?P<major>\d+)\.(?P<minor>\d+)") ClangPattern = re.compile(r"clang(?:-|\s+version\s+)(?P<major>\d+)\.(?P<minor>\d+)") def get_openmp_args() -> Tuple[List[str], List[str], List[str], List[str]]: # This has been lifted from here https://github.com/cython/cython/blob/606bd8cf235149c3be6876d0f5ae60032c8aab6c/runtests.py import sysconfig from distutils import ccompiler def get_openmp_args_for(arg) -> Tuple[List[str], List[str]]: """arg == 'CC' or 'CXX'""" cc = ( sysconfig.get_config_var(arg) or ccompiler.get_default_compiler() ).split()[0] if cc == "msvc": # Microsoft Visual C return ["/openmp"], [] elif cc: # Try GCC and Clang try: out = subprocess.check_output([cc, "-v"]).decode() except ChildProcessError: logging.exception(f"Could not resolve unknown compiler {cc}") else: gcc_match = GCCPattern.search(out) if gcc_match: if (gcc_match.group("major"), gcc_match.group("minor")) >= (4, 2): return ["-fopenmp"], ["-fopenmp"] return [], [] clang_match = ClangPattern.search(out) if clang_match: # if (clang_match.group("major"), clang_match.group("minor")) >= (3, 7): # return ['-fopenmp'], ['-fopenmp'] return [], [] # If all else fails disable openmp return [], [] omp_ccargs, omp_clargs = get_openmp_args_for("CC") omp_cppcargs, omp_cpplargs = get_openmp_args_for("CXX") return omp_ccargs, omp_clargs, omp_cppcargs, omp_cpplargs # build cython extensions if next(glob.iglob("amulet_map_editor/**/*.pyx", recursive=True), None): # This throws an error if it does not match any files omp_ccargs, omp_clargs, omp_cppcargs, omp_cpplargs = get_openmp_args() ext = cythonize( "amulet_map_editor/**/*.pyx", aliases={ "OPENMP_CCARGS": omp_ccargs, "OPENMP_CLARGS": omp_clargs, "OPENMP_CPPCARGS": omp_cppcargs, "OPENMP_CPPLARGS": omp_cpplargs, }, ) else: ext = () cmdclass = versioneer.get_cmdclass() class BDistWheel(bdist_wheel): def finalize_options(self): if "BDISTWHEELFREEZELIBS" in os.environ: self.distribution.install_requires = freeze_requirements( list(self.distribution.install_requires) ) super().finalize_options() cmdclass["bdist_wheel"] = BDistWheel setup( version=versioneer.get_version(), cmdclass=cmdclass, include_dirs=[numpy.get_include()], packages=find_packages(), ext_modules=ext, )
Amulet-Map-Editor
amulet_map_editor\_version.py
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains the computed version number. # This file is released into the public domain. Generated by # versioneer-0.18 (https://github.com/warner/python-versioneer) """Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). git_refnames = "$Format:%d$" git_full = "$Format:%H$" git_date = "$Format:%ci$" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords class VersioneerConfig: """Container for Versioneer configuration parameters.""" def get_config(): """Create, populate and return the VersioneerConfig() object.""" # these strings are filled in when 'setup.py versioneer' creates # _version.py cfg = VersioneerConfig() cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "" cfg.parentdir_prefix = "amulet_map_editor-" cfg.versionfile_source = "amulet_map_editor/_version.py" cfg.verbose = False return cfg class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" LONG_VERSION_PY = {} HANDLERS = {} def register_vcs_handler(vcs, method): # decorator """Decorator to mark a method as the handler for a particular VCS.""" def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f return decorate def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) p = None for c in commands: try: dispcmd = str([c] + args) # remember shell=False, so use git.cmd on windows, not just git p = subprocess.Popen( [c] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None), ) break except EnvironmentError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue if verbose: print("unable to run %s" % dispcmd) print(e) return None, None else: if verbose: print("unable to find command, tried %s" % (commands,)) return None, None stdout = p.communicate()[0].strip() if sys.version_info[0] >= 3: stdout = stdout.decode() if p.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) return None, p.returncode return stdout, p.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): """Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory """ rootdirs = [] for i in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return { "version": dirname[len(parentdir_prefix) :], "full-revisionid": None, "dirty": False, "error": None, "date": None, } else: rootdirs.append(root) root = os.path.dirname(root) # up a level if verbose: print( "Tried directories %s but none started with prefix %s" % (str(rootdirs), parentdir_prefix) ) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @register_vcs_handler("git", "get_keywords") def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from # _version.py. keywords = {} try: f = open(versionfile_abs, "r") for line in f.readlines(): if line.strip().startswith("git_refnames ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["refnames"] = mo.group(1) if line.strip().startswith("git_full ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["full"] = mo.group(1) if line.strip().startswith("git_date ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["date"] = mo.group(1) f.close() except EnvironmentError: pass return keywords @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 # -like" string, which we must then edit to make compliant), because # it's been around since git-1.5.3, and it's too difficult to # discover which version we're using, or to work around using an # older one. date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) refnames = keywords["refnames"].strip() if refnames.startswith("$Format"): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") refs = set([r.strip() for r in refnames.strip("()").split(",")]) # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)]) if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d # expansion behaves like git log --decorate=short and strips out the # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". tags = set([r for r in refs if re.search(r"\d", r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: print("likely tags: %s" % ",".join(sorted(tags))) for ref in sorted(tags): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix) :] if verbose: print("picking %s" % r) return { "version": r, "full-revisionid": keywords["full"].strip(), "dirty": False, "error": None, "date": date, } # no suitable tags, so version is "0+unknown", but full hex is still there if verbose: print("no suitable tags, using unknown + full revision id") return { "version": "0+unknown", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None, } @register_vcs_handler("git", "pieces_from_vcs") def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* expanded, and _version.py hasn't already been rewritten with a short version string, meaning we're inside a checked out source tree. """ GITS = ["git"] if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) raise NotThisMethod("'git rev-parse --git-dir' returned error") # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) describe_out, rc = run_command( GITS, [ "describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix, ], cwd=root, ) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() pieces = {} pieces["long"] = full_out pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out # look for -dirty suffix dirty = git_describe.endswith("-dirty") pieces["dirty"] = dirty if dirty: git_describe = git_describe[: git_describe.rindex("-dirty")] # now we have TAG-NUM-gHEX or HEX if "-" in git_describe: # TAG-NUM-gHEX mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) if not mo: # unparseable. Maybe git-describe is misbehaving? pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out return pieces # tag full_tag = mo.group(1) if not full_tag.startswith(tag_prefix): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % ( full_tag, tag_prefix, ) return pieces pieces["closest-tag"] = full_tag[len(tag_prefix) :] # distance: number of commits since tag pieces["distance"] = int(mo.group(2)) # commit: short hex revision ID pieces["short"] = mo.group(3) else: # HEX: no tags pieces["closest-tag"] = None count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[ 0 ].strip() pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) return pieces def plus_or_dot(pieces): """Return a + if we don't already have one, else return a .""" if "+" in pieces.get("closest-tag", ""): return "." return "+" def render_pep440(pieces): """Build up version string, with post-release "local version identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += plus_or_dot(pieces) rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" else: # exception #1 rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" return rendered def render_pep440_pre(pieces): """TAG[.post.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post.devDISTANCE """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += ".post.dev%d" % pieces["distance"] else: # exception #1 rendered = "0.post.dev%d" % pieces["distance"] return rendered def render_pep440_post(pieces): """TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that .dev0 sorts backwards (a dirty tree will appear "older" than the corresponding clean one), but you shouldn't be releasing software with -dirty anyways. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += plus_or_dot(pieces) rendered += "g%s" % pieces["short"] else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += "+g%s" % pieces["short"] return rendered def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty. Eexceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" return rendered def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render_git_describe_long(pieces): """TAG-DISTANCE-gHEX[-dirty]. Like 'git describe --tags --dirty --always -long'. The distance/hash is unconditional. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: return { "version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"], "date": None, } if not style or style == "default": style = "pep440" # the default if style == "pep440": rendered = render_pep440(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": rendered = render_git_describe(pieces) elif style == "git-describe-long": rendered = render_git_describe_long(pieces) else: raise ValueError("unknown style '%s'" % style) return { "version": rendered, "full-revisionid": pieces["long"], "dirty": pieces["dirty"], "error": None, "date": pieces.get("date"), } def get_versions(): """Get version information or return default if unable to do so.""" # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have # __file__, we can work backwards from there to the root. Some # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which # case we can only use expanded keywords. cfg = get_config() verbose = cfg.verbose try: return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) except NotThisMethod: pass try: root = os.path.realpath(__file__) # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. for i in cfg.versionfile_source.split("/"): root = os.path.dirname(root) except NameError: return { "version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to find root of source tree", "date": None, } try: pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) return render(pieces, cfg.style) except NotThisMethod: pass try: if cfg.parentdir_prefix: return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) except NotThisMethod: pass return { "version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to compute version", "date": None, }
Amulet-Map-Editor
amulet_map_editor\__init__.py
import os import platformdirs experimental_bedrock_resources = False from ._version import get_versions __version__ = get_versions()["version"] del get_versions # Initialise default paths. These should be initialised in main before this is imported # but the tests don't run main so a default is required for that case. data_dir = platformdirs.user_data_dir("AmuletMapEditor", "AmuletTeam") os.environ.setdefault("DATA_DIR", data_dir) config_dir = platformdirs.user_config_dir("AmuletMapEditor", "AmuletTeam") if config_dir == data_dir: config_dir = os.path.join(data_dir, "Config") os.environ.setdefault("CONFIG_DIR", config_dir) os.environ.setdefault( "CACHE_DIR", platformdirs.user_cache_dir("AmuletMapEditor", "AmuletTeam") ) os.environ.setdefault( "LOG_DIR", platformdirs.user_log_dir("AmuletMapEditor", "AmuletTeam") ) from amulet_map_editor.api import config as CONFIG, lang from amulet_map_editor.api.framework.app import open_level, close_level # This is here because of the major change in the NBT library # We have tried updating all the code that will break, but we will inevitably miss some # This modifies the behaviour of warnings.warn to notify us if the old functionality is still used so we can fix it. def _patch_warn(): from threading import Thread import warnings import urllib.request import urllib.parse from urllib.error import URLError import traceback import os import getpass stacks = set() def _call_home(message, category, stack): try: stack = stack.replace( os.getcwd(), "." ) # remove the parent path. We don't need it stack = stack.replace( getpass.getuser(), "%username%" ) # Remove the username just in case except: pass if stack not in stacks: stacks.add(stack) try: urllib.request.urlopen( f"https://docs.google.com/forms/d/e/1FAIpQLSfYb44EYR78yJlQAgyf-GTWn1ZlaGNMuIerl_XTpaYN0d8B4Q/formResponse?" f"entry.601089147={urllib.parse.quote(__version__)}&" f"entry.961557167={urllib.parse.quote(message)}&" f"entry.2137739277={urllib.parse.quote(str(category))}&" f"entry.1185835095={urllib.parse.quote(stack)}", timeout=5, ) except URLError: pass _old_warn = warnings.warn def _on_warn(message, category=None, **kwargs): _old_warn(message, category, **kwargs) t = Thread( target=_call_home, args=(message, category, "".join(traceback.format_stack(limit=6))), ) t.start() warnings.warn = _on_warn _patch_warn()
Amulet-Map-Editor
amulet_map_editor\__main__.py
#!/usr/bin/env python3 def _on_error(e): """Code to handle errors""" try: import traceback import sys import os except ImportError as e: # Something has gone seriously wrong print(e) print("Failed to import requirements. Check that you extracted correctly.") input("Press ENTER to continue.") else: err = "\n".join( [traceback.format_exc()] + ["Failed to import requirements. Check that you extracted correctly."] * isinstance(e, ImportError) + [str(e)] ) print(err) try: with open("crash.log", "w") as f: f.write(err) except OSError: pass input("Press ENTER to continue.") sys.exit(1) try: import sys if sys.version_info[:2] < (3, 7): raise Exception("Must be using Python 3.7+") import logging import os import traceback import glob import time import wx import platformdirs if sys.platform == "linux" and wx.VERSION >= (4, 1, 1): # bug 247 os.environ["PYOPENGL_PLATFORM"] = "egl" except Exception as e_: _on_error(e_) def _init_log(): logs_path = os.environ["LOG_DIR"] # set up handlers os.makedirs(logs_path, exist_ok=True) # remove all log files older than a week for path in glob.glob(os.path.join(glob.escape(logs_path), "*.log")): if ( os.path.isfile(path) and os.path.getmtime(path) < time.time() - 3600 * 24 * 7 ): os.remove(path) log = logging.getLogger() log.setLevel(logging.DEBUG if "amulet-debug" in sys.argv else logging.INFO) file_handler = logging.FileHandler( os.path.join(logs_path, f"amulet_{os.getpid()}.log"), "w", encoding="utf-8" ) file_handler.setFormatter( logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") ) log.addHandler(file_handler) console_handler = logging.StreamHandler() console_handler.setFormatter(logging.Formatter("%(levelname)s - %(message)s")) log.addHandler(console_handler) def main(): try: # Initialise default paths. data_dir = platformdirs.user_data_dir("AmuletMapEditor", "AmuletTeam") os.environ.setdefault("DATA_DIR", data_dir) config_dir = platformdirs.user_config_dir("AmuletMapEditor", "AmuletTeam") if config_dir == data_dir: config_dir = os.path.join(data_dir, "Config") os.environ.setdefault("CONFIG_DIR", config_dir) os.environ.setdefault( "CACHE_DIR", platformdirs.user_cache_dir("AmuletMapEditor", "AmuletTeam") ) os.environ.setdefault( "LOG_DIR", platformdirs.user_log_dir("AmuletMapEditor", "AmuletTeam") ) _init_log() from amulet_map_editor.api.framework import AmuletApp except Exception as e: _on_error(e) else: try: app = AmuletApp(0) app.MainLoop() except Exception as e: log = logging.getLogger(__name__) log.critical( f"Amulet Crashed. Sorry about that. Please report it to a developer if you think this is an issue. \n{traceback.format_exc()}" ) input("Press ENTER to continue.") sys.exit(0) if __name__ == "__main__": main()
Amulet-Map-Editor
tests\test_lang.py
import os import glob import string import unittest from amulet_map_editor.api.lang import lang_dirs KeyCharacterSet = set(string.ascii_lowercase + string.digits + "_.") class LangTestCase(unittest.TestCase): def test_lang(self): for lang_dir in lang_dirs(): for lang_path in glob.glob(os.path.join(glob.escape(lang_dir), "*")): self.assertTrue( lang_path.endswith(".lang"), f'{lang_path} does not end with ".lang".', ) self.assertTrue( os.path.isfile(lang_path), f"{lang_path} is not a file." ) with open(lang_path, encoding="utf-8") as f: unique_ids = set() for line_number, line in enumerate(f.readlines()): line_number += 1 strip_line = line.strip() if strip_line and not strip_line.startswith("#"): split_line = line.split("=", 1) self.assertEqual( len(split_line), 2, f"{lang_path} line {line_number}: No = symbol present.", ) unique_identifier = split_line[0].strip() self.assertTrue( len(unique_identifier) > 0, f"{lang_path} line {line_number}: There is no identifier before the first = symbol.", ) self.assertTrue( set(unique_identifier).issubset(KeyCharacterSet), f"{lang_path} line {line_number}: identifier is not a subset of a-z0-9_.", ) self.assertTrue( unique_identifier not in unique_ids, f"{lang_path} line {line_number}: identifier already defined in the file.", ) unique_ids.add(unique_identifier) language_string = split_line[1].replace("\\n", "\n").strip() self.assertTrue( len(language_string) > 0, f"{lang_path} line {line_number}: There is no translation string after the first = symbol.", ) if __name__ == "__main__": unittest.main()
Amulet-Map-Editor
amulet_map_editor\api\config.py
import os import pickle import gzip from typing import Any _path = os.path.abspath(os.path.join(os.environ["CONFIG_DIR"])) def get(identifier: str, default: Any = None) -> Any: """ Get the config data for a given identifier. Use an identifier unique to your program. :param identifier: An identifier unique to your program :param default: The value to return if one could not be loaded :return: config data """ path = os.path.join(_path, identifier + ".config") if os.path.isfile(path): try: with gzip.open(path, "rb") as fp: val = pickle.load(fp) return val except: pass return default def put(identifier: str, data: Any): """ Add data to the config file and save to disk. :param identifier: An identifier unique to your program :param data: The data to be saved. Must be JSON serialisable :return: """ if not os.path.isdir(_path): os.makedirs(_path) path = os.path.join(_path, identifier + ".config") with gzip.open(path, "wb") as fp: pickle.dump(data, fp)
Amulet-Map-Editor
amulet_map_editor\api\datatypes.py
from typing import Dict, Union, Callable, Tuple, Any MenuData = Dict[ str, Dict[ str, Dict[ str, Union[ Callable, Tuple[Callable], Tuple[Callable, str], Tuple[Callable, str, Any], ], ], ], ]
Amulet-Map-Editor
amulet_map_editor\api\lang.py
""" This module manages language support for Amulet. The language files are in amulet_map_editor/lang with RFC 1766 file names and the .lang extension. Lines starting with a hash (#) are ignored as comments and blank lines are ignored. All other lines should have the format `key=value` where `key` is the language key used in the application and `value` is the localised string. Keys should match the regex [a-z.]+ (lower case a-z and the full stop character) and values can contain any unicode character. Files must be utf-8 encoded. """ import glob from typing import Dict, Optional, List, Tuple import os import locale import logging import re import amulet_map_editor from amulet_map_editor.api import config as CONFIG log = logging.getLogger(__name__) # there might be a proper way to do this but this should be enough for now _lang_dirs: List[str] = [] # the language directories _lang: Dict[str, str] = ( {} ) # a storage for the language strings. unique_identifier: language_string _default_language = "en" _active_language: Optional[str] = None def lang_dirs() -> Tuple[str, ...]: """Tuple of known language directories.""" return tuple(_lang_dirs) def parse_language_id(language_id: str) -> Optional[Tuple[str, str]]: """ Parse an RFC 1766 language id string into a nicer format. :param language_id: The RFC 1766 code to parse :return: A tuple of the language and region codes (both lower case). The region code may be None. """ match = re.fullmatch( r"(?P<language>[a-z]+)([-_](?P<region>[a-z]+))?.*", language_id, flags=re.IGNORECASE, ) if match is None: return None region = match.group("region") region = "" if region is None else region.lower() return match.group("language").lower(), region def set_language(language_id: str): """ Sets and loads the specified language. A restart may be required. :param language_id: The RFC 1766 language code to use """ global _active_language _active_language = language_id cfg = CONFIG.get("amulet_meta", {}) cfg["lang"] = language_id CONFIG.put("amulet_meta", cfg) _load_language() def get_language() -> str: """Get the currently active language string.""" global _active_language if _active_language is None: # find out what language the user is using. try: # try getting the OS language _active_language = locale.getdefaultlocale()[0] except: # if that fails use the default language _active_language = _default_language # if a language is set in the config use that _active_language = CONFIG.get("amulet_meta", {}).get("lang", _active_language) if _active_language is None: _active_language = _default_language return _active_language def get_languages() -> List[str]: """Get a list of all supported language codes.""" langs = set() for d in _lang_dirs: for l in glob.glob(os.path.join(glob.escape(d), "*.lang")): langs.add(os.path.basename(l)[:-5]) return sorted(langs) def _load_lang_file(lang_path: str) -> Dict[str, str]: """Loads a language file and returns the result as a dictionary. Will return an empty dictionary if the path does not exist. :param lang_path: The lang file path to load. :return: A dictionary mapping the string identifier to the string """ lang = {} if not os.path.isfile(lang_path): return lang with open(lang_path, encoding="utf-8") as f: for line in f.readlines(): lstrip_line = line.lstrip() if lstrip_line.startswith("#") or not lstrip_line: continue split_line = lstrip_line.split("=", 1) if len(split_line) == 2: unique_identifier = split_line[0].rstrip() language_string = split_line[1].replace("\\n", "\n").strip() lang[unique_identifier] = language_string return lang def _find_langs(path: str) -> Tuple[Optional[str], Optional[str], Optional[str]]: """Find the default, language specific and region specific lang paths.""" langs = { parse_language_id(os.path.basename(lpath)[:-5]): lpath for lpath in glob.glob(os.path.join(glob.escape(path), "*.lang")) } default_key = parse_language_id(_default_language) active_key = parse_language_id(get_language()) default_path = langs.get(default_key, None) language_path = None region_path = None if active_key is not None: if active_key[0] != default_key[0]: language_path = langs.get((active_key[0], ""), None) if active_key[1]: region_path = langs.get(active_key, None) return default_path, language_path, region_path def _load_language(): """Load the translations for the active language.""" # work out which lang files to load based on the active language # lang files from the default langauge lang_files = sum(zip(*list(map(_find_langs, lang_dirs()))), ()) _lang.clear() for lang_file in lang_files: if lang_file is None: continue _lang.update(_load_lang_file(lang_file)) def register_lang_directory(lang_dir: str): """Register a new language directory. Use this, if you are a third party program, to register new translations for your program. :param lang_dir: The directory containing language files to register. Files must be of the format <language_code>.lang eg en_US.lang :return: """ if os.path.isdir(lang_dir): if lang_dir in _lang_dirs: log.warning( f"The language directory {lang_dir} has already been registered." ) else: _lang_dirs.append(lang_dir) _load_language() # load the normal language directory register_lang_directory( os.path.join(os.path.dirname(amulet_map_editor.__file__), "lang") ) def get(unique_identifier: str): """ Get the localised string for the translation key :param unique_identifier: The translation key to get. :return: The translated string. """ if unique_identifier not in _lang: # help debugging referenced lang entries that do not exist log.info(f"Could not find lang entry for {unique_identifier}") return _lang.get(unique_identifier, unique_identifier)
Amulet-Map-Editor
amulet_map_editor\api\resources.py
from __future__ import annotations from typing import Dict, Union, Type, Iterable import os class ResourceItem: __slots__ = ("_path",) def __init__(self, path): self._path = path def __repr__(self): return f'{self.__class__.__name__}("{self._path}")' @property def path(self): return self._path def to(self, resource_item): return resource_item(self._path) @classmethod def default_object(cls): return None class MissingResourceItem(ResourceItem): __slots__ = ("_path", "_factory") def __init__(self, path, factory): super(MissingResourceItem, self).__init__(path) self._factory = factory def __getattr__(self, item): return MissingResourceItem(os.path.join(self._path, item), self._factory) def __call__(self, *args, **kwargs): return self._factory.default_object() class ResourceDirectory(ResourceItem): __slots__ = ("_path", "_factory", "_entries") ALLOWED_EXTS = () def __init__( self, directory_name: str, factory_class: Type[ResourceItem], parent: str ): super(ResourceDirectory, self).__init__(os.path.join(parent, directory_name)) self._factory = factory_class self._entries: Dict[str, Union[ResourceDirectory, ResourceItem, str]] = {} self.scan() def scan(self): self._entries.clear() for entry in os.listdir(self._path): path = os.path.join(self._path, entry) if os.path.isdir(path): self._entries[entry] = self.__class__(entry, self._factory, self._path) else: filename, ext = os.path.splitext(entry) ext = ext.lower() if ext in self.ALLOWED_EXTS: self._entries[filename] = ext def __repr__(self): return f"ResourceDirectory({self._path})" def __getattr__( self, item ) -> Union["ResourceDirectory", ResourceItem, MissingResourceItem]: if item in self._entries: if isinstance(self._entries[item], str): ext = self._entries[item] self._entries[item] = self._factory( os.path.join(self._path, f"{item}{ext}") ) return self._entries[item] else: return MissingResourceItem(os.path.join(self._path, item), self._factory) def __dir__(self) -> Iterable[str]: return [k for k in self._entries.keys() if k != "__pycache__"] # legacy support from . import image as img # class TextResourceItem(_ResourceItem): # def text(self): # with open(self._path) as fp: # return fp.read() # # @classmethod # def default_object(cls): # return "" # # # class JSONResourceItem(_ResourceItem): # def json(self): # with open(self._path) as fp: # return json.load(fp) # # @classmethod # def default_object(cls): # return dict()
Amulet-Map-Editor
amulet_map_editor\api\__init__.py
Amulet-Map-Editor
amulet_map_editor\programs\__init__.py
Amulet-Map-Editor
amulet_map_editor\__pyinstaller\hook-amulet_map_editor.py
from PyInstaller.utils.hooks import collect_data_files, collect_submodules hiddenimports = collect_submodules("amulet_map_editor") + collect_submodules("PIL") datas = collect_data_files("amulet_map_editor")
Amulet-Map-Editor
amulet_map_editor\__pyinstaller\hook-numpy.py
import os import glob import sys import numpy if sys.platform == "win32": numpy_path = numpy.__path__[0] numpy_lib_path = numpy_path + ".libs" datas = [ (dll_path, "numpy.libs") for dll_path in glob.glob(os.path.join(glob.escape(numpy_lib_path), "*.dll")) ] + [ ( pyd_path, os.path.relpath(os.path.dirname(pyd_path), os.path.dirname(numpy_path)), ) for pyd_path in glob.glob( os.path.join(glob.escape(numpy.__path__[0]), "**", "*.pyd"), recursive=True ) ]
Amulet-Map-Editor
amulet_map_editor\__pyinstaller\__init__.py
def get_hook_dirs(): return __path__
Amulet-Map-Editor
amulet_map_editor\api\framework\amulet_ui.py
from __future__ import annotations import wx from wx.lib.agw import flatnotebook from typing import Dict, Union import traceback import logging from amulet.api.errors import LoaderNoneMatched from amulet_map_editor.api.wx.ui.select_world import open_level_from_dialog from amulet_map_editor.api.wx.ui.traceback_dialog import TracebackDialog from amulet_map_editor import __version__, lang from amulet_map_editor.api.framework.pages import WorldPageUI from .pages import AmuletMainMenu, BasePageUI from amulet_map_editor.api import image from amulet_map_editor.api.wx.util.ui_preferences import preserve_ui_preferences log = logging.getLogger(__name__) NOTEBOOK_MENU_STYLE = ( flatnotebook.FNB_NO_X_BUTTON | flatnotebook.FNB_HIDE_ON_SINGLE_TAB | flatnotebook.FNB_NAV_BUTTONS_WHEN_NEEDED ) NOTEBOOK_STYLE = NOTEBOOK_MENU_STYLE | flatnotebook.FNB_X_ON_TAB CLOSEABLE_PAGE_TYPE = Union[WorldPageUI] wx.Image.SetDefaultLoadFlags(0) @preserve_ui_preferences class AmuletUI(wx.Frame): """This is the top level frame that Amulet exists within.""" # The notebook to hold world pages _level_notebook: AmuletLevelNotebook def __init__(self, parent): wx.Frame.__init__( self, parent, id=wx.ID_ANY, title=f"Amulet V{__version__}", pos=wx.DefaultPosition, size=wx.Size(1000, 600), style=wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.TAB_TRAVERSAL | wx.CLIP_CHILDREN | wx.RESIZE_BORDER, ) self.SetMinSize((625, 440)) icon = wx.Icon() icon.CopyFromBitmap(image.logo.amulet_logo.bitmap()) self.SetIcon(icon) self._level_notebook = AmuletLevelNotebook(self, agwStyle=NOTEBOOK_MENU_STYLE) self._level_notebook.init() self.Bind(wx.EVT_CLOSE, self._level_notebook.on_app_close) def open_level(self, path: str): """Open a level. You should use the method in the app.""" self._level_notebook.open_level(path) def close_level(self, path: str): """Close a given level. You should use the method in the app.""" self._level_notebook.close_level(path) def create_menu(self): """ Create the UI menu. Adds the top level menu items then extends it from the active page """ menu_dict = {} menu_dict.setdefault(lang.get("menu_bar.file.menu_name"), {}).setdefault( "system", {} ).setdefault( lang.get("menu_bar.file.open_world"), lambda evt: open_level_from_dialog(self), ) # menu_dict.setdefault(lang.get('menu_bar.file.menu_name'), {}).setdefault('system', {}).setdefault('Create World', lambda: self.world.save()) menu_dict.setdefault(lang.get("menu_bar.file.menu_name"), {}).setdefault( "exit", {} ).setdefault(lang.get("menu_bar.file.quit"), lambda evt: self.Close()) menu_dict = self._level_notebook.extend_menu(menu_dict) menu_bar = wx.MenuBar() for menu_name, menu_data in menu_dict.items(): menu = wx.Menu() separator = False for menu_section in menu_data.values(): if separator: menu.AppendSeparator() separator = True for menu_item_name, menu_item_options in menu_section.items(): callback = None menu_item_description = None wx_id = None if callable(menu_item_options): callback = menu_item_options elif isinstance(menu_item_options, tuple): if len(menu_item_options) >= 1: callback = menu_item_options[0] if len(menu_item_options) >= 2: menu_item_description = menu_item_options[1] if len(menu_item_options) >= 3: wx_id = menu_item_options[2] else: continue if not menu_item_description: menu_item_description = "" if not wx_id: wx_id = wx.ID_ANY menu_item: wx.MenuItem = menu.Append( wx_id, menu_item_name, menu_item_description ) self.Bind(wx.EVT_MENU, callback, menu_item) menu_bar.Append(menu, menu_name) self.SetMenuBar(menu_bar) class AmuletLevelNotebook(flatnotebook.FlatNotebook): """A notebook to hold all world tabs.""" # The main menu tab _main_menu: AmuletMainMenu # Storage of open world tabs for easy lookup _open_worlds: Dict[str, CLOSEABLE_PAGE_TYPE] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.Bind(flatnotebook.EVT_FLATNOTEBOOK_PAGE_CLOSING, self._on_page_closing) self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self._page_changing, self) self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self._page_changed, self) self._main_menu = AmuletMainMenu(self) self._open_worlds = {} def init(self): self._add_world_tab(self._main_menu, lang.get("main_menu.tab_name")) def open_level(self, path: str): """Open a world panel add it to the notebook""" if path in self._open_worlds: self.SetSelection(self.GetPageIndex(self._open_worlds[path])) else: try: world = WorldPageUI(self, path) except LoaderNoneMatched as e: log.error(f"Could not find a loader for this world.\n{e}") wx.MessageBox(f"{lang.get('select_world.no_loader_found')}\n{e}") except Exception as e: log.error(lang.get("select_world.loading_world_failed"), exc_info=True) dialog = TracebackDialog( self, lang.get("select_world.loading_world_failed"), str(e), traceback.format_exc(), ) dialog.ShowModal() dialog.Destroy() else: self._open_worlds[path] = world self._add_world_tab(world, world.world_name) def _add_world_tab(self, page: BasePageUI, obj_name: str): """Add a tab and enable it.""" self.AddPage(page, obj_name, True) def close_level(self, path: str): """Close a given world and remove it from the notebook""" if path in self._open_worlds: world = self._open_worlds[path] # note we don't remove it from the dictionary here # delete page starts the deletion but it can be vetoed # it is deleted from the dictionary in _on_page_closing self.DeletePage(self.GetPageIndex(world)) def _on_page_closing(self, evt: flatnotebook.EVT_FLATNOTEBOOK_PAGE_CLOSING): """Handle the page closing.""" page: CLOSEABLE_PAGE_TYPE = self.GetPage(evt.GetSelection()) if page is not self._main_menu: if page.can_disable() and page.can_close(): path = page.path page.disable() page.close() del self._open_worlds[path] else: evt.Veto() def _page_changing(self, evt: wx.BookCtrlEvent): if ( evt.GetOldSelection() != wx.NOT_FOUND and not self.GetPage(evt.GetOldSelection()).can_disable() ): evt.Veto() def _page_changed(self, evt: wx.BookCtrlEvent): """Handle the page changing.""" if evt.GetOldSelection() != evt.GetSelection(): if evt.GetOldSelection() != wx.NOT_FOUND: self.GetPage(evt.GetOldSelection()).disable() if self.GetCurrentPage() is self._main_menu: self.SetAGWWindowStyleFlag(NOTEBOOK_MENU_STYLE) else: self.SetAGWWindowStyleFlag(NOTEBOOK_STYLE) if self.GetCurrentPage() is not None: self.GetCurrentPage().enable() def on_app_close(self, evt: wx.CloseEvent): for path, page in list(self._open_worlds.items()): self.close_level(path) if self.GetPageCount() > 1: wx.MessageBox(lang.get("app.world_still_used")) else: evt.Skip() def extend_menu(self, menu_dict: dict) -> dict: return self.GetCurrentPage().menu(menu_dict)
Amulet-Map-Editor
amulet_map_editor\api\framework\app.py
import wx from . import amulet_ui import sys import locale import logging import time from amulet_map_editor.api import config from amulet_map_editor import __version__ from .warning_dialog import WarningDialog from .licence_dialog import LicenceDialog log = logging.getLogger(__name__) # Uses a conditional so if this breaks a build, we can just delete the file and it will skip the check try: from amulet_map_editor.api.framework import update_check except ImportError: update_check = None log.warning("Could not import update checker") class AmuletApp(wx.App): _amulet_ui: amulet_ui.AmuletUI def OnInit(self): self._amulet_ui = amulet_ui.AmuletUI(None) self.SetTopWindow(self._amulet_ui) self._amulet_ui.Show() meta_config = config.get("amulet_meta", {}) if not getattr(sys, "frozen", False): licence_dialog_show_time = meta_config.get("licence_dialog_show_time", 0) if licence_dialog_show_time < time.time() - 3600 * 24 * 30: # Last shown more than a month ago licence_dialog = LicenceDialog(self._amulet_ui) licence_dialog.Centre() if licence_dialog.ShowModal() == wx.ID_OK: meta_config["licence_dialog_show_time"] = time.time() config.put("amulet_meta", meta_config) else: return False if not meta_config.get("do_not_show_warning_dialog", False): warning_dialog = WarningDialog(self._amulet_ui) warning_dialog.Centre() warning_dialog.ShowModal() if warning_dialog.do_not_show_again: meta_config["do_not_show_warning_dialog"] = True config.put("amulet_meta", meta_config) if update_check: self._amulet_ui.Bind( update_check.EVT_UPDATE_CHECK, lambda evt: update_check.UpdateDialog( self._amulet_ui, __version__, evt.GetVersion() ).ShowModal(), ) update_check.check_for_update(self._amulet_ui, __version__) return True def InitLocale(self): # https://discuss.wxpython.org/t/what-is-wxpython-doing-to-the-locale-to-makes-pandas-crash/34606/18 if sys.version_info[:2] >= (3, 8): super().InitLocale() else: self.ResetLocale() lang, enc = locale.getlocale() if lang is None: self._initial_locale = wx.Locale(wx.LANGUAGE_DEFAULT) def open_level(self, path: str): """ Open a level and create a tab for it. If a tab already exists it will just be shown. :param path: The path to the level to open. """ self._amulet_ui.open_level(path) def close_level(self, path: str): """ Close a level tab. :param path: The path to the level to close. """ self._amulet_ui.close_level(path) def get_app() -> AmuletApp: """Get the app instance.""" app = wx.App.Get() if isinstance(app, AmuletApp): return app else: raise Exception("wx App is not an instance of AmuletApp") def open_level(path: str): """ Open a level and create a tab for it. If a tab already exists it will just be shown. :param path: The path to the level to open. """ get_app().open_level(path) def close_level(path: str): """ Close a level tab. :param path: The path to the level to close. """ get_app().close_level(path)
Amulet-Map-Editor
amulet_map_editor\api\framework\base_tab.py
class BaseTab: def enable(self): """Run when the tab is shown/enabled""" pass def can_disable(self) -> bool: """ Check if it is safe to disable the tab. :return: True if the tab can be disabled, False otherwise. """ return True def disable(self): """Run when the tab is hidden/disabled""" pass def can_close(self) -> bool: """ Check if it is safe to close the tab. If this is going to return False it should notify the user. :return: True if the tab can be closed, False otherwise. """ return True def close(self): """Fully close the tab. Called when destroying the tab.""" pass
Amulet-Map-Editor
amulet_map_editor\api\framework\licence_dialog.py
import webbrowser import wx import wx.lib.agw.hyperlink from amulet_map_editor import lang _padding = 20 class LicenceDialog(wx.Dialog): def __init__(self, parent: wx.Window): super().__init__(parent, style=wx.CAPTION) self.SetTitle(lang.get("licence_dialog.title")) root_sizer = wx.BoxSizer(wx.VERTICAL) root_sizer.AddSpacer(_padding) root_sizer_2 = wx.BoxSizer(wx.HORIZONTAL) root_sizer.Add(root_sizer_2) root_sizer_2.AddSpacer(_padding) self._main_sizer = wx.BoxSizer(wx.VERTICAL) root_sizer_2.Add(self._main_sizer) root_sizer_2.AddSpacer(_padding) root_sizer.AddSpacer(_padding) title = wx.StaticText( self, wx.ID_ANY, lang.get("licence_dialog.header"), style=wx.ALIGN_CENTER_HORIZONTAL, ) font = title.GetFont() font.SetPointSize(25) title.SetFont(font) self._main_sizer.Add(title, 0, wx.ALL | wx.EXPAND, 5) self._add_line(lang.get("licence_dialog.content_1")) self._main_sizer.AddSpacer(20) self._add_line(lang.get("licence_dialog.content_2")) self._main_sizer.AddSpacer(20) self._add_line(lang.get("licence_dialog.content_3")) self._main_sizer.AddSpacer(20) self._add_line(lang.get("licence_dialog.content_4")) self._main_sizer.AddSpacer(10) button_sizer = wx.StdDialogButtonSizer() root_sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 4) self._quit_button = wx.Button( self, wx.ID_CANCEL, lang.get("licence_dialog.quit_button") ) self.SetEscapeId(self._quit_button.GetId()) button_sizer.Add(self._quit_button) self._buy_button = wx.Button( self, wx.ID_ANY, lang.get("licence_dialog.buy_button") ) self._buy_button.SetDefault() self._buy_button.Bind(wx.EVT_BUTTON, self._buy) button_sizer.Add(self._buy_button) self._continue_button = wx.Button( self, wx.ID_OK, lang.get("licence_dialog.continue_button") ) button_sizer.Add(self._continue_button) self.SetAffirmativeId(self._continue_button.GetId()) button_sizer.Realize() self.SetSizer(root_sizer) root_sizer.Fit(self) self.Layout() def _add_line(self, text: str) -> None: content = wx.StaticText( self, wx.ID_ANY, text, style=wx.ALIGN_CENTER_HORIZONTAL, ) font = content.GetFont() font.SetPointSize(12) content.SetFont(font) content.Wrap(750) self._main_sizer.Add(content, 0, wx.EXPAND) @staticmethod def _buy(_) -> None: webbrowser.open("https://www.amuletmc.com/")
Amulet-Map-Editor
amulet_map_editor\api\framework\update_check.py
from __future__ import annotations from typing import Optional import urllib.request import threading import json import webbrowser import logging import wx from packaging.version import Version from amulet_map_editor import lang URL = "http://api.github.com/repos/Amulet-Team/Amulet-Map-Editor/releases" _EVT_UPDATE_CHECK = wx.NewEventType() EVT_UPDATE_CHECK = wx.PyEventBinder(_EVT_UPDATE_CHECK, 1) log = logging.getLogger(__name__) class UpdateEvent(wx.PyCommandEvent): def __init__(self, etype, eid, new_version: str): wx.PyCommandEvent.__init__(self, etype, eid) self._new_version = new_version def GetVersion(self) -> str: return self._new_version class UpdateDialog(wx.Dialog): def __init__(self, parent, current_version: str, new_version: str): super().__init__(parent) sizer_1 = wx.BoxSizer(wx.VERTICAL) static_text_1 = wx.StaticText( self, label=lang.get("update_check.newer_version_released") ) static_text_2 = wx.StaticText( self, label=f"{lang.get('update_check.new_version')} v{new_version}" ) static_text_3 = wx.StaticText( self, label=f"{lang.get('update_check.current_version')} v{current_version}" ) sizer_1.Add(static_text_1, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) sizer_1.Add(static_text_2, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) sizer_1.Add(static_text_3, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) update_button = wx.Button(self, label=lang.get("update_check.update")) ok_button = wx.Button(self, label=lang.get("update_check.ok")) sizer_2.Add(update_button, 0, wx.ALL, 5) sizer_2.Add((0, 0), 1, wx.EXPAND, 5) sizer_2.Add(ok_button, 0, wx.ALL, 5) sizer_1.Add(sizer_2, 1, wx.EXPAND, 5) self.SetSizerAndFit(sizer_1) self.Centre() update_button.Bind( wx.EVT_BUTTON, lambda evt: self.goto_download_page(new_version, evt) ) ok_button.Bind(wx.EVT_BUTTON, lambda evt: self.Close()) @staticmethod def goto_download_page(new_version, _): webbrowser.open( f"https://github.com/Amulet-Team/Amulet-Map-Editor/releases/tag/{new_version}" ) def _is_compatible(current_version: Version, release_version: Version) -> bool: """The release version is only compatible with the current version if it is newer and more stable.""" # release > beta > beta.dev > alpha.dev # > alpha > alpha.dev def get_release_stage(version: Version) -> int: if version.pre is None: return 3 else: return {"a": 0, "b": 1, "rc": 2}[version.pre[0]] return ( # The release version is newer than the current version release_version > current_version # the pre-release stage is newer or the same and get_release_stage(release_version) >= get_release_stage(current_version) # dev builds should only be suggested if the current version is a dev build and (release_version.dev is None or current_version.dev is not None) ) def _get_newest_version(url: str, current_version_str: str) -> Optional[str]: """Find a newer but compatible release than this one if one exists.""" try: current_version = Version(current_version_str) if current_version.local is not None: # if the version has a local extension (eg. "+0.gee5780.dirty") log.info("Running from source, not showing update dialog") return conn = urllib.request.urlopen(url, timeout=5) data = conn.read() data = json.loads(data) # iterate through all release versions starting with the newest for release_version, release_data in sorted( map(lambda d: (Version(d["tag_name"]), d), data), key=lambda t: t[0], reverse=True, ): if _is_compatible(current_version, release_version): return str(release_version) except Exception: pass def _check_for_update( listening_parent: wx.EvtHandler, url: str, current_version_str: str ): """Check if there is a newer release and post an UpdateEvent if there is.""" release_version = _get_newest_version(url, current_version_str) if release_version is not None: evt = UpdateEvent(_EVT_UPDATE_CHECK, -1, str(release_version)) wx.PostEvent(listening_parent, evt) def check_for_update(listening_parent: wx.EvtHandler, current_version_str: str): update_thread = threading.Thread( target=_check_for_update, args=(listening_parent, URL, current_version_str) ) update_thread.start()
Amulet-Map-Editor
amulet_map_editor\api\framework\warning_dialog.py
import wx from amulet_map_editor import lang class WarningDialog(wx.Dialog): def __init__(self, parent: wx.Window): super().__init__(parent, style=wx.CAPTION) self.SetTitle(lang.get("warning_dialog.title")) main_sizer = wx.BoxSizer(wx.VERTICAL) content = wx.StaticText( self, wx.ID_ANY, lang.get("warning_dialog.content"), style=wx.ALIGN_CENTER_HORIZONTAL, ) content.Wrap(750) main_sizer.Add(content, 1, wx.ALL | wx.EXPAND, 5) button_sizer = wx.StdDialogButtonSizer() main_sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 4) self._do_not_show = wx.CheckBox( self, wx.ID_ANY, lang.get("warning_dialog.do_not_show_again") ) button_sizer.Add(self._do_not_show, 0, wx.ALIGN_CENTER_VERTICAL, 0) self._understand_button = wx.Button( self, wx.ID_ANY, lang.get("warning_dialog.i_understand") ) self._understand_button.SetDefault() button_sizer.Add(self._understand_button, 0, 0, 0) button_sizer.Realize() self.SetSizer(main_sizer) main_sizer.Fit(self) self.SetAffirmativeId(self._understand_button.GetId()) self.Layout() @property def do_not_show_again(self) -> bool: return self._do_not_show.GetValue()
Amulet-Map-Editor
amulet_map_editor\api\framework\__init__.py
from .app import AmuletApp from .amulet_ui import AmuletUI
Amulet-Map-Editor
amulet_map_editor\api\image\__init__.py
import wx import os from typing import Type, Union from amulet_map_editor.api.resources import ( ResourceItem, ResourceDirectory, MissingResourceItem, ) class BitmapResourceItem(ResourceItem): def bitmap(self, width=-1, height=-1, quality=wx.IMAGE_QUALITY_HIGH) -> wx.Bitmap: bm = wx.Bitmap(self._path) if width > 0 or height > 0: im: wx.Image = bm.ConvertToImage() im = im.Scale( width if width > 0 else bm.Width, height if height > 0 else bm.Height, quality, ) bm = im.ConvertToBitmap() return bm @classmethod def default_object(cls) -> wx.Bitmap: bm = wx.Bitmap() bm.Create(32, 32) return bm class ImageResourceDirectory(ResourceDirectory): ALLOWED_EXTS = (".png",) def __init__( self, directory_name: str, factory_class: Type[ResourceItem], parent: str ): super().__init__(directory_name, factory_class, parent) def __getattr__( self, item ) -> Union["ImageResourceDirectory", BitmapResourceItem, MissingResourceItem]: return super().__getattr__(item) _self = ImageResourceDirectory( "image", BitmapResourceItem, os.path.dirname(os.path.dirname(__file__)) ) def __getattr__( name: str, ) -> Union["ImageResourceDirectory", BitmapResourceItem, MissingResourceItem]: return _self.__getattr__(name) def __dir__(): return _self.__dir__() TABLERICONS: ImageResourceDirectory = _self.icon.tablericons ADD_ICON: BitmapResourceItem = TABLERICONS.plus_green SUBTRACT_ICON: BitmapResourceItem = TABLERICONS.minus_red EDIT_ICON: BitmapResourceItem = TABLERICONS.edit REFRESH_ICON: BitmapResourceItem = TABLERICONS.refresh UP_ARROW: BitmapResourceItem = TABLERICONS.chevron_up DOWN_ARROW: BitmapResourceItem = TABLERICONS.chevron_down UP_CARET: BitmapResourceItem = TABLERICONS.caret_up DOWN_CARET: BitmapResourceItem = TABLERICONS.caret_down COLOUR_PICKER: BitmapResourceItem = TABLERICONS.color_picker TRASH: BitmapResourceItem = TABLERICONS.trash MAXIMIZE: BitmapResourceItem = TABLERICONS.arrows_maximize MINIMIZE: BitmapResourceItem = TABLERICONS.arrows_minimize
Amulet-Map-Editor
amulet_map_editor\api\opengl\canvas_container.py
import weakref from wx.glcanvas import GLCanvas class CanvasContainer: """A helper class to store a reference to a canvas. If a canvas is hard referenced there may be cyclic references leading to memory leaks. Subclass this class if you intend to store a reference to the canvas.""" def __init__(self, canvas: GLCanvas): self._canvas = weakref.ref(canvas) @property def canvas(self) -> GLCanvas: return self._canvas()
Amulet-Map-Editor
amulet_map_editor\api\opengl\context_manager.py
class ContextManager: """Store the uuid of the context this data applies to.""" def __init__(self, context_identifier: str): self._context_identifier = context_identifier @property def context_identifier(self) -> str: return self._context_identifier
Amulet-Map-Editor
amulet_map_editor\api\opengl\data_types.py
from typing import Tuple import numpy TransformationMatrix = numpy.ndarray # 4x4 matrix CameraLocationType = Tuple[float, float, float] CameraRotationType = Tuple[float, float] RGBColour = Tuple[float, float, float]
Amulet-Map-Editor
amulet_map_editor\api\opengl\drawable.py
class Drawable: """A base class for all classes holding opengl data.""" def draw(self, *args, **kwargs): """Draw the opengl data.""" raise NotImplementedError def unload(self): """Unload the opengl data.""" raise NotImplementedError
Amulet-Map-Editor
amulet_map_editor\api\opengl\events.py
from wx.lib import newevent from .camera import ( CameraMovedEvent, EVT_CAMERA_MOVED, ProjectionChangedEvent, EVT_PROJECTION_CHANGED, ) PreDrawEvent, EVT_PRE_DRAW = newevent.NewEvent() DrawEvent, EVT_DRAW = newevent.NewEvent() PostDrawEvent, EVT_POST_DRAW = newevent.NewEvent()
Amulet-Map-Editor
amulet_map_editor\api\opengl\matrix.py
import math import numpy from amulet.utils.matrix import ( scale_matrix, rotation_matrix_xy, rotation_matrix_yx, rotation_matrix_xyz, transform_matrix, displacement_matrix, inverse_transform_matrix, ) TransformationMatrixType = numpy.ndarray def perspective_matrix( fovy: float, # field of view in the vertical direction in radians aspect, # aspect ratio x/y z_near, # near clipping distance z_far, # far clipping distance ) -> TransformationMatrixType: # camera projection f = 1 / math.tan(fovy / 2) return numpy.array( [ [f / aspect, 0, 0, 0], [0, f, 0, 0], [ 0, 0, (z_far + z_near) / (z_near - z_far), (2 * z_far * z_near) / (z_near - z_far), ], [0, 0, -1, 0], ], dtype=numpy.float64, ) def orthographic_matrix( radius: float, # the viewable distance in the vertical direction in blocks aspect, # aspect ratio x/y near, # near clipping distance far, # far clipping distance ) -> TransformationMatrixType: """The orthographic matrix to convert camera space to screen space.""" bottom = -radius top = radius left = bottom * aspect right = top * aspect return numpy.array( [ [2 / (right - left), 0, 0, -(right + left) / (right - left)], [0, 2 / (top - bottom), 0, -(top + bottom) / (top - bottom)], [0, 0, -2 / (far - near), -(far + near) / (far - near)], [0, 0, 0, 1], ] )
Amulet-Map-Editor
amulet_map_editor\api\opengl\textureatlas.py
#!/usr/bin/env python # # Copyright (c) 2014 Matthew Borgerson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # """Texture Atlas and Map File Generation Utility Classes""" import logging from PIL import Image import math from typing import Dict, Tuple, List, Optional, Generator log = logging.getLogger(__name__) DESCRIPTION = """Packs many smaller images into one larger image, a Texture Atlas. A companion file (.map), is created that defines where each texture is mapped in the atlas.""" class AtlasTooSmall(Exception): pass class Packable(object): """A two-dimensional object with position information.""" def __init__(self, width: int, height: int): self._x = 0 self._y = 0 self._width = width self._height = height @property def x(self) -> int: return self._x @x.setter def x(self, value: int): self._x = value @property def y(self) -> int: return self._y @y.setter def y(self, value: int): self._y = value @property def width(self) -> int: return self._width @property def height(self) -> int: return self._height @property def perimeter(self) -> int: return 2 * self._width + 2 * self._height class PackRegion(object): """A region that two-dimensional Packable objects can be packed into.""" def __init__(self, x: int, y: int, width: int, height: int): """Constructor.""" self._x = x self._y = y self._width = width self._height = height self._sub1: Optional[PackRegion] = None self._sub2: Optional[PackRegion] = None self._packable: Optional[Packable] = None @property def x(self) -> int: return self._x @property def y(self) -> int: return self._y @property def width(self) -> int: return self._width @property def height(self) -> int: return self._height @property def packable(self) -> Packable: return self._packable def get_all_packables(self): """Returns a list of all Packables in this region and sub-regions.""" if self._packable: return ( [self._packable] + self._sub1.get_all_packables() + self._sub2.get_all_packables() ) return [] def pack(self, packable: Packable, border: int): """Pack 2D packable into this region.""" if not self._packable: # Is there room to pack this? if (packable.width + border * 2 > self._width) or ( packable.height + border * 2 > self._height ): return False # Pack self._packable = packable # Set x, y on Packable self._packable.x = self._x + border self._packable.y = self._y + border # Create sub-regions self._sub1 = PackRegion( self._x, self._y + self._packable.height + border * 2, self._packable.width + border * 2, self._height - self._packable.height - border * 2, ) self._sub2 = PackRegion( self._x + self._packable.width + border * 2, self._y, self._width - self._packable.width - border * 2, self._height, ) return True # Pack into sub-region return self._sub1.pack(packable, border) or self._sub2.pack(packable, border) class Frame(Packable): """An image file that can be packed into a PackRegion.""" def __init__(self, filename: str): self._filename = filename # Determine frame dimensions image: Image.Image = Image.open(filename) self._image: Image.Image = image.copy() image.close() width, height = self._image.size super(Frame, self).__init__(width, height) @property def filename(self) -> str: return self._filename def draw(self, image: Image.Image, border: int): """Draw this frame into another Image.""" if border: image.paste( self._image.resize(tuple(s + border * 2 for s in self._image.size)), (self.x - border, self.y - border), ) image.paste(self._image, (self.x, self.y)) class Texture(object): """A collection of one or more frames.""" def __init__(self, name: str, frames: List[Frame]): self._name = name self._frames: List[Frame] = frames @property def name(self) -> str: return self._name @property def frames(self) -> List[Frame]: return self._frames class TextureAtlas(PackRegion): """Texture Atlas generator.""" def __init__(self, width: int, height: int, border: int = 0): super(TextureAtlas, self).__init__(0, 0, width, height) self._textures: List[Texture] = [] self._border = border @property def textures(self) -> List[Texture]: return self._textures def pack(self, texture: Texture): """Pack a Texture into this atlas.""" self._textures.append(texture) for frame in texture.frames: if not super(TextureAtlas, self).pack(frame, self._border): raise AtlasTooSmall("Failed to pack frame %s" % frame.filename) def to_dict(self) -> Dict[str, Tuple[int, int, int, int]]: return { tex.name: ( tex.frames[0].x / self.width, tex.frames[0].y / self.height, (tex.frames[0].x + tex.frames[0].width) / self.width, (tex.frames[0].y + min(tex.frames[0].height, tex.frames[0].width)) / self.height, ) for tex in self.textures } def generate(self, mode: str) -> Image.Image: """Generates the final texture atlas.""" out = Image.new(mode, (self.width, self.height)) for t in self._textures: for f in t.frames: f.draw(out, self._border) return out def write(self, filename: str, mode: str): """Generates and saves the final texture atlas.""" out = self.generate(mode) out.save(filename) class TextureAtlasMap(object): """Texture Atlas Map file generator.""" def __init__(self, atlas): self._atlas = atlas def write(self, fd): """Writes the texture atlas map file into file object fd.""" raise Exception("Not Implemented") def create_atlas( texture_tuple: Tuple[str, ...], ) -> Tuple[Image.Image, Dict[str, Tuple[float, float, float, float]]]: atlas_iter = create_atlas_iter(texture_tuple) try: while True: next(atlas_iter) except StopIteration as e: return e.value def create_atlas_iter(texture_tuple: Tuple[str, ...]) -> Generator[ float, None, Tuple[Image.Image, Dict[str, Tuple[float, float, float, float]]], ]: log.info("Creating texture atlas") # Parse texture names textures = [] for texture_index, texture in enumerate(texture_tuple): if not texture_index % 100: yield texture_index / (len(texture_tuple) * 2) # Look for a texture name name, frames = texture, [texture] # Build frame objects frames = [Frame(f) for f in frames] # Add frames to texture object list textures.append(Texture(name, frames)) # Sort textures by perimeter size in non-increasing order textures = sorted(textures, key=lambda i: i.frames[0].perimeter, reverse=True) height = 0 width = 0 pixels = 0 for t in textures: for f in t.frames: height = max(f.height, height) width = max(f.width, width) pixels += f.height * f.width size = max(height, width, 1 << (math.ceil(pixels**0.5) - 1).bit_length()) atlas_created = False atlas = None while not atlas_created: try: # Create the atlas and pack textures in log.info(f"Trying to pack textures into image of size {size}x{size}") atlas = TextureAtlas(size, size) for texture_index, texture in enumerate(textures): if not texture_index % 30: yield 0.5 + texture_index / (len(textures) / 2) atlas.pack(texture) atlas_created = True except AtlasTooSmall: log.info(f"Image was too small. Trying with a larger area") size *= 2 log.info(f"Successfully packed textures into an image of size {size}x{size}") texture_atlas = atlas.generate("RGBA") texture_bounds = atlas.to_dict() texture_bounds = { texture_path: texture_bounds[texture_path] for texture_path in texture_tuple } log.info("Finished creating texture atlas") return texture_atlas, texture_bounds
Amulet-Map-Editor
amulet_map_editor\api\opengl\thread_generator.py
from typing import List class ThreadedObject: """Data/Geometry generation controlled by an external thread.""" def thread_action(self): """The action the thread will call.""" raise NotImplementedError @property def thread_weighting(self) -> int: """The number of times the thread_action should be called.""" return 1 class ThreadedObjectContainer(ThreadedObject): def __init__(self): self._objects: List[ThreadedObject] = [] self._obj_index = 0 self._obj_sub_index = 0 def register(self, thread_object: ThreadedObject): assert isinstance(thread_object, ThreadedObject) if thread_object in self._objects: raise Exception("ThreadedObject object is already registered.") self._objects.append(thread_object) def unregister(self, thread_object: ThreadedObject): assert isinstance(thread_object, ThreadedObject) if thread_object not in self._objects: raise Exception("ThreadedObject object was not already registered.") self._objects.remove(thread_object) def thread_action(self): """The action the thread will call.""" if self._obj_index >= len(self._objects): self._obj_index = 0 self._obj_sub_index = 0 while ( self._obj_index < len(self._objects) and self._objects[self._obj_index].thread_weighting < self._obj_sub_index ): self._obj_index += 1 self._obj_sub_index = 0 if self._obj_index < len(self._objects): self._objects[self._obj_index].thread_action() self._obj_sub_index += 1 @property def thread_weighting(self) -> int: """The number of times the thread_action should be called.""" return sum(obj.thread_weighting for obj in self._objects)
Amulet-Map-Editor
amulet_map_editor\api\opengl\__init__.py
from .context_manager import ContextManager from .drawable import Drawable from .thread_generator import ThreadedObject, ThreadedObjectContainer def check_opengl(checked=False): try: import OpenGL.GL except ImportError as e: import os import ctypes.util uname = os.uname() if uname[0] == "Darwin" and uname[2] >= "20." and not checked: real_find_library = ctypes.util.find_library def find_library(name): if name in {"OpenGL", "GLUT"}: # add more names here if necessary return f"/System/Library/Frameworks/{name}.framework/{name}" return real_find_library(name) ctypes.util.find_library = find_library check_opengl(True) else: raise e
Amulet-Map-Editor
amulet_map_editor\api\wx\__init__.py
Amulet-Map-Editor
amulet_map_editor\api\framework\pages\base_page.py
from amulet_map_editor.api.datatypes import MenuData from amulet_map_editor.api.framework.base_tab import BaseTab class BasePageUI(BaseTab): def menu(self, menu: MenuData) -> MenuData: return menu
Amulet-Map-Editor
amulet_map_editor\api\framework\pages\main_menu.py
import webbrowser from urllib.request import urlopen from urllib.error import URLError import json import wx import wx.adv import wx.lib.inspection from amulet_map_editor.api import image, lang from .base_page import BasePageUI from amulet_map_editor.api.wx.ui.select_world import open_level_from_dialog class AmuletMainMenu(wx.Panel, BasePageUI): def __init__(self, parent: wx.Window): super(AmuletMainMenu, self).__init__(parent) sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(sizer) self._lang_button = wx.BitmapButton( self, bitmap=image.icon.tablericons.language.bitmap(64, 64) ) self._lang_button.Bind(wx.EVT_BUTTON, self._select_language) sizer.Add(self._lang_button, 0, wx.ALIGN_RIGHT) sizer.AddStretchSpacer(1) name_sizer = wx.BoxSizer() sizer.Add(name_sizer, 0, wx.CENTER) icon_img = image.logo.amulet_logo.bitmap(64, 64) icon = wx.StaticBitmap(self, wx.ID_ANY, icon_img, (0, 0), (64, 64)) icon2 = wx.StaticBitmap(self, wx.ID_ANY, icon_img, (0, 0), (64, 64)) icon2.Bind( wx.EVT_LEFT_DOWN, lambda evt: wx.lib.inspection.InspectionTool().Show() ) name_sizer.Add(icon, flag=wx.CENTER) self._amulet_name = wx.StaticText(self) self._amulet_name.SetFont(wx.Font(40, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) name_sizer.Add( self._amulet_name, flag=wx.CENTER | wx.LEFT | wx.RIGHT, border=10 ) name_sizer.Add(icon2, flag=wx.CENTER) button_font = wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL) self._open_world_button = wx.Button(self, size=(400, 70)) self._open_world_button.SetFont(button_font) self._open_world_button.Bind( wx.EVT_BUTTON, lambda _: open_level_from_dialog(self) ) sizer.Add(self._open_world_button, 0, wx.ALL | wx.CENTER, 5) self._user_manual_button = wx.Button(self, size=(400, 70)) self._user_manual_button.SetFont(button_font) self._user_manual_button.Bind(wx.EVT_BUTTON, self._documentation) sizer.Add(self._user_manual_button, 0, wx.ALL | wx.CENTER, 5) self._bug_tracker_button = wx.Button(self, size=(400, 70)) self._bug_tracker_button.SetFont(button_font) self._bug_tracker_button.Bind(wx.EVT_BUTTON, self._bugs) sizer.Add(self._bug_tracker_button, 0, wx.ALL | wx.CENTER, 5) self._discord_button = wx.Button(self, size=(400, 70)) self._discord_button.SetFont(button_font) self._discord_button.Bind(wx.EVT_BUTTON, self._discord) sizer.Add(self._discord_button, 0, wx.ALL | wx.CENTER, 5) sizer.AddStretchSpacer(2) sponsor_header = wx.BoxSizer(wx.HORIZONTAL) self._sponsor_label = wx.StaticText(self) self._sponsor_link = wx.adv.HyperlinkCtrl( self, url="https://github.com/sponsors/Amulet-Team" ) sponsor_header.AddStretchSpacer(1) sponsor_header.Add(self._sponsor_label) sponsor_header.AddSpacer(10) sponsor_header.Add(self._sponsor_link) sponsor_header.AddStretchSpacer(1) sizer.Add(sponsor_header, 0, wx.EXPAND, 0) sponsor_sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(sponsor_sizer, 1, wx.EXPAND, 0) pathway_bitmap = image.logo.pathway_logo.bitmap(300, 130) pathway_button = wx.StaticBitmap( self, wx.ID_ANY, pathway_bitmap, (0, 0), (300, 130) ) pathway_button.Bind(wx.EVT_LEFT_DOWN, self._pathway) sponsor_sizer.Add(pathway_button, 0, wx.EXPAND, 0) try: with urlopen( "https://raw.githubusercontent.com/Amulet-Team/sponsors/main/sponsors.json" ) as f: sponsors = json.load(f) except Exception: pass else: github_sponsor_text = wx.TextCtrl( self, value=" ".join(sponsors), style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_CENTRE | wx.BORDER_NONE, size=wx.Size(-1, 150), ) github_sponsor_text.SetBackgroundColour(self.GetBackgroundColour()) sponsor_sizer.Add(github_sponsor_text, 1) self._load_strings() def _load_strings(self): self._amulet_name.SetLabel(lang.get("meta.amulet")) self._open_world_button.SetLabel(lang.get("main_menu.open_world")) self._user_manual_button.SetLabel(lang.get("main_menu.user_manual")) self._user_manual_button.SetToolTip(lang.get("app.browser_open_tooltip")) self._bug_tracker_button.SetLabel(lang.get("main_menu.bug_tracker")) self._bug_tracker_button.SetToolTip(lang.get("app.browser_open_tooltip")) self._discord_button.SetLabel(lang.get("main_menu.discord")) self._discord_button.SetToolTip(lang.get("app.browser_open_tooltip")) self._sponsor_label.SetLabel(lang.get("main_menu.our_sponsors")) self._sponsor_link.SetLabel(lang.get("main_menu.sponsor_link")) @staticmethod def _documentation(_): webbrowser.open( "https://github.com/Amulet-Team/Amulet-Map-Editor/blob/master/amulet_map_editor/readme.md" ) @staticmethod def _bugs(_): webbrowser.open( "https://github.com/Amulet-Team/Amulet-Map-Editor/issues?q=is%3Aissue" ) @staticmethod def _discord(_): webbrowser.open("https://www.amuletmc.com/discord") @staticmethod def _pathway(_): webbrowser.open("https://www.pathway.studio/") def enable(self): self.GetTopLevelParent().create_menu() def _select_language(self, evt): dialog = LangSelectDialog(self) if dialog.ShowModal() == wx.ID_OK: lang.set_language(dialog.get_language()) dialog.Destroy() self._load_strings() class LangSelectDialog(wx.Dialog): def __init__(self, *args, **kwds): # begin wxGlade: LangSelectDialog.__init__ kwds["style"] = ( kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER ) wx.Dialog.__init__(self, *args, **kwds) self.SetTitle(lang.get("language_select.title")) sizer_1 = wx.BoxSizer(wx.VERTICAL) self._label = wx.StaticText(self, label=lang.get("language_select.help")) sizer_1.Add(self._label, 0, wx.ALIGN_CENTER) self.hyperlink_1 = wx.adv.HyperlinkCtrl( self, wx.ID_ANY, lang.get("language_select.contribute"), "https://github.com/Amulet-Team/Amulet-Map-Editor#contributing", ) sizer_1.Add(self.hyperlink_1, 0, wx.ALIGN_CENTER) self._lang_list_box = wx.ListBox(self, choices=lang.get_languages()) self._lang_list_box.SetSelection( self._lang_list_box.FindString(lang.get_language()) ) sizer_1.Add(self._lang_list_box, 1, wx.EXPAND, 0) sizer_2 = wx.StdDialogButtonSizer() sizer_1.Add(sizer_2, 0, wx.ALIGN_RIGHT | wx.ALL, 4) self._button_ok = wx.Button(self, wx.ID_OK, "") self._button_ok.SetDefault() sizer_2.AddButton(self._button_ok) self._button_cancel = wx.Button(self, wx.ID_CANCEL, "") sizer_2.AddButton(self._button_cancel) sizer_2.Realize() self.SetSizer(sizer_1) sizer_1.Fit(self) self.SetAffirmativeId(self._button_ok.GetId()) self.SetEscapeId(self._button_cancel.GetId()) self.Layout() def get_language(self): return self._lang_list_box.GetStringSelection()
Amulet-Map-Editor
amulet_map_editor\api\framework\pages\world_page.py
import threading import wx from typing import List, Tuple, Type, Union, Optional import traceback import importlib import pkgutil import logging from amulet.api.errors import LoaderNoneMatched from amulet import load_level from amulet_map_editor import programs, lang from amulet_map_editor.api.datatypes import MenuData from amulet_map_editor.api.framework import app from amulet_map_editor.api.framework.pages import BasePageUI from amulet_map_editor.api.framework.programs import BaseProgram, AboutProgram from amulet_map_editor.api.wx.ui.traceback_dialog import TracebackDialog _extensions: List[Tuple[str, Type[BaseProgram]]] = [] _fixed_extensions: List[Tuple[str, Type[BaseProgram]]] = [ (lang.get("program_about.tab_name"), AboutProgram) ] log = logging.getLogger(__name__) def load_extensions(): if not _extensions: _extensions.extend(_fixed_extensions) extensions = [] for _, module_name, _ in pkgutil.iter_modules( programs.__path__, f"{programs.__name__}." ): extensions.append(load_extension(module_name)) _extensions.extend( sorted((ext for ext in extensions if ext is not None), key=lambda x: x[0]) ) def load_extension( module_name: str, ) -> Optional[Tuple[str, Union[Type[BaseProgram], Type[wx.Window]]]]: # load module and confirm that all required attributes are defined try: module = importlib.import_module(module_name) except ImportError: log.warning(f"Failed to import {module_name}.\n{traceback.format_exc()}") else: if hasattr(module, "export"): export = getattr(module, "export") if isinstance(export, dict): ui = export.get("ui", None) name = export.get("name", None) if ( isinstance(name, str) and issubclass(ui, BaseProgram) and issubclass(ui, wx.Window) ): return name, ui class WorldPageUI(wx.Notebook, BasePageUI): def __init__(self, parent: wx.Window, path: str): super().__init__(parent, style=wx.NB_LEFT) self._path = path try: self.world = load_level(path) except LoaderNoneMatched as e: self.Destroy() raise e self.world_name = self.world.level_wrapper.level_name self._load_extensions() self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self._page_changing, self) self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self._page_changed, self) def GetPage(self, page) -> BaseProgram: wx_page = super().GetPage(page) if not isinstance(wx_page, BaseProgram): raise Exception("GetPage did not return BaseProgram instance.") return wx_page @property def path(self) -> str: return self._path def menu(self, menu: MenuData) -> MenuData: menu.setdefault(lang.get("menu_bar.file.menu_name"), {}).setdefault( "exit", {} ).setdefault( lang.get("menu_bar.file.close_world"), lambda evt: app.close_level(self.path), ) return self.GetPage(self.GetSelection()).menu(menu) def _load_extensions(self): """Load and create instances of each of the extensions""" load_extensions() select = True for extension_name, extension in _extensions: try: ext = extension(self, self.world) self.AddPage(ext, extension_name, select) select = False except Exception as e: log.exception( f"Failed to load extension {extension_name}\n{e}\n{traceback.format_exc()}" ) continue def can_close(self) -> bool: """Check if all extensions are safe to be closed""" return all( self.GetPage(page).can_close() for page in range(self.GetPageCount()) ) def close(self): """ Close the world and destroy the UI Check can_close before running this """ for page in range(self.GetPageCount()): self.GetPage(page).close() # close the world in a new thread thread = threading.Thread(target=self.world.close) thread.start() # sleep a little thread.join(0.1) if thread.is_alive(): # if not closed yet open a dialog to warn the user. # We do this on a delay so that it does not flick up for a split second dialog = wx.ProgressDialog( "Closing World", "Please be patient. This may take a little while.", maximum=100, style=wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME | wx.PD_AUTO_HIDE, ) dialog.Fit() dialog.Update(99) # wait until the world is closed then close the dialog while thread.is_alive(): wx.GetApp().Yield() thread.join(0.1) dialog.Destroy() def _page_changing(self, evt: wx.BookCtrlEvent): """Method to fire when the page is changing.""" if ( self.GetSelection() != wx.NOT_FOUND and not self.GetPage(self.GetSelection()).can_disable() ): evt.Veto() def _page_changed(self, evt: wx.BookCtrlEvent): """Method to fire when the page has changed.""" self._disable_page(evt.GetOldSelection()) self._enable_page(evt.GetSelection()) def _disable_page(self, page: Optional[int] = None): """Disable a page. Defaults to the current page.""" page = self.GetSelection() if page is None else page if page != wx.NOT_FOUND: try: self.GetPage(page).disable() except Exception as e: log.critical(traceback.format_exc()) # raise e def _enable_page(self, page: Optional[int] = None): """Enable a page. Defaults to the current page.""" page = self.GetSelection() if page is None else page if page != wx.NOT_FOUND: try: self.GetPage(page).enable() self.GetTopLevelParent().create_menu() except Exception as e: log.critical(traceback.format_exc()) dialog = TracebackDialog( self, "Exception loading sub-program", str(e), traceback.format_exc(), ) dialog.ShowModal() dialog.Destroy() self.DeletePage(page) def can_disable(self) -> bool: return ( self.GetSelection() == wx.NOT_FOUND or self.GetPage(self.GetSelection()).can_disable() ) def disable(self): """Disable all containers in the world page""" self._disable_page() def enable(self): """Enable the world page""" self._enable_page()
Amulet-Map-Editor
amulet_map_editor\api\framework\pages\__init__.py
from .base_page import BasePageUI from .main_menu import AmuletMainMenu from .world_page import WorldPageUI
Amulet-Map-Editor
amulet_map_editor\api\framework\programs\about_program.py
import wx from typing import TYPE_CHECKING from amulet_map_editor.api import lang from amulet_map_editor.api.framework import app from amulet_map_editor.api.wx.ui.simple import SimplePanel from amulet_map_editor.api.wx.ui.select_world import WorldUI from amulet_map_editor.api.framework.programs import BaseProgram if TYPE_CHECKING: from amulet.api.level import BaseLevel class AboutProgram(SimplePanel, BaseProgram): def __init__(self, container, world: "BaseLevel"): SimplePanel.__init__(self, container) self.world = world self._close_world_button = wx.Button( self, wx.ID_ANY, label=lang.get("world.close_world") ) self._close_world_button.Bind(wx.EVT_BUTTON, self._close_world) self.add_object(self._close_world_button, 0, wx.ALL | wx.CENTER) self.add_object( wx.StaticText( self, label=lang.get("program_about.currently_opened_world"), ), 0, wx.ALL | wx.CENTER, ) self.add_object(WorldUI(self, self.world.level_wrapper), 0, wx.ALL | wx.CENTER) self.add_object( wx.StaticText( self, label=f"{lang.get('program_about.choose_from_options')}\n<=================", ), 0, wx.ALL | wx.CENTER, ) def _close_world(self, evt): app.close_level(self.world.level_path)
Amulet-Map-Editor
amulet_map_editor\api\framework\programs\base_program.py
import wx from amulet.api.level import BaseLevel from amulet_map_editor.api.datatypes import MenuData from amulet_map_editor.api.framework.base_tab import BaseTab class BaseProgram(BaseTab): def __init__(self, container: wx.Window, world: BaseLevel): pass def menu(self, menu: MenuData) -> MenuData: return menu
Amulet-Map-Editor
amulet_map_editor\api\framework\programs\__init__.py
from .base_program import BaseProgram from .about_program import AboutProgram
Amulet-Map-Editor
amulet_map_editor\api\opengl\camera\camera.py
import numpy from typing import Optional, Tuple, List from enum import Enum import wx from wx import glcanvas import math from ..canvas_container import CanvasContainer from ..data_types import CameraLocationType, CameraRotationType from ..matrix import ( rotation_matrix_yx, perspective_matrix, displacement_matrix, orthographic_matrix, TransformationMatrixType, ) class Projection(Enum): TOP_DOWN = 0 PERSPECTIVE = 1 _CameraMoveChangeEventType = wx.NewEventType() EVT_CAMERA_MOVED = wx.PyEventBinder(_CameraMoveChangeEventType) class CameraMovedEvent(wx.PyEvent): """Run when the camera has moved or rotated.""" def __init__( self, camera_location: CameraLocationType, camera_rotation: CameraRotationType ): wx.PyEvent.__init__(self, eventType=_CameraMoveChangeEventType) self._location = camera_location self._rotation = camera_rotation @property def camera_location(self) -> CameraLocationType: """The location of the camera. (x, y, z)""" return self._location @property def camera_rotation(self) -> CameraRotationType: """The rotation of the camera. (yaw, pitch). This should behave the same as how Minecraft handles it. """ return self._rotation _ProjectionChangeEventType = wx.NewEventType() EVT_PROJECTION_CHANGED = wx.PyEventBinder(_ProjectionChangeEventType) class ProjectionChangedEvent(wx.PyEvent): """Run when the projection of the camera has changed.""" def __init__(self, projection: Projection): wx.PyEvent.__init__(self, eventType=_ProjectionChangeEventType) self._projection = projection @property def projection(self) -> Projection: """The location of the camera. (x, y, z)""" return self._projection class Camera(CanvasContainer): """A class to hold the state information of the camera.""" _bounds: Tuple[Tuple[float, float, float], Tuple[float, float, float]] _location: CameraLocationType _rotation: CameraRotationType _projection_mode: Projection _fov: List[float] _clipping: List[Tuple[float, float]] _aspect_ratio: float _projection_matrix: Optional[TransformationMatrixType] _transformation_matrix: Optional[TransformationMatrixType] __slots__ = ( "_bounds", "_location", "_rotation", "_projection_mode", "_fov", "_clipping", "_aspect_ratio", "_projection_matrix", "_transformation_matrix", ) def __init__(self, canvas: glcanvas.GLCanvas): super().__init__(canvas) self._bounds = ( (-1_000_000_000, -1_000_000_000, -1_000_000_000), (1_000_000_000, 1_000_000_000, 1_000_000_000), ) self._location = (0.0, 0.0, 0.0) self._rotation = (0.0, 0.0) self._projection_mode = Projection.PERSPECTIVE self._fov = [100.0, 70.0] self._clipping = [ (-(10**5), 10**5), (0.1, 10000.0), ] self._aspect_ratio = 4 / 3 self._projection_matrix = None self._transformation_matrix = None def _reset_matrix(self): self._projection_matrix = None self._transformation_matrix = None def _notify_moved(self): """Post a CameraMovedEvent""" wx.PostEvent(self.canvas, CameraMovedEvent(self.location, self.rotation)) @property def projection_mode(self) -> Projection: return self._projection_mode @projection_mode.setter def projection_mode(self, projection_mode: Projection): assert ( projection_mode in Projection ), f"{projection_mode} is not a valid projection." if self._projection_mode != projection_mode: self._projection_mode = projection_mode self._reset_matrix() wx.PostEvent(self.canvas, ProjectionChangedEvent(self.projection_mode)) @property def location(self) -> CameraLocationType: """The location of the camera. (x, y, z)""" return self._location @location.setter def location(self, camera_location: CameraLocationType): """Set the location of the camera. (x, y, z). Generates EVT_CAMERA_MOVED on the parent canvas.""" if self.set_location(camera_location): self._notify_moved() def set_location(self, camera_location: CameraLocationType) -> bool: """Set the location of the camera. (x, y, z).""" assert ( len(camera_location) == 3 ), "camera_location must be an iterable of three floats." camera_location = tuple( min(max(float(c), c_min), c_max) for c, c_min, c_max in zip(camera_location, *self._bounds) ) if camera_location != self._location: self._reset_matrix() self._location = camera_location return True return False @property def rotation(self) -> CameraRotationType: """The rotation of the camera. (yaw, pitch). This should behave the same as how Minecraft handles it. """ return self._rotation @rotation.setter def rotation(self, camera_rotation: CameraRotationType): """Set the rotation of the camera. (yaw, pitch). yaw (-180 to 180), pitch (-90 to 90) This should behave the same as how Minecraft handles it. Generates EVT_CAMERA_MOVED on the parent canvas.""" if self.set_rotation(camera_rotation): self._notify_moved() def set_rotation(self, camera_rotation: CameraRotationType) -> bool: """Set the rotation of the camera. (yaw, pitch). yaw (-180 to 180), pitch (-90 to 90) This should behave the same as how Minecraft handles it.""" assert ( len(camera_rotation) == 2 ), "camera_rotation must be an iterable of two floats." ry, rx = map(float, camera_rotation) if not -180 <= ry < 180: ry %= 360 if ry >= 180: ry -= 360 if not -90 <= rx <= 90: rx = max(min(rx, 90), -90) camera_rotation = (ry, rx) if camera_rotation != self._rotation: self._reset_matrix() self._rotation = camera_rotation return True return False @property def location_rotation(self) -> Tuple[CameraLocationType, CameraRotationType]: """Get the camera location and rotation in one property.""" return self.location, self.rotation @location_rotation.setter def location_rotation( self, location_rotation: Tuple[CameraLocationType, CameraRotationType] ): """Set the camera location and rotation in one property. Generates EVT_CAMERA_MOVED on the parent canvas.""" location, rotation = location_rotation moved = self.set_location(location) rotated = self.set_rotation(rotation) if moved or rotated: self._notify_moved() def _set_fov(self, mode: Projection, fov: float): self._fov[mode.value] = float(fov) self._reset_matrix() @property def fov(self) -> float: """The field of view of the camera. The value will vary based on the projection mode.""" return self._fov[self.projection_mode.value] @fov.setter def fov(self, fov: float): """Set the field of view of the camera. The value will vary based on the projection mode.""" self._set_fov(self.projection_mode, fov) @property def perspective_fov(self) -> float: """The field of view of the camera in degrees when in perspective mode.""" return self._fov[Projection.PERSPECTIVE.value] @perspective_fov.setter def perspective_fov(self, fov: float): """Set the field of view of the camera in degrees when in perspective mode.""" self._set_fov(Projection.PERSPECTIVE, fov) @property def orthographic_fov(self) -> float: """The field of view of the camera when in orthographic mode.""" return self._fov[Projection.TOP_DOWN.value] @orthographic_fov.setter def orthographic_fov(self, fov: float): """Set the field of view of the camera when in orthographic mode.""" self._set_fov(Projection.TOP_DOWN, fov) def _set_clipping(self, mode: Projection, clipping: Tuple[float, float]): assert len(clipping) == 2, "camera_rotation must be an iterable of two floats." self._clipping[mode.value] = tuple(map(float, clipping)) self._reset_matrix() @property def perspective_clipping(self) -> Tuple[float, float]: """The near and far clipping distance when in perspective mode.""" return self._clipping[Projection.PERSPECTIVE.value] @perspective_clipping.setter def perspective_clipping(self, clipping: Tuple[float, float]): """Set the near and far clipping distance when in perspective mode.""" self._set_clipping(Projection.PERSPECTIVE, clipping) @property def orthographic_clipping(self) -> Tuple[float, float]: """The near and far clipping distance when in orthographic mode.""" return self._clipping[Projection.TOP_DOWN.value] @orthographic_clipping.setter def orthographic_clipping(self, clipping: Tuple[float, float]): """Set the near and far clipping distance when in orthographic mode.""" self._set_clipping(Projection.TOP_DOWN, clipping) @property def aspect_ratio(self) -> float: """The aspect ratio of the camera (width/weight)""" return self._aspect_ratio @aspect_ratio.setter def aspect_ratio(self, aspect_ratio: float): """Set the aspect ratio of the camera (width/weight)""" self._aspect_ratio = float(aspect_ratio) self._reset_matrix() @staticmethod def rotation_matrix(yaw, pitch) -> TransformationMatrixType: """Helper function to get a rotation matrix for yaw and pitch. :param yaw: Yaw in degrees. :param pitch: Pitch in degrees. :return: A 4x4 rotation matrix. """ return rotation_matrix_yx(math.radians(yaw + 180), math.radians(pitch)) @property def camera_matrix(self) -> TransformationMatrixType: """The matrix to convert world space to camera space.""" return numpy.matmul( self.rotation_matrix(*self.rotation), displacement_matrix(*-numpy.array(self.location)), ) @property def projection_matrix(self) -> TransformationMatrixType: """The matrix to convert camera space to screen space.""" if self._projection_matrix is None: if self.projection_mode == Projection.TOP_DOWN: self._projection_matrix = self.orthographic_matrix else: self._projection_matrix = self.perspective_matrix self._projection_matrix.flags.writeable = False return self._projection_matrix @property def orthographic_matrix(self) -> TransformationMatrixType: """The orthographic matrix to convert camera space to screen space.""" near, far = self._clipping[self.projection_mode.value] return orthographic_matrix(self.fov, self.aspect_ratio, near, far) @property def perspective_matrix(self) -> TransformationMatrixType: """The perspective matrix to convert camera space to screen space.""" z_near, z_far = self._clipping[self.projection_mode.value] return perspective_matrix( math.radians(self.fov), self.aspect_ratio, z_near, z_far ) @property def transformation_matrix(self) -> TransformationMatrixType: """The world to projection matrix.""" # camera translation if self._transformation_matrix is None: self._transformation_matrix = numpy.matmul( self.projection_matrix, self.camera_matrix ) self._transformation_matrix.flags.writeable = False return self._transformation_matrix
Amulet-Map-Editor
amulet_map_editor\api\opengl\camera\controllable_camera.py
import wx from wx import glcanvas from .camera import Camera _SpeedChangedEventType = wx.NewEventType() EVT_SPEED_CHANGED = wx.PyEventBinder(_SpeedChangedEventType) class SpeedChangedEvent(wx.PyEvent): """Run when the speed of the camera has changed.""" def __init__(self, speed: float): wx.PyEvent.__init__(self, eventType=_SpeedChangedEventType) self._speed = speed @property def speed(self) -> float: """The speed of the camera.""" return self._speed class ControllableCamera(Camera): """A slight modification to the default camera to add speed attributes.""" __slots__ = ("_move_speed", "_rotate_speed") def __init__(self, canvas: glcanvas.GLCanvas): super().__init__(canvas) self._move_speed = 2.0 self._rotate_speed = 2.0 self._rotating = False @property def move_speed(self) -> float: """The speed that the camera moves at.""" return self._move_speed @move_speed.setter def move_speed(self, val: float): """Set the speed that the camera moves at.""" self._move_speed = float(val) wx.PostEvent(self.canvas, SpeedChangedEvent(self.move_speed)) @property def rotate_speed(self) -> float: """The speed that the camera rotates at.""" return self._rotate_speed @rotate_speed.setter def rotate_speed(self, val: float): """Set the speed that the camera rotates at.""" self._rotate_speed = float(val) @property def rotating(self): """Is the camera rotating (True) or fixed (False)""" return self._rotating @rotating.setter def rotating(self, rotating: bool): """Set if the camera is rotating (True) or fixed (False)""" self._rotating = bool(rotating) self._notify_moved()
Amulet-Map-Editor
amulet_map_editor\api\opengl\camera\__init__.py
from .camera import ( Camera, CameraMovedEvent, EVT_CAMERA_MOVED, ProjectionChangedEvent, EVT_PROJECTION_CHANGED, Projection, ) from .controllable_camera import ( ControllableCamera, EVT_SPEED_CHANGED, SpeedChangedEvent, )
Amulet-Map-Editor
amulet_map_editor\api\opengl\canvas\canvas.py
from typing import Optional, Callable import logging import wx from wx.glcanvas import GLCanvas, GLAttributes, GLContext, GLContextAttrs from OpenGL.GL import ( GL_DEPTH_TEST, glEnable, GL_CULL_FACE, glDepthFunc, GL_LEQUAL, GL_BLEND, glBlendFunc, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, glGetString, GL_VERSION, ) from OpenGL.GL.ARB.explicit_attrib_location import glInitExplicitAttribLocationARB log = logging.getLogger(__name__) """OpenGL workflow: The initialisation function should be as minimal as possible. No OpenGL functions should be called here. The OpenGL state is not valid until the window is first shown. You can implement functions that take a while in threads to not block the GUI but they must still not contain OpenGL functions. Upon the window being shown the OpenGL context is activated and the state can be set in _init_opengl Objects that need to bind textures or data should do so in the draw function so they can be sure the context is set. """ class BaseCanvas(GLCanvas): _context: Optional[GLContext] def __init__(self, parent: wx.Window): """ Construct the canvas. No OpenGL interaction should be done here. OpenGL initialisation should be done in _init_opengl which is run after the window is first shown. """ display_attributes = GLAttributes() display_attributes.PlatformDefaults().MinRGBA(8, 8, 8, 8).DoubleBuffer().Depth( 24 ).EndList() super().__init__( parent, display_attributes, size=parent.GetClientSize(), style=wx.WANTS_CHARS, ) # Amulet-Team/Amulet-Map-Editor#84 # Amulet-Team/Amulet-Map-Editor#597 # Amulet-Team/Amulet-Map-Editor#856 def gl3() -> Optional[GLContext]: ctx_attrs = GLContextAttrs() ctx_attrs.PlatformDefaults() ctx_attrs.OGLVersion(3, 3) ctx_attrs.CoreProfile() ctx_attrs.EndList() ctx = GLContext(self, ctxAttrs=ctx_attrs) if ctx.IsOK(): return ctx return None def gl2() -> Optional[GLContext]: ctx_attrs = GLContextAttrs() ctx_attrs.PlatformDefaults() ctx_attrs.OGLVersion(2, 1) ctx_attrs.CompatibilityProfile() ctx_attrs.EndList() ctx = GLContext(self, ctxAttrs=ctx_attrs) if ctx.IsOK() and glInitExplicitAttribLocationARB(): return ctx return None context_constructors: list[Callable[[], Optional[GLContext]]] = [gl3, gl2] context = next((constructor() for constructor in context_constructors), None) if context is None: raise Exception(f"Failed setting up context") self._context = context self._init = False self.Bind(wx.EVT_SHOW, self._on_show) @property def context(self) -> GLContext: return self._context @property def context_identifier(self) -> str: # if not self._init: # raise Exception("Cannot access the context until the window has been shown.") return str(id(self._context)) def _on_show(self, evt: wx.ShowEvent): if not self._init and evt.IsShown(): self._init = True self._init_opengl() def _init_opengl(self): """Set up the OpenGL state after the window is first shown.""" self.SetCurrent(self._context) gl_version = glGetString(GL_VERSION) if isinstance(gl_version, bytes): gl_version = gl_version.decode("utf-8") log.info(f"OpenGL Version {gl_version}") glEnable(GL_DEPTH_TEST) glEnable(GL_CULL_FACE) glDepthFunc(GL_LEQUAL) glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
Amulet-Map-Editor
amulet_map_editor\api\opengl\canvas\event_canvas.py
import wx from typing import List, Tuple, Any import logging from amulet_map_editor.api.opengl.canvas import BaseCanvas log = logging.getLogger(__name__) class EventCanvas(BaseCanvas): """A modification of the normal canvas to make it easier to add and remove events.""" def __init__(self, parent: wx.Window): self._bound_events: List[Tuple[wx.PyEventBinder, Any, Any]] = [] super().__init__(parent) def reset_bound_events(self): """Unbind all events and re-bind the default events. We are allowing users to bind custom events so we should have a way to reset what is bound. """ self.tear_down_events() self.bind_events() def tear_down_events(self): """Unbind all events. We are allowing users to bind custom events so we should have a way to reset what is bound. """ for event, handler, source in self._bound_events: if source is None: while super().Unbind(event): pass else: if not self.Unbind(event, source, handler=handler): log.error(f"Failed to unbind {event}, {handler}, {source}") self._bound_events.clear() def bind_events(self): """Set up all events required to run. Note this will also bind subclass events.""" raise NotImplementedError def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): """Bind an event to the canvas.""" self._bound_events.append((event, handler, source)) super().Bind(event, handler, source, id, id2) def Unbind( self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY, handler=None ) -> bool: """Unbind an event from the canvas.""" key = (event, handler, source) if key in self._bound_events: self._bound_events.remove(key) return super().Unbind(event, source=source, id=id, id2=id2, handler=handler)
Amulet-Map-Editor
amulet_map_editor\api\opengl\canvas\__init__.py
from .canvas import BaseCanvas from .event_canvas import EventCanvas
Amulet-Map-Editor
amulet_map_editor\api\opengl\mesh\level_group.py
from typing import List, Optional, Tuple, Any import numpy from OpenGL.GL import ( glCullFace, GL_FRONT, GL_BACK, glGetIntegerv, GL_CULL_FACE_MODE, ) from amulet.api.level import BaseLevel from amulet.api.data_types import FloatTriplet, PointCoordinates, Dimension from amulet_map_editor.api.opengl import ( Drawable, ContextManager, ThreadedObjectContainer, ) from amulet_map_editor.api.opengl.mesh.level import RenderLevel from amulet_map_editor.api.opengl.matrix import ( transform_matrix, displacement_matrix, ) from amulet_map_editor.api.opengl.resource_pack import ( OpenGLResourcePackManager, OpenGLResourcePack, ) LocationType = PointCoordinates ScaleType = FloatTriplet RotationType = FloatTriplet TransformType = Tuple[LocationType, ScaleType, RotationType] class LevelGroup( OpenGLResourcePackManager, Drawable, ThreadedObjectContainer, ContextManager ): """A group of RenderLevel classes with transforms""" def __init__( self, context_identifier: Any, resource_pack: OpenGLResourcePack, ): OpenGLResourcePackManager.__init__(self, resource_pack) ThreadedObjectContainer.__init__(self) ContextManager.__init__(self, context_identifier) self._objects: List[RenderLevel] = [] self._transforms: List[TransformType] = [] self._world_translation: List[LocationType] = [] self._transformation_matrices: List[numpy.ndarray] = [] self._is_mirrored: List[bool] = [] self._active_level_index: Optional[int] = None self._camera_location: LocationType = (0.0, 100.0, 0.0) @property def active_level_index(self) -> Optional[int]: """The index of the active level. None if no level is active.""" return self._active_level_index @property def render_levels(self) -> Tuple[RenderLevel, ...]: return tuple(self._objects) @property def active_transform(self) -> TransformType: """Get the transform of the active level. If no level is selected will return zeros.""" if self._active_level_index is None: return (0, 0, 0), (0, 0, 0), (0, 0, 0) return self._transforms[self._active_level_index] @active_transform.setter def active_transform(self, location_scale_rotation: TransformType): """Set the transform for the active object. Has no effect if there is no active object. :param location_scale_rotation: The location, scale and rotation :return: """ if self._active_level_index is not None: location, scale, rotation = location_scale_rotation self._transforms[self._active_level_index] = (location, scale, rotation) self._is_mirrored[self._active_level_index] = bool( sum(1 for s in scale if s < 0) % 2 ) self._transformation_matrices[self._active_level_index] = numpy.matmul( transform_matrix(scale, rotation, location), displacement_matrix(*self._world_translation[self._active_level_index]), ) self._set_camera_location() def set_camera_location(self, x: float, y: float, z: float): """Set the location of the camera for each of the levels.""" self._camera_location = (x, y, z) self._set_camera_location() def _set_camera_location(self): for level, transform in zip(self._objects, self._transformation_matrices): try: level.camera_location = numpy.matmul( numpy.linalg.inv(transform), (*self._camera_location, 1) ).tolist()[:-1] except numpy.linalg.LinAlgError: pass def set_camera_rotation(self, yaw: float, pitch: float): """Set the rotation of the camera for each of the levels.""" for level in self._objects: level.camera_rotation = yaw, pitch def append( self, level: BaseLevel, dimension: Dimension, location: LocationType, scale: ScaleType, rotation: RotationType, ): """Append a level to the list and activate it.""" # TODO: update this to support multiple levels self.clear() render_level = RenderLevel( self.context_identifier, self._resource_pack, level, draw_box=True, limit_bounds=True, ) render_level.dimension = dimension # the level objects to be drawn self.register(render_level) # the transforms (tuple) applied by the user self._transforms.append((location, scale, rotation)) self._is_mirrored.append(bool(sum(1 for s in scale if s < 0) % 2)) self._world_translation.append( ( -( ( level.bounds(dimension).min_array + level.bounds(dimension).max_array ) // 2 ).astype(int) ).tolist() ) # the matrix of the transform applied by the user self._transformation_matrices.append( numpy.matmul( transform_matrix(scale, rotation, location), displacement_matrix(*self._world_translation[-1]), ) ) if self._active_level_index is None: self._active_level_index = 0 else: self._active_level_index += 1 def enable(self): """Enable chunk generation in a new thread.""" for level in self._objects: level.enable() def unload(self): """Unload the geometry. Frees VRAM.""" for level in self._objects: level.unload() def clear(self): """Destroy and unload all level objects.""" self.unload() for level in self._objects.copy(): self.unregister(level) self._transforms.clear() self._is_mirrored.clear() self._world_translation.clear() self._transformation_matrices.clear() self._active_level_index = None def run_garbage_collector(self): for level in self._objects: level.run_garbage_collector() def _rebuild(self): self.unload() def draw(self, camera_matrix: numpy.ndarray): """Draw all of the levels.""" for level, transform, is_mirrored in zip( self._objects, self._transformation_matrices, self._is_mirrored ): cull_state = glGetIntegerv(GL_CULL_FACE_MODE) if is_mirrored: glCullFace(GL_FRONT) else: glCullFace(GL_BACK) level.draw(numpy.matmul(camera_matrix, transform)) glCullFace(cull_state)
Amulet-Map-Editor
amulet_map_editor\api\opengl\mesh\sky_box.py
import numpy from minecraft_model_reader.api.mesh.block.cube import get_cube from .tri_mesh import TriMesh from amulet_map_editor.api.opengl.resource_pack import ( OpenGLResourcePackManager, OpenGLResourcePack, ) from amulet_map_editor.api.opengl.data_types import CameraLocationType from amulet_map_editor.api.opengl.matrix import displacement_matrix Radius = 2000 class SkyBox(TriMesh, OpenGLResourcePackManager): """A class to define the logic to generate geometry from a block array""" def __init__(self, context_identifier: str, resource_pack: OpenGLResourcePack): TriMesh.__init__(self, context_identifier, resource_pack) OpenGLResourcePackManager.__init__(self, resource_pack) self._camera_location: CameraLocationType = (0, 0, 0) self._rebuild() def _rebuild(self): model = get_cube( self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/down"), self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/up"), self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/north"), self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/west"), self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/south"), self.resource_pack.get_texture_path("amulet", "amulet_ui/cubemap/east"), bounds=((Radius, -Radius), (-Radius, Radius), (-Radius, Radius)), do_not_cull=(True,) * 6, ) verts = model.verts[None].reshape((-1, 3)) tverts = model.texture_coords[None].reshape((-1, 2)) faces = model.faces[None] # each slice in the first axis is a new block, each slice in the second is a new vertex vert_table = numpy.zeros((faces.size, self._vert_len), dtype=numpy.float32) vert_table[:, :3] = verts[faces] vert_table[:, 3:5] = tverts[faces] vert_index = 0 for texture_index in model.texture_index[None]: tex_bounds = self.resource_pack.texture_bounds( model.textures[texture_index] ) vert_table[vert_index : vert_index + 3, 5:9] = tex_bounds vert_index += 3 vert_table[:, 9:12] = model.tint_verts[None].reshape((-1, 3))[faces] self.verts = numpy.ravel(vert_table) self.draw_count = int(self.verts.size // self._vert_len) def set_camera_location(self, camera_location: CameraLocationType): self._camera_location = (numpy.asarray(camera_location)).tolist() def draw(self, transformation_matrix: numpy.ndarray): super().draw( numpy.matmul( transformation_matrix, displacement_matrix(*self._camera_location) ) )
Amulet-Map-Editor
amulet_map_editor\api\opengl\mesh\tri_mesh.py
import logging from OpenGL.GL import ( glBindTexture, GL_TEXTURE_2D, GL_TRIANGLES, glBindVertexArray, glBindBuffer, GL_ARRAY_BUFFER, GL_STATIC_DRAW, glUseProgram, glGetUniformLocation, glGenVertexArrays, glGenBuffers, glVertexAttribPointer, GL_FLOAT, GL_FALSE, glEnableVertexAttribArray, glBufferData, glDeleteBuffers, glDeleteVertexArrays, glUniformMatrix4fv, glUniform1i, glActiveTexture, GL_TEXTURE0, glDrawArrays, ) from OpenGL.error import GLError import ctypes import numpy from amulet_map_editor.api.opengl.shaders import get_shader from amulet_map_editor.api.opengl import Drawable, ContextManager from amulet_map_editor.api.opengl.resource_pack import ( OpenGLResourcePackManagerStatic, OpenGLResourcePack, ) log = logging.getLogger(__name__) class TriMesh(Drawable, OpenGLResourcePackManagerStatic, ContextManager): """The base class for a triangular face mesh. Implements the base logic to set up and unload OpenGL.""" _vertex_attrs = ( 3, # vertex attribute pointers 2, # texture coords attribute pointers 4, # texture coords attribute pointers 3, # tint value (also shading) ) _vert_len = sum(_vertex_attrs) def __init__(self, context_identifier: str, resource_pack: OpenGLResourcePack): """Create a new TriMesh. The object can be created from another thread so OpenGL variables cannot be set from here""" OpenGLResourcePackManagerStatic.__init__(self, resource_pack) ContextManager.__init__(self, context_identifier) self._vao = None # vertex array object self._vbo = None # vertex buffer object self._shader = None # the shader program self._transform_location = ( None # the reference within the shader program of the transformation matrix ) self._texture_location = None # the location of the texture in the shader self._texture = None self.verts = self.new_empty_verts() # the vertices to draw self.draw_start = 0 self.draw_count = 0 # the number of vertices to draw @staticmethod def new_empty_verts() -> numpy.ndarray: return numpy.zeros(0, dtype=numpy.float32) @property def vertex_usage(self): return GL_STATIC_DRAW @property def draw_mode(self): return GL_TRIANGLES @property def shader_name(self) -> str: return "render_chunk" def _setup(self): """Setup OpenGL attributes if required""" if self._vao is None: # if the opengl state has not been set self._texture = self.resource_pack.get_atlas_id(self.context_identifier) self._shader = get_shader(self.context_identifier, self.shader_name) glUseProgram(self._shader) self._transform_location = glGetUniformLocation( self._shader, "transformation_matrix" ) self._texture_location = glGetUniformLocation(self._shader, "image") self._vao = glGenVertexArrays(1) # create the array glBindVertexArray(self._vao) self._vbo = glGenBuffers(1) # and the buffer glBindBuffer(GL_ARRAY_BUFFER, self._vbo) self._setup_opengl_attrs() self._change_verts() glBindVertexArray(0) glBindBuffer(GL_ARRAY_BUFFER, 0) glUseProgram(0) def _setup_opengl_attrs(self): """Set up OpenGL vertex attributes""" attr_start = 0 for index, attr_count in enumerate(self._vertex_attrs): glVertexAttribPointer( index, attr_count, GL_FLOAT, GL_FALSE, self._vert_len * 4, ctypes.c_void_p(attr_start * 4), ) glEnableVertexAttribArray(index) attr_start += attr_count def change_verts(self, verts=None): """Modify the vertices in OpenGL.""" log.debug(f"change_verts {self}") try: glBindVertexArray(self._vao) glBindBuffer(GL_ARRAY_BUFFER, self._vbo) except GLError: # There seems to be errors randomly when binding the VBO log.debug( f"Failed binding the OpenGL state for {self}. Trying to reload it." ) self.unload() self._setup() if verts is None: return glBindVertexArray(self._vao) glBindBuffer(GL_ARRAY_BUFFER, self._vbo) self._change_verts(verts) glBindVertexArray(0) glBindBuffer(GL_ARRAY_BUFFER, 0) def _change_verts(self, verts=None): """Modify the vertices in OpenGL. Requires binding and unbinding.""" if verts is not None: glBufferData(GL_ARRAY_BUFFER, verts.size * 4, verts, self.vertex_usage) else: glBufferData( GL_ARRAY_BUFFER, self.verts.size * 4, self.verts, self.vertex_usage ) def unload(self): """Unload all opengl data""" log.debug(f"unload {self}") if self._vbo is not None: glDeleteBuffers(1, int(self._vbo)) self._vbo = None if self._vao is not None: glDeleteVertexArrays(1, int(self._vao)) self._vao = None def draw(self, transformation_matrix: numpy.ndarray): self._setup() self._draw(transformation_matrix) def _draw(self, transformation_matrix: numpy.ndarray): glUseProgram(self._shader) glUniformMatrix4fv( self._transform_location, 1, GL_FALSE, transformation_matrix.T.astype(numpy.float32), ) glUniform1i(self._texture_location, 0) try: glBindVertexArray(self._vao) except GLError: # There seems to be errors randomly when binding the VBO log.debug( f"Failed binding the OpenGL state for {self}. Trying to reload it." ) self.unload() self._setup() glBindVertexArray(self._vao) glActiveTexture(GL_TEXTURE0) glBindTexture(GL_TEXTURE_2D, self._texture) glDrawArrays(self.draw_mode, self.draw_start, self.draw_count) glBindVertexArray(0) glUseProgram(0)
Amulet-Map-Editor
amulet_map_editor\api\opengl\mesh\__init__.py
from amulet_map_editor.api.opengl.mesh.tri_mesh import TriMesh
Amulet-Map-Editor
amulet_map_editor\api\opengl\resource_pack\resource_pack.py
from OpenGL.GL import ( glBindTexture, GL_TEXTURE_2D, glTexImage2D, GL_RGBA, GL_UNSIGNED_BYTE, glGenTextures, glTexParameteri, GL_TEXTURE_MIN_FILTER, GL_NEAREST, GL_CLAMP_TO_EDGE, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, ) from typing import Generator, Any, Tuple, Dict, Optional import struct import hashlib import os import json from PIL import Image import numpy import glob import logging from minecraft_model_reader.api.resource_pack.base import BaseResourcePackManager from minecraft_model_reader import BlockMesh import PyMCTranslate from amulet.api.block import Block from amulet_map_editor.api.opengl import textureatlas log = logging.getLogger(__name__) class OpenGLResourcePack: """This class will take a minecraft_model_reader resource pack and load all of the textures into a texture atlas.""" _translator: PyMCTranslate.Version _block_models: Dict[Block, BlockMesh] _texture_bounds: Dict[Any, Tuple[float, float, float, float]] _image: Optional[numpy.ndarray] _image_width: int _image_height: int _gl_textures: Dict[str, int] def __init__( self, resource_pack: BaseResourcePackManager, translator: PyMCTranslate.Version ): self._resource_pack = resource_pack self._translator = translator self._block_models: Dict[Block, BlockMesh] = {} self._texture_bounds: Dict[str, Tuple[float, float, float, float]] = {} self._image: Optional[Image.Image] = None self._image_width: int = 0 self._image_height: int = 0 self._gl_textures: Dict[str, int] = {} def get_atlas_id(self, context_id: str) -> int: """Get the opengl texture id of the atlas for a given context.""" if context_id not in self._gl_textures: if self._image is None: raise Exception( "OpenGLResourcePack.setup() needs to be run before accessing a texture." ) self._setup_texture(context_id) return self._gl_textures[context_id] def get_texture_path(self, namespace: Optional[str], relative_path: str): """Get the absolute path of the image from the relative components. Useful for getting the id of textures for hard coded textures not connected to a resource pack. """ return self._resource_pack.get_texture_path(namespace, relative_path) def texture_bounds(self, texture_path: str) -> Tuple[float, float, float, float]: """Get the bounding box of a given texture path.""" if texture_path in self._texture_bounds: return self._texture_bounds[texture_path] else: return self._texture_bounds[self._resource_pack.missing_no] @property def translator(self) -> PyMCTranslate.Version: """The translator used to convert the universal blocks into the required version for the resource pack.""" return self._translator def setup(self) -> Generator[float, None, None]: """Create and bind the atlas texture.""" if self._image is None: cache_id = struct.unpack( "H", hashlib.sha1( "".join(self._resource_pack.pack_paths).encode("utf-8") ).digest()[:2], )[0] atlas: Image.Image if not self._resource_pack.pack_paths: log.warning("There are no resource packs to load.") mod_time = max( ( os.stat(path).st_mtime for pack in self._resource_pack.pack_paths for path in glob.glob( os.path.join(glob.escape(pack), "**", "*.*"), recursive=True ) ), default=0, ) cache_dir = os.path.join(os.environ["CACHE_DIR"], "resource_packs", "atlas") img_path = os.path.join(cache_dir, f"{cache_id}.png") bounds_path = os.path.join(cache_dir, f"{cache_id}.json") try: with open(bounds_path) as f: cache_mod_time, bounds = json.load(f) if mod_time != cache_mod_time: raise Exception( "The resource packs have changed since last merging." ) atlas = Image.open(img_path) except: atlas_iter = textureatlas.create_atlas_iter( self._resource_pack.textures ) try: while True: yield next(atlas_iter) except StopIteration as e: ( atlas, bounds, ) = e.value os.makedirs(cache_dir, exist_ok=True) atlas.save(img_path) with open(bounds_path, "w") as f: json.dump((mod_time, bounds), f) self._image_width, self._image_height = atlas.size self._image = numpy.array(atlas, numpy.uint8).ravel() self._texture_bounds = bounds def _setup_texture(self, context_id: str): """Set up the texture for a given context""" gl_texture = self._gl_textures[context_id] = glGenTextures( 1 ) # Create the texture location glBindTexture(GL_TEXTURE_2D, gl_texture) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE) glBindTexture(GL_TEXTURE_2D, gl_texture) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, self._image_width, self._image_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, self._image, ) glBindTexture(GL_TEXTURE_2D, 0) log.info("Finished setting up texture atlas in OpenGL") def get_block_model(self, universal_block: Block) -> BlockMesh: """Get the BlockMesh class for a given universal Block. The Block will be translated to the version format using the previously specified translator.""" if universal_block not in self._block_models: version_block = self._translator.block.from_universal( universal_block.base_block )[0] if universal_block.extra_blocks: for block_ in universal_block.extra_blocks: version_block += self._translator.block.from_universal(block_)[0] self._block_models[universal_block] = self._resource_pack.get_block_model( version_block ) return self._block_models[universal_block]