├── .github
└── workflows
│ └── deploy.yml
├── .gitignore
├── LICENSE
├── README-zh_cn.md
├── README.md
├── data
├── lang
│ ├── en_us.yml
│ └── zh_cn.yml
├── meta.yml
├── phase
│ ├── 1.12.2.yml
│ ├── 1.13.2.yml
│ ├── 1.14.4.yml
│ ├── 1.16.5.yml
│ ├── 1.17.1.yml
│ ├── 1.17.yml
│ ├── 1.19.3.yml
│ └── 1.19.yml
└── phase_data.yml
└── scripts
├── LICENSE
├── constant.py
├── gen.py
├── requirements.txt
├── translation.py
├── tree.py
└── utils.py
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Pages
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | paths:
8 | - ".github/**"
9 | - "data/**"
10 | - "scripts/**"
11 |
12 | jobs:
13 | update:
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - uses: actions/checkout@v4
18 | - uses: actions/setup-python@v5
19 | with:
20 | python-version: '3.11'
21 | - uses: actions/cache@v4
22 | with:
23 | path: ~/.cache/pip
24 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
25 | restore-keys: |
26 | ${{ runner.os }}-pip-:
27 |
28 | - name: Prepare runtime
29 | run: |
30 | cd ./scripts
31 | pip install -r requirements.txt
32 |
33 | - name: Generate output
34 | run: |
35 | git config --global user.name 'github-actions[bot]'
36 | git config --global user.email 'github-actions[bot]@users.noreply.github.com'
37 | cd ./scripts
38 | python gen.py
39 |
40 | - name: Deploy pages
41 | uses: s0/git-publish-subdir-action@develop
42 | env:
43 | REPO: self
44 | BRANCH: page
45 | FOLDER: output/page
46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 | SQUASH_HISTORY: false
48 | SKIP_EMPTY_COMMITS: true
49 |
50 | - name: Push diffs
51 | run: |
52 | cd ./output/diff
53 | for lang in en_us zh_cn
54 | do
55 | cd $lang
56 | git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
57 | git push origin master:diff/$lang --force
58 | cd ..
59 | done
60 |
61 | - uses: actions/upload-artifact@v4
62 | with:
63 | name: output
64 | path: output/
65 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea/
2 | /output/
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Attribution-NonCommercial-ShareAlike 4.0 International
2 |
3 | =======================================================================
4 |
5 | Creative Commons Corporation ("Creative Commons") is not a law firm and
6 | does not provide legal services or legal advice. Distribution of
7 | Creative Commons public licenses does not create a lawyer-client or
8 | other relationship. Creative Commons makes its licenses and related
9 | information available on an "as-is" basis. Creative Commons gives no
10 | warranties regarding its licenses, any material licensed under their
11 | terms and conditions, or any related information. Creative Commons
12 | disclaims all liability for damages resulting from their use to the
13 | fullest extent possible.
14 |
15 | Using Creative Commons Public Licenses
16 |
17 | Creative Commons public licenses provide a standard set of terms and
18 | conditions that creators and other rights holders may use to share
19 | original works of authorship and other material subject to copyright
20 | and certain other rights specified in the public license below. The
21 | following considerations are for informational purposes only, are not
22 | exhaustive, and do not form part of our licenses.
23 |
24 | Considerations for licensors: Our public licenses are
25 | intended for use by those authorized to give the public
26 | permission to use material in ways otherwise restricted by
27 | copyright and certain other rights. Our licenses are
28 | irrevocable. Licensors should read and understand the terms
29 | and conditions of the license they choose before applying it.
30 | Licensors should also secure all rights necessary before
31 | applying our licenses so that the public can reuse the
32 | material as expected. Licensors should clearly mark any
33 | material not subject to the license. This includes other CC-
34 | licensed material, or material used under an exception or
35 | limitation to copyright. More considerations for licensors:
36 | wiki.creativecommons.org/Considerations_for_licensors
37 |
38 | Considerations for the public: By using one of our public
39 | licenses, a licensor grants the public permission to use the
40 | licensed material under specified terms and conditions. If
41 | the licensor's permission is not necessary for any reason--for
42 | example, because of any applicable exception or limitation to
43 | copyright--then that use is not regulated by the license. Our
44 | licenses grant only permissions under copyright and certain
45 | other rights that a licensor has authority to grant. Use of
46 | the licensed material may still be restricted for other
47 | reasons, including because others have copyright or other
48 | rights in the material. A licensor may make special requests,
49 | such as asking that all changes be marked or described.
50 | Although not required by our licenses, you are encouraged to
51 | respect those requests where reasonable. More considerations
52 | for the public:
53 | wiki.creativecommons.org/Considerations_for_licensees
54 |
55 | =======================================================================
56 |
57 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
58 | Public License
59 |
60 | By exercising the Licensed Rights (defined below), You accept and agree
61 | to be bound by the terms and conditions of this Creative Commons
62 | Attribution-NonCommercial-ShareAlike 4.0 International Public License
63 | ("Public License"). To the extent this Public License may be
64 | interpreted as a contract, You are granted the Licensed Rights in
65 | consideration of Your acceptance of these terms and conditions, and the
66 | Licensor grants You such rights in consideration of benefits the
67 | Licensor receives from making the Licensed Material available under
68 | these terms and conditions.
69 |
70 |
71 | Section 1 -- Definitions.
72 |
73 | a. Adapted Material means material subject to Copyright and Similar
74 | Rights that is derived from or based upon the Licensed Material
75 | and in which the Licensed Material is translated, altered,
76 | arranged, transformed, or otherwise modified in a manner requiring
77 | permission under the Copyright and Similar Rights held by the
78 | Licensor. For purposes of this Public License, where the Licensed
79 | Material is a musical work, performance, or sound recording,
80 | Adapted Material is always produced where the Licensed Material is
81 | synched in timed relation with a moving image.
82 |
83 | b. Adapter's License means the license You apply to Your Copyright
84 | and Similar Rights in Your contributions to Adapted Material in
85 | accordance with the terms and conditions of this Public License.
86 |
87 | c. BY-NC-SA Compatible License means a license listed at
88 | creativecommons.org/compatiblelicenses, approved by Creative
89 | Commons as essentially the equivalent of this Public License.
90 |
91 | d. Copyright and Similar Rights means copyright and/or similar rights
92 | closely related to copyright including, without limitation,
93 | performance, broadcast, sound recording, and Sui Generis Database
94 | Rights, without regard to how the rights are labeled or
95 | categorized. For purposes of this Public License, the rights
96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar
97 | Rights.
98 |
99 | e. Effective Technological Measures means those measures that, in the
100 | absence of proper authority, may not be circumvented under laws
101 | fulfilling obligations under Article 11 of the WIPO Copyright
102 | Treaty adopted on December 20, 1996, and/or similar international
103 | agreements.
104 |
105 | f. Exceptions and Limitations means fair use, fair dealing, and/or
106 | any other exception or limitation to Copyright and Similar Rights
107 | that applies to Your use of the Licensed Material.
108 |
109 | g. License Elements means the license attributes listed in the name
110 | of a Creative Commons Public License. The License Elements of this
111 | Public License are Attribution, NonCommercial, and ShareAlike.
112 |
113 | h. Licensed Material means the artistic or literary work, database,
114 | or other material to which the Licensor applied this Public
115 | License.
116 |
117 | i. Licensed Rights means the rights granted to You subject to the
118 | terms and conditions of this Public License, which are limited to
119 | all Copyright and Similar Rights that apply to Your use of the
120 | Licensed Material and that the Licensor has authority to license.
121 |
122 | j. Licensor means the individual(s) or entity(ies) granting rights
123 | under this Public License.
124 |
125 | k. NonCommercial means not primarily intended for or directed towards
126 | commercial advantage or monetary compensation. For purposes of
127 | this Public License, the exchange of the Licensed Material for
128 | other material subject to Copyright and Similar Rights by digital
129 | file-sharing or similar means is NonCommercial provided there is
130 | no payment of monetary compensation in connection with the
131 | exchange.
132 |
133 | l. Share means to provide material to the public by any means or
134 | process that requires permission under the Licensed Rights, such
135 | as reproduction, public display, public performance, distribution,
136 | dissemination, communication, or importation, and to make material
137 | available to the public including in ways that members of the
138 | public may access the material from a place and at a time
139 | individually chosen by them.
140 |
141 | m. Sui Generis Database Rights means rights other than copyright
142 | resulting from Directive 96/9/EC of the European Parliament and of
143 | the Council of 11 March 1996 on the legal protection of databases,
144 | as amended and/or succeeded, as well as other essentially
145 | equivalent rights anywhere in the world.
146 |
147 | n. You means the individual or entity exercising the Licensed Rights
148 | under this Public License. Your has a corresponding meaning.
149 |
150 |
151 | Section 2 -- Scope.
152 |
153 | a. License grant.
154 |
155 | 1. Subject to the terms and conditions of this Public License,
156 | the Licensor hereby grants You a worldwide, royalty-free,
157 | non-sublicensable, non-exclusive, irrevocable license to
158 | exercise the Licensed Rights in the Licensed Material to:
159 |
160 | a. reproduce and Share the Licensed Material, in whole or
161 | in part, for NonCommercial purposes only; and
162 |
163 | b. produce, reproduce, and Share Adapted Material for
164 | NonCommercial purposes only.
165 |
166 | 2. Exceptions and Limitations. For the avoidance of doubt, where
167 | Exceptions and Limitations apply to Your use, this Public
168 | License does not apply, and You do not need to comply with
169 | its terms and conditions.
170 |
171 | 3. Term. The term of this Public License is specified in Section
172 | 6(a).
173 |
174 | 4. Media and formats; technical modifications allowed. The
175 | Licensor authorizes You to exercise the Licensed Rights in
176 | all media and formats whether now known or hereafter created,
177 | and to make technical modifications necessary to do so. The
178 | Licensor waives and/or agrees not to assert any right or
179 | authority to forbid You from making technical modifications
180 | necessary to exercise the Licensed Rights, including
181 | technical modifications necessary to circumvent Effective
182 | Technological Measures. For purposes of this Public License,
183 | simply making modifications authorized by this Section 2(a)
184 | (4) never produces Adapted Material.
185 |
186 | 5. Downstream recipients.
187 |
188 | a. Offer from the Licensor -- Licensed Material. Every
189 | recipient of the Licensed Material automatically
190 | receives an offer from the Licensor to exercise the
191 | Licensed Rights under the terms and conditions of this
192 | Public License.
193 |
194 | b. Additional offer from the Licensor -- Adapted Material.
195 | Every recipient of Adapted Material from You
196 | automatically receives an offer from the Licensor to
197 | exercise the Licensed Rights in the Adapted Material
198 | under the conditions of the Adapter's License You apply.
199 |
200 | c. No downstream restrictions. You may not offer or impose
201 | any additional or different terms or conditions on, or
202 | apply any Effective Technological Measures to, the
203 | Licensed Material if doing so restricts exercise of the
204 | Licensed Rights by any recipient of the Licensed
205 | Material.
206 |
207 | 6. No endorsement. Nothing in this Public License constitutes or
208 | may be construed as permission to assert or imply that You
209 | are, or that Your use of the Licensed Material is, connected
210 | with, or sponsored, endorsed, or granted official status by,
211 | the Licensor or others designated to receive attribution as
212 | provided in Section 3(a)(1)(A)(i).
213 |
214 | b. Other rights.
215 |
216 | 1. Moral rights, such as the right of integrity, are not
217 | licensed under this Public License, nor are publicity,
218 | privacy, and/or other similar personality rights; however, to
219 | the extent possible, the Licensor waives and/or agrees not to
220 | assert any such rights held by the Licensor to the limited
221 | extent necessary to allow You to exercise the Licensed
222 | Rights, but not otherwise.
223 |
224 | 2. Patent and trademark rights are not licensed under this
225 | Public License.
226 |
227 | 3. To the extent possible, the Licensor waives any right to
228 | collect royalties from You for the exercise of the Licensed
229 | Rights, whether directly or through a collecting society
230 | under any voluntary or waivable statutory or compulsory
231 | licensing scheme. In all other cases the Licensor expressly
232 | reserves any right to collect such royalties, including when
233 | the Licensed Material is used other than for NonCommercial
234 | purposes.
235 |
236 |
237 | Section 3 -- License Conditions.
238 |
239 | Your exercise of the Licensed Rights is expressly made subject to the
240 | following conditions.
241 |
242 | a. Attribution.
243 |
244 | 1. If You Share the Licensed Material (including in modified
245 | form), You must:
246 |
247 | a. retain the following if it is supplied by the Licensor
248 | with the Licensed Material:
249 |
250 | i. identification of the creator(s) of the Licensed
251 | Material and any others designated to receive
252 | attribution, in any reasonable manner requested by
253 | the Licensor (including by pseudonym if
254 | designated);
255 |
256 | ii. a copyright notice;
257 |
258 | iii. a notice that refers to this Public License;
259 |
260 | iv. a notice that refers to the disclaimer of
261 | warranties;
262 |
263 | v. a URI or hyperlink to the Licensed Material to the
264 | extent reasonably practicable;
265 |
266 | b. indicate if You modified the Licensed Material and
267 | retain an indication of any previous modifications; and
268 |
269 | c. indicate the Licensed Material is licensed under this
270 | Public License, and include the text of, or the URI or
271 | hyperlink to, this Public License.
272 |
273 | 2. You may satisfy the conditions in Section 3(a)(1) in any
274 | reasonable manner based on the medium, means, and context in
275 | which You Share the Licensed Material. For example, it may be
276 | reasonable to satisfy the conditions by providing a URI or
277 | hyperlink to a resource that includes the required
278 | information.
279 | 3. If requested by the Licensor, You must remove any of the
280 | information required by Section 3(a)(1)(A) to the extent
281 | reasonably practicable.
282 |
283 | b. ShareAlike.
284 |
285 | In addition to the conditions in Section 3(a), if You Share
286 | Adapted Material You produce, the following conditions also apply.
287 |
288 | 1. The Adapter's License You apply must be a Creative Commons
289 | license with the same License Elements, this version or
290 | later, or a BY-NC-SA Compatible License.
291 |
292 | 2. You must include the text of, or the URI or hyperlink to, the
293 | Adapter's License You apply. You may satisfy this condition
294 | in any reasonable manner based on the medium, means, and
295 | context in which You Share Adapted Material.
296 |
297 | 3. You may not offer or impose any additional or different terms
298 | or conditions on, or apply any Effective Technological
299 | Measures to, Adapted Material that restrict exercise of the
300 | rights granted under the Adapter's License You apply.
301 |
302 |
303 | Section 4 -- Sui Generis Database Rights.
304 |
305 | Where the Licensed Rights include Sui Generis Database Rights that
306 | apply to Your use of the Licensed Material:
307 |
308 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right
309 | to extract, reuse, reproduce, and Share all or a substantial
310 | portion of the contents of the database for NonCommercial purposes
311 | only;
312 |
313 | b. if You include all or a substantial portion of the database
314 | contents in a database in which You have Sui Generis Database
315 | Rights, then the database in which You have Sui Generis Database
316 | Rights (but not its individual contents) is Adapted Material,
317 | including for purposes of Section 3(b); and
318 |
319 | c. You must comply with the conditions in Section 3(a) if You Share
320 | all or a substantial portion of the contents of the database.
321 |
322 | For the avoidance of doubt, this Section 4 supplements and does not
323 | replace Your obligations under this Public License where the Licensed
324 | Rights include other Copyright and Similar Rights.
325 |
326 |
327 | Section 5 -- Disclaimer of Warranties and Limitation of Liability.
328 |
329 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
330 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
331 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
332 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
333 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
334 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
335 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
336 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
337 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
338 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
339 |
340 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
341 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
342 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
343 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
344 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
345 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
346 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
347 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
348 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
349 |
350 | c. The disclaimer of warranties and limitation of liability provided
351 | above shall be interpreted in a manner that, to the extent
352 | possible, most closely approximates an absolute disclaimer and
353 | waiver of all liability.
354 |
355 |
356 | Section 6 -- Term and Termination.
357 |
358 | a. This Public License applies for the term of the Copyright and
359 | Similar Rights licensed here. However, if You fail to comply with
360 | this Public License, then Your rights under this Public License
361 | terminate automatically.
362 |
363 | b. Where Your right to use the Licensed Material has terminated under
364 | Section 6(a), it reinstates:
365 |
366 | 1. automatically as of the date the violation is cured, provided
367 | it is cured within 30 days of Your discovery of the
368 | violation; or
369 |
370 | 2. upon express reinstatement by the Licensor.
371 |
372 | For the avoidance of doubt, this Section 6(b) does not affect any
373 | right the Licensor may have to seek remedies for Your violations
374 | of this Public License.
375 |
376 | c. For the avoidance of doubt, the Licensor may also offer the
377 | Licensed Material under separate terms or conditions or stop
378 | distributing the Licensed Material at any time; however, doing so
379 | will not terminate this Public License.
380 |
381 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
382 | License.
383 |
384 |
385 | Section 7 -- Other Terms and Conditions.
386 |
387 | a. The Licensor shall not be bound by any additional or different
388 | terms or conditions communicated by You unless expressly agreed.
389 |
390 | b. Any arrangements, understandings, or agreements regarding the
391 | Licensed Material not stated herein are separate from and
392 | independent of the terms and conditions of this Public License.
393 |
394 |
395 | Section 8 -- Interpretation.
396 |
397 | a. For the avoidance of doubt, this Public License does not, and
398 | shall not be interpreted to, reduce, limit, restrict, or impose
399 | conditions on any use of the Licensed Material that could lawfully
400 | be made without permission under this Public License.
401 |
402 | b. To the extent possible, if any provision of this Public License is
403 | deemed unenforceable, it shall be automatically reformed to the
404 | minimum extent necessary to make it enforceable. If the provision
405 | cannot be reformed, it shall be severed from this Public License
406 | without affecting the enforceability of the remaining terms and
407 | conditions.
408 |
409 | c. No term or condition of this Public License will be waived and no
410 | failure to comply consented to unless expressly agreed to by the
411 | Licensor.
412 |
413 | d. Nothing in this Public License constitutes or may be interpreted
414 | as a limitation upon, or waiver of, any privileges and immunities
415 | that apply to the Licensor or You, including from the legal
416 | processes of any jurisdiction or authority.
417 |
418 | =======================================================================
419 |
420 | Creative Commons is not a party to its public
421 | licenses. Notwithstanding, Creative Commons may elect to apply one of
422 | its public licenses to material it publishes and in those instances
423 | will be considered the “Licensor.” The text of the Creative Commons
424 | public licenses is dedicated to the public domain under the CC0 Public
425 | Domain Dedication. Except for the limited purpose of indicating that
426 | material is shared under a Creative Commons public license or as
427 | otherwise permitted by the Creative Commons policies published at
428 | creativecommons.org/policies, Creative Commons does not authorize the
429 | use of the trademark "Creative Commons" or any other trademark or logo
430 | of Creative Commons without its prior written consent including,
431 | without limitation, in connection with any unauthorized modifications
432 | to any of its public licenses or any other arrangements,
433 | understandings, or agreements concerning use of licensed material. For
434 | the avoidance of doubt, this paragraph does not form part of the
435 | public licenses.
436 |
437 | Creative Commons may be contacted at creativecommons.org.
438 |
--------------------------------------------------------------------------------
/README-zh_cn.md:
--------------------------------------------------------------------------------
1 | [English](README.md) | **中文**
2 |
3 | # Minecraft Game Phase
4 |
5 | [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]
6 |
7 | Minecraft 的游戏阶段列表,及其变更历史
8 |
9 | 查看具体内容:
10 |
11 | - [游戏阶段列表详情](https://github.com/Fallen-Breath/MinecraftGamePhase/blob/page/README-zh_cn.md) (也可在这查看:https://fallen-breath.github.io/MinecraftGamePhase/README-zh_cn.html)
12 | - [游戏阶段变更历史](https://github.com/Fallen-Breath/MinecraftTickPhase/commits/diff/zh_cn)
13 |
14 | 数据储存于 `data/` 文件夹中,内容通过 github action 生成至对应的分支中
15 |
16 | 如果你需要引用本仓库的内容,需注意以 `diff/` 为前缀的分支会在数据更新时被完全覆盖,不会留下任何提交历史,因此不建议从这些分支的内容中提取内容永链
17 |
18 | [![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
19 |
20 | [cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
21 | [cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
22 | [cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **English** | [中文](README-zh_cn.md)
2 |
3 | # Minecraft Game Phase
4 |
5 | [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]
6 |
7 | Minecraft game phase list and its history
8 |
9 | View contents:
10 |
11 | - [Game phases in detailed](https://github.com/Fallen-Breath/MinecraftGamePhase/blob/page/README.md) (Can also check it here: https://fallen-breath.github.io/MinecraftGamePhase/)
12 | - [Game phase history changes](https://github.com/Fallen-Breath/MinecraftTickPhase/commits/diff/en_us)
13 |
14 | Data are stored in `data/` folder. Contents are generated via github action and stored to corresponding branches
15 |
16 | If you need to reference the contents of this repository, you need to note that branches prefixed with `diff/` will be completely overwritten when the data is updated, leaving no commit history. Therefore, it is not recommended to pick git permalink of the contents in these branches.
17 |
18 | [![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
19 |
20 | [cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
21 | [cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
22 | [cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg
23 |
--------------------------------------------------------------------------------
/data/lang/en_us.yml:
--------------------------------------------------------------------------------
1 | _language_name: English
2 |
3 | phase:
4 | async_task:
5 | name: Async task
6 | detail: Executing async tasks
7 | auto_save:
8 | name: Auto save
9 | detail: Auto save
10 | block_change_sync:
11 | name: Block Change Sync
12 | detail: Sync changed blocks in the chunk to the client
13 | block_event:
14 | name: Block Event
15 | detail: Block events
16 | cat_spawning:
17 | name: Cat Spawning
18 | detail: Spawning cats in villages
19 | chunk_tick:
20 | name: Chunk Tick
21 | detail: Chunk Tick
22 | chunk_unload:
23 | name: Chunk Unload
24 | detail: Unloading chunks
25 | command_function:
26 | name: Command Function
27 | detail: Executes functions and datapacks
28 | console:
29 | name: Console
30 | detail: Handling console inputs
31 | dragon_fight:
32 | name: Dragon Fight
33 | detail: Dragon fight logic
34 | entity:
35 | name: Entity
36 | detail: Ticking entities
37 | entity_management:
38 | name: Entity Management
39 | detail: Load / Unload entities due to chunk load / unload
40 | entity_tracker:
41 | name: Entity Tracker
42 | detail: Sync entity updates to the client
43 | for_each_chunk:
44 | name: For each chunk
45 | detail: For each chunk has player nearby, do following logics
46 | for_each_world:
47 | name: For each world
48 | detail: For each world, do following logics
49 | game_event:
50 | name: Game Event
51 | detail: Emit enqueued game events
52 | game_loop:
53 | name: Game Loop
54 | detail: The main and the infinite loop
55 | ice_and_snow:
56 | name: Ice and Snow
57 | detail: Forming ice and snow
58 | light_logic:
59 | name: Light Logic
60 | detail: Light check and skylight recalculation
61 | natural_spawning:
62 | name: Natural Spawning
63 | detail: Natural mob spawning
64 | network:
65 | name: Network
66 | detail: Network system ticking
67 | patrol_spawning:
68 | name: Patrol Spawning
69 | detail: Spawning pillager patrols
70 | phantom_spawning:
71 | name: Phantom Spawning
72 | detail: Spawning phantoms
73 | player_action:
74 | name: Player Action
75 | detail: Handling player actions from packets from clients
76 | player_entity:
77 | name: Player Entity
78 | detail: Ticking entity logic of players
79 | player_check_light:
80 | name: Player Check Light
81 | detail: Random light level check nearby players
82 | player_chunk_map:
83 | name: Player Chunk Map
84 | detail: Player chunk map update
85 | portal_cache:
86 | name: Portal Cache
87 | detail: Timeout portal cache cleanup
88 | raid:
89 | name: Raid
90 | detail: Raid logics
91 | random_tick:
92 | name: Random Tick
93 | detail: Block and fluid random ticks
94 | sleeping:
95 | name: Sleeping
96 | detail: Player sleeping logic
97 | special_spawning:
98 | name: Special Spawning
99 | detail: Spawning special mobs
100 | thunder:
101 | name: Thunder
102 | detail: Lighting and skeleton trap spawning
103 | ticket:
104 | name: Ticket
105 | detail: Ticket System update
106 | tile_entity:
107 | name: Tile Entity
108 | detail: Ticking tile entities
109 | tile_tick:
110 | name: Tile Tick
111 | detail: Executing tile tick events, including block tile ticks and fluid tile ticks
112 | village:
113 | name: Village
114 | detail: Village logics
115 | wandering_trader_spawning:
116 | name: Wandering Trader Spawning
117 | detail: Spawning wandering traders
118 | weather:
119 | name: Weather
120 | detail: Update weather
121 | world_border:
122 | name: World Border
123 | detail: World border update
124 | world_time_sync:
125 | name: World Time Sync
126 | detail: Sync world time to client
127 | world_time_update:
128 | name: World Time Update
129 | detail: Update gametime and daytime of the world
130 | zombie_siege_spawning:
131 | name: Zombie Siege Spawning
132 | detail: Spawning zombie sieges
133 |
134 | page:
135 | readme:
136 | index: Index
137 | mc_version: Minecraft version
138 | applicable_version: Applicable versions
139 | title: Game phase for Minecraft {0}
140 | applicable_version: 'Applicable versions: {0}'
141 | phase_tree:
142 | simplified: Phase Tree (Simplified)
143 | full: Phase Tree (Full)
144 | phase_details: Phase Details
145 | code_reference:
146 | code_references: Code References
147 | mc_and_mapping: 'Minecraft {0}, {1} mapping'
148 | reference: Reference
149 | caller: Caller
150 |
--------------------------------------------------------------------------------
/data/lang/zh_cn.yml:
--------------------------------------------------------------------------------
1 | _language_name: 中文
2 |
3 | phase:
4 | async_task:
5 | name: 异步事件
6 | detail: 执行异步计划的事件
7 | auto_save:
8 | name: 自动保存
9 | detail: 自动保存
10 | block_change_sync:
11 | name: 方块变化同步
12 | detail: 向客户端同步区块中的方块变化
13 | block_event:
14 | name: 方块事件
15 | detail: 执行方块事件
16 | cat_spawning:
17 | name: 猫生成
18 | detail: 在村庄中生成猫
19 | chunk_tick:
20 | name: 区块刻
21 | detail: 区块刻
22 | chunk_unload:
23 | name: 区块卸载
24 | detail: 卸载区块
25 | command_function:
26 | name: 函数及数据包
27 | detail: 函数与数据包的指令
28 | console:
29 | name: 控制台
30 | detail: 处理控制台输入的指令
31 | dragon_fight:
32 | name: 龙战
33 | detail: 龙战逻辑
34 | entity:
35 | name: 实体
36 | detail: 运算实体
37 | entity_management:
38 | name: 实体管理
39 | detail: 加载/卸载那些因区块加载/卸载而增/删的实体
40 | entity_tracker:
41 | name: 实体追踪器
42 | detail: 向客户端同步实体状态更新
43 | for_each_chunk:
44 | name: 对于每一个区块
45 | detail: 对于每个附近有玩家的情况,执行其下逻辑
46 | for_each_world:
47 | name: 对于每一个维度
48 | detail: 对于每一个维度,执行其下逻辑
49 | game_event:
50 | name: 游戏事件
51 | detail: 发出积攒的游戏事件
52 | game_loop:
53 | name: 游戏循环
54 | detail: 无限执行的主循环
55 | ice_and_snow:
56 | name: 冰雪
57 | detail: 结冰、积雪
58 | light_logic:
59 | name: 光照逻辑
60 | detail: 亮度检查以及天空光重计算
61 | natural_spawning:
62 | name: 自然刷怪
63 | detail: 怪物自然生成
64 | network:
65 | name: 网络
66 | detail: 网络连接运算
67 | patrol_spawning:
68 | name: 灾厄巡逻队生成
69 | detail: 随机生成灾厄巡逻队
70 | phantom_spawning:
71 | name: 幻翼生成
72 | detail: 生成幻翼
73 | player_action:
74 | name: 玩家动作
75 | detail: 处理来自客户端数据包的玩家动作
76 | player_entity:
77 | name: 玩家实体
78 | detail: 运算玩家的实体相关逻辑
79 | player_check_light:
80 | name: 随机亮度更新
81 | detail: 发生在玩家附近的随机亮度更新
82 | player_chunk_map:
83 | name: 玩家加载区块图
84 | detail: 玩家加载区块图更新
85 | portal_cache:
86 | name: 地狱门缓存
87 | detail: 清理超时的地狱门缓存
88 | raid:
89 | name: 袭击
90 | detail: 袭击逻辑
91 | random_tick:
92 | name: 随机刻
93 | detail: 方块以及流体随机刻
94 | sleeping:
95 | name: 睡觉
96 | detail: 玩家睡觉逻辑
97 | special_spawning:
98 | name: 特殊生成
99 | detail: 特殊的生物生成逻辑
100 | thunder:
101 | name: 雷电
102 | detail: 生成雷电以及骷髅马陷阱
103 | ticket:
104 | name: 加载票
105 | detail: 加载票系统更新
106 | tile_entity:
107 | name: 方块实体
108 | detail: 运算方块实体
109 | tile_tick:
110 | name: 计划刻
111 | detail: 执行计划刻事件,包括方块计划刻以及流体计划刻
112 | village:
113 | name: 村庄
114 | detail: 村庄相关逻辑
115 | wandering_trader_spawning:
116 | name: 游商生成
117 | detail: 生成游商
118 | weather:
119 | name: 天气
120 | detail: 天气逻辑更新
121 | world_border:
122 | name: 世界边界
123 | detail: 更新世界边界
124 | world_time_sync:
125 | name: 同步世界时间
126 | detail: 向客户端同步世界时间
127 | world_time_update:
128 | name: 更新世界时间
129 | detail: 更新世界的 gametime 以及 daytime
130 | zombie_siege_spawning:
131 | name: 僵尸攻城生成
132 | detail: 生成僵尸攻城
133 |
134 | page:
135 | readme:
136 | index: 索引
137 | mc_version: Minecraft 版本
138 | applicable_version: 适用版本
139 | title: Minecraft {0} 游戏阶段
140 | applicable_version: '适用版本: {0}'
141 | phase_tree:
142 | simplified: 游戏阶段树 (精简)
143 | full: 游戏阶段树 (完整)
144 | phase_details: 游戏阶段详情
145 | code_reference:
146 | code_references: 代码参考
147 | mc_and_mapping: 'Minecraft {0}, {1} 反混淆表'
148 | reference: 代码位置
149 | caller: 主调函数
150 |
--------------------------------------------------------------------------------
/data/meta.yml:
--------------------------------------------------------------------------------
1 | languages:
2 | - en_us
3 | - zh_cn
4 |
5 | mc_version:
6 | '1.12.2': '1.12.x'
7 | '1.13.2': '1.13.x'
8 | '1.14.4': '1.14.x ~ 1.15.x'
9 | '1.16.5': '1.16.x'
10 | '1.17': '1.17'
11 | '1.17.1': '1.17.1 ~ 1.18.x'
12 | '1.19': '1.19 ~ 1.19.2'
13 | '1.19.3': '1.19.3 ~'
14 |
15 | important_phases:
16 | - auto_save
17 | - block_change_sync
18 | - block_event
19 | - chunk_tick
20 | - chunk_unload
21 | - entity
22 | - natural_spawning
23 | - player_action
24 | - player_entity
25 | - tile_entity
26 | - tile_tick
27 | - world_time_update
28 |
--------------------------------------------------------------------------------
/data/phase/1.12.2.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - async_task:
3 | - player_action
4 | - for_each_world:
5 | - world_time_sync
6 | - weather
7 | - sleeping
8 | - natural_spawning
9 | - chunk_unload
10 | - world_time_update
11 | - tile_tick
12 | - player_check_light
13 | - chunk_tick:
14 | - light_logic
15 | - thunder
16 | - ice_and_snow
17 | - random_tick
18 | - player_chunk_map:
19 | - block_change_sync
20 | - village
21 | - zombie_siege_spawning
22 | - portal_cache
23 | - block_event
24 | - dragon_fight
25 | - entity
26 | - tile_entity
27 | - entity_tracker
28 | - network:
29 | - player_entity
30 | - command_function
31 | - console
32 | - auto_save
33 |
--------------------------------------------------------------------------------
/data/phase/1.13.2.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - async_task:
3 | - player_action
4 | - command_function
5 | - for_each_world:
6 | - world_time_sync
7 | - world_border
8 | - weather
9 | - sleeping
10 | - natural_spawning
11 | - special_spawning:
12 | - phantom_spawning
13 | - chunk_unload
14 | - world_time_update
15 | - tile_tick
16 | - player_check_light
17 | - chunk_tick:
18 | - light_logic
19 | - thunder
20 | - ice_and_snow
21 | - random_tick
22 | - player_chunk_map:
23 | - block_change_sync
24 | - village
25 | - zombie_siege_spawning
26 | - portal_cache
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - entity_tracker
32 | - network:
33 | - player_entity
34 | - console
35 | - auto_save
36 |
--------------------------------------------------------------------------------
/data/phase/1.14.4.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - ticket
10 | - for_each_chunk:
11 | - block_change_sync
12 | - natural_spawning
13 | - chunk_tick:
14 | - thunder
15 | - ice_and_snow
16 | - random_tick
17 | - special_spawning:
18 | - phantom_spawning
19 | - patrol_spawning
20 | - cat_spawning
21 | - zombie_siege_spawning
22 | - entity_tracker
23 | - chunk_unload
24 | - tile_tick
25 | - raid
26 | - wandering_trader_spawning
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - network:
32 | - player_entity
33 | - console
34 | - auto_save
35 | - async_task:
36 | - player_action
37 |
--------------------------------------------------------------------------------
/data/phase/1.16.5.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - ticket
10 | - for_each_chunk:
11 | - block_change_sync
12 | - natural_spawning
13 | - chunk_tick:
14 | - thunder
15 | - ice_and_snow
16 | - random_tick
17 | - special_spawning:
18 | - phantom_spawning
19 | - patrol_spawning
20 | - cat_spawning
21 | - zombie_siege_spawning
22 | - wandering_trader_spawning
23 | - entity_tracker
24 | - chunk_unload
25 | - tile_tick
26 | - raid
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - network:
32 | - player_entity
33 | - console
34 | - auto_save
35 | - async_task:
36 | - player_action
37 |
--------------------------------------------------------------------------------
/data/phase/1.17.1.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - tile_tick
10 | - raid
11 | - ticket
12 | - for_each_chunk:
13 | - natural_spawning
14 | - chunk_tick:
15 | - thunder
16 | - ice_and_snow
17 | - random_tick
18 | - special_spawning:
19 | - phantom_spawning
20 | - patrol_spawning
21 | - cat_spawning
22 | - zombie_siege_spawning
23 | - wandering_trader_spawning
24 | - block_change_sync
25 | - entity_tracker
26 | - chunk_unload
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - entity_management
32 | - network:
33 | - player_entity
34 | - console
35 | - auto_save
36 | - async_task:
37 | - player_action
38 |
--------------------------------------------------------------------------------
/data/phase/1.17.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - ticket
10 | - for_each_chunk:
11 | - block_change_sync
12 | - natural_spawning
13 | - chunk_tick:
14 | - thunder
15 | - ice_and_snow
16 | - random_tick
17 | - special_spawning:
18 | - phantom_spawning
19 | - patrol_spawning
20 | - cat_spawning
21 | - zombie_siege_spawning
22 | - wandering_trader_spawning
23 | - entity_tracker
24 | - chunk_unload
25 | - tile_tick
26 | - raid
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - entity_management
32 | - network:
33 | - player_entity
34 | - console
35 | - auto_save
36 | - async_task:
37 | - player_action
38 |
--------------------------------------------------------------------------------
/data/phase/1.19.3.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - tile_tick
10 | - raid
11 | - ticket
12 | - for_each_chunk:
13 | - natural_spawning
14 | - chunk_tick:
15 | - thunder
16 | - ice_and_snow
17 | - random_tick
18 | - special_spawning:
19 | - phantom_spawning
20 | - patrol_spawning
21 | - cat_spawning
22 | - zombie_siege_spawning
23 | - wandering_trader_spawning
24 | - block_change_sync
25 | - entity_tracker
26 | - chunk_unload
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - entity_management
32 | - network:
33 | - player_entity
34 | - console
35 | - auto_save
36 | - async_task:
37 | - player_action
38 |
--------------------------------------------------------------------------------
/data/phase/1.19.yml:
--------------------------------------------------------------------------------
1 | game_loop:
2 | - command_function
3 | - for_each_world:
4 | - world_time_sync
5 | - world_border
6 | - weather
7 | - sleeping
8 | - world_time_update
9 | - tile_tick
10 | - raid
11 | - ticket
12 | - for_each_chunk:
13 | - natural_spawning
14 | - chunk_tick:
15 | - thunder
16 | - ice_and_snow
17 | - random_tick
18 | - special_spawning:
19 | - phantom_spawning
20 | - patrol_spawning
21 | - cat_spawning
22 | - zombie_siege_spawning
23 | - wandering_trader_spawning
24 | - block_change_sync
25 | - entity_tracker
26 | - chunk_unload
27 | - block_event
28 | - dragon_fight
29 | - entity
30 | - tile_entity
31 | - entity_management
32 | - game_event
33 | - network:
34 | - player_entity
35 | - console
36 | - auto_save
37 | - async_task:
38 | - player_action
39 |
--------------------------------------------------------------------------------
/data/phase_data.yml:
--------------------------------------------------------------------------------
1 | # TODO: create code references for all mc versions separately
2 | async_task:
3 | code_references:
4 | - mc_version: '1.19'
5 | mapping: mojmap
6 | reference: net.minecraft.server.MinecraftServer#waitUntilNextTick
7 | caller: net.minecraft.server.MinecraftServer#runServer
8 | auto_save:
9 | code_references:
10 | - mc_version: '1.19'
11 | mapping: mojmap
12 | reference: net.minecraft.server.MinecraftServer#saveEverything
13 | caller: net.minecraft.server.MinecraftServer#tickServer
14 | block_change_sync:
15 | code_references:
16 | - mc_version: '1.19'
17 | mapping: mojmap
18 | reference: net.minecraft.server.level.ChunkHolder#broadcastChanges
19 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
20 | block_event:
21 | code_references:
22 | - mc_version: '1.19'
23 | mapping: mojmap
24 | reference: net.minecraft.server.level.ServerLevel#runBlockEvents
25 | caller: net.minecraft.server.level.ServerLevel#tick
26 | cat_spawning:
27 | code_references:
28 | - mc_version: '1.19'
29 | mapping: mojmap
30 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
31 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
32 | chunk_tick:
33 | code_references:
34 | - mc_version: '1.19'
35 | mapping: mojmap
36 | reference: net.minecraft.server.level.ServerLevel#tickChunk
37 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
38 | chunk_unload:
39 | code_references:
40 | - mc_version: '1.19'
41 | mapping: mojmap
42 | reference: net.minecraft.server.level.ChunkMap#tick(java.util.function.BooleanSupplier)
43 | caller: net.minecraft.server.level.ServerChunkCache#tick
44 | command_function:
45 | code_references:
46 | - mc_version: '1.19'
47 | mapping: mojmap
48 | reference: net.minecraft.server.ServerFunctionManager#tick
49 | caller: net.minecraft.server.MinecraftServer#tickChildren
50 | console:
51 | code_references:
52 | - mc_version: '1.19'
53 | mapping: mojmap
54 | reference: net.minecraft.server.dedicated.DedicatedServer#handleConsoleInputs
55 | caller: net.minecraft.server.dedicated.DedicatedServer#tickChildren
56 | dragon_fight:
57 | code_references:
58 | - mc_version: '1.19'
59 | mapping: mojmap
60 | reference: net.minecraft.world.level.dimension.end.EndDragonFight#tick
61 | caller: net.minecraft.server.level.ServerLevel#tick
62 | entity:
63 | code_references:
64 | - mc_version: '1.19'
65 | mapping: mojmap
66 | reference: net.minecraft.world.level.Level#guardEntityTick
67 | caller: net.minecraft.server.level.ServerLevel#tick
68 | entity_management:
69 | code_references:
70 | - mc_version: '1.19'
71 | mapping: mojmap
72 | reference: net.minecraft.world.level.entity.PersistentEntitySectionManager#tick
73 | caller: net.minecraft.server.level.ServerLevel#tick
74 | entity_tracker:
75 | code_references:
76 | - mc_version: '1.19'
77 | mapping: mojmap
78 | reference: net.minecraft.server.level.ChunkMap#tick
79 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
80 | for_each_chunk:
81 | code_references:
82 | - mc_version: '1.19'
83 | mapping: mojmap
84 | reference: net.minecraft.server.level.ServerChunkCache#tickChunks
85 | for_each_world:
86 | code_references:
87 | - mc_version: '1.19'
88 | mapping: mojmap
89 | reference: net.minecraft.server.MinecraftServer#tickChildren
90 | game_event:
91 | code_references:
92 | - mc_version: '1.19'
93 | mapping: mojmap
94 | reference: net.minecraft.server.level.ServerLevel#sendGameEvents
95 | caller: net.minecraft.server.level.ServerLevel#tick
96 | game_loop:
97 | code_references:
98 | - mc_version: '1.19'
99 | mapping: mojmap
100 | reference: net.minecraft.server.MinecraftServer#runServer
101 | ice_and_snow:
102 | code_references:
103 | - mc_version: '1.19'
104 | mapping: mojmap
105 | reference: net.minecraft.server.level.ServerLevel#tickChunk
106 | light_logic:
107 | code_references:
108 | - mc_version: '1.13.2'
109 | mapping: mcp
110 | reference: net.minecraft.world.chunk.Chunk#enqueueRelightChecks
111 | caller: net.minecraft.world.WorldServer#tickBlocks
112 | natural_spawning:
113 | code_references:
114 | - mc_version: '1.19'
115 | mapping: mojmap
116 | reference: net.minecraft.world.level.NaturalSpawner#spawnForChunk
117 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
118 | network:
119 | code_references:
120 | - mc_version: '1.19'
121 | mapping: mojmap
122 | reference: net.minecraft.server.network.ServerConnectionListener#tick
123 | caller: net.minecraft.server.MinecraftServer#tickChildren
124 | patrol_spawning:
125 | code_references:
126 | - mc_version: '1.19'
127 | mapping: mojmap
128 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
129 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
130 | phantom_spawning:
131 | code_references:
132 | - mc_version: '1.19'
133 | mapping: mojmap
134 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
135 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
136 | player_action:
137 | code_references:
138 | - mc_version: '1.19'
139 | mapping: mojmap
140 | reference: net.minecraft.network.protocol.PacketUtils#ensureRunningOnSameThread
141 | player_entity:
142 | code_references:
143 | - mc_version: '1.19'
144 | mapping: mojmap
145 | reference: net.minecraft.server.network.ServerGamePacketListenerImpl#tick
146 | caller: net.minecraft.network.Connection#tick
147 | player_check_light:
148 | code_references:
149 | - mc_version: '1.13.2'
150 | mapping: mcp
151 | reference: net.minecraft.world.WorldServer#playerCheckLight
152 | caller: net.minecraft.world.WorldServer#tickBlocks
153 | player_chunk_map:
154 | code_references:
155 | - mc_version: '1.13.2'
156 | mapping: mcp
157 | reference: net.minecraft.server.management.PlayerChunkMap#tick
158 | caller: net.minecraft.world.WorldServer#tick
159 | portal_cache:
160 | code_references:
161 | - mc_version: '1.13.2'
162 | mapping: mcp
163 | reference: net.minecraft.world.Teleporter#tick
164 | caller: net.minecraft.world.WorldServer#tick
165 | raid:
166 | code_references:
167 | - mc_version: '1.19'
168 | mapping: mojmap
169 | reference: net.minecraft.world.entity.raid.Raids#tick
170 | caller: net.minecraft.server.level.ServerLevel#tick
171 | random_tick:
172 | code_references:
173 | - mc_version: '1.19'
174 | mapping: mojmap
175 | reference: net.minecraft.server.level.ServerLevel#tickChunk
176 | sleeping:
177 | code_references:
178 | - mc_version: '1.19'
179 | mapping: mojmap
180 | reference: net.minecraft.server.level.ServerLevel#wakeUpAllPlayers
181 | caller: net.minecraft.server.level.ServerLevel#tick
182 | special_spawning:
183 | code_references:
184 | - mc_version: '1.19'
185 | mapping: mojmap
186 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
187 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
188 | thunder:
189 | code_references:
190 | - mc_version: '1.19'
191 | mapping: mojmap
192 | reference: net.minecraft.server.level.ServerLevel#tickChunk
193 | ticket:
194 | code_references:
195 | - mc_version: '1.19'
196 | mapping: mojmap
197 | reference: net.minecraft.server.level.DistanceManager#purgeStaleTickets
198 | caller: net.minecraft.server.level.ServerChunkCache#tick
199 | tile_entity:
200 | code_references:
201 | - mc_version: '1.19'
202 | mapping: mojmap
203 | reference: net.minecraft.world.level.Level#tickBlockEntities
204 | caller: net.minecraft.server.level.ServerLevel#tick
205 | tile_tick:
206 | code_references:
207 | - mc_version: '1.19'
208 | mapping: mojmap
209 | reference: net.minecraft.world.ticks.LevelTicks#tick
210 | caller: net.minecraft.server.level.ServerLevel#tick
211 | village:
212 | code_references:
213 | - mc_version: '1.13.2'
214 | mapping: mcp
215 | reference: net.minecraft.village.VillageCollection#tick
216 | caller: net.minecraft.world.WorldServer#tick
217 | wandering_trader_spawning:
218 | code_references:
219 | - mc_version: '1.19'
220 | mapping: mojmap
221 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
222 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
223 | weather:
224 | code_references:
225 | - mc_version: '1.19'
226 | mapping: mojmap
227 | reference: net.minecraft.server.level.ServerLevel#advanceWeatherCycle
228 | caller: net.minecraft.server.level.ServerLevel#tick
229 | world_border:
230 | code_references:
231 | - mc_version: '1.19'
232 | mapping: mojmap
233 | reference: net.minecraft.world.level.border.WorldBorder#tick
234 | caller: net.minecraft.server.level.ServerLevel#tick
235 | world_time_sync:
236 | code_references:
237 | - mc_version: '1.19'
238 | mapping: mojmap
239 | reference: net.minecraft.network.protocol.game.ClientboundSetTimePacket
240 | caller: net.minecraft.server.MinecraftServer#tickChildren
241 | world_time_update:
242 | code_references:
243 | - mc_version: '1.19'
244 | mapping: mojmap
245 | reference: net.minecraft.server.level.ServerLevel#tickTime
246 | caller: net.minecraft.server.level.ServerLevel#tick
247 | zombie_siege_spawning:
248 | code_references:
249 | - mc_version: '1.13.2'
250 | mapping: mcp
251 | reference: net.minecraft.village.VillageSiege#tick
252 | caller: net.minecraft.world.WorldServer#tick
253 | - mc_version: '1.19'
254 | mapping: mojmap
255 | reference: net.minecraft.server.level.ServerLevel#tickCustomSpawners
256 | caller: net.minecraft.server.level.ServerChunkCache#tickChunks
257 |
--------------------------------------------------------------------------------
/scripts/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/scripts/constant.py:
--------------------------------------------------------------------------------
1 | from pathlib import Path
2 | from typing import List, NamedTuple
3 |
4 | import utils
5 |
6 | ROOT_DIR = Path(__file__).parent.parent
7 | DATA_DIR = ROOT_DIR / 'data'
8 | OUTPUT_DIR = ROOT_DIR / 'output'
9 | OUTPUT_PAGE_DIR = OUTPUT_DIR / 'page'
10 | OUTPUT_DIFF_DIR = OUTPUT_DIR / 'diff'
11 | assert DATA_DIR.is_dir()
12 |
13 | __meta = utils.load_yaml(DATA_DIR / 'meta.yml')
14 | LANGUAGES: List[str] = __meta['languages']
15 | DEFAULT_LANGUAGE: str = LANGUAGES[0]
16 | IMPORTANT_PHASES: List[str] = __meta['important_phases']
17 |
18 |
19 | class MCVersion(NamedTuple):
20 | name: str
21 | version_range: str
22 |
23 |
24 | MC_VERSIONS: List[MCVersion] = []
25 | for name, vr in __meta['mc_version'].items():
26 | MC_VERSIONS.append(MCVersion(name, vr))
27 |
--------------------------------------------------------------------------------
/scripts/gen.py:
--------------------------------------------------------------------------------
1 | import shutil
2 | from typing import Dict, IO, Optional
3 |
4 | from git import Repo
5 |
6 | import utils
7 | from constant import OUTPUT_DIR, DATA_DIR, MC_VERSIONS, LANGUAGES, MCVersion, OUTPUT_DIFF_DIR, OUTPUT_PAGE_DIR, IMPORTANT_PHASES
8 | from translation import language_context, tr, current_lang, get_lang_specified_file_name
9 | from tree import PhaseTree
10 |
11 | trees: Dict[MCVersion, PhaseTree] = {}
12 |
13 |
14 | class Text:
15 | def __init__(self, key: str, *args):
16 | self.key = key
17 | self.args = args
18 |
19 | def __str__(self) -> str:
20 | return tr('page.' + self.key, *self.args)
21 |
22 |
23 | def clean():
24 | if OUTPUT_DIR.exists():
25 | shutil.rmtree(OUTPUT_DIR)
26 | OUTPUT_DIR.mkdir()
27 | OUTPUT_PAGE_DIR.mkdir()
28 | OUTPUT_DIFF_DIR.mkdir()
29 |
30 |
31 | def load():
32 | for mcv in MC_VERSIONS:
33 | data = utils.load_yaml(DATA_DIR / 'phase' / '{}.yml'.format(mcv.name))
34 | trees[mcv] = PhaseTree.create(data)
35 |
36 |
37 | def write_nav_header(file_name: str, file: IO[str]):
38 | nav_list = []
39 | for lang in LANGUAGES:
40 | with language_context(lang):
41 | lang_name = tr('_language_name')
42 | if lang == current_lang():
43 | text = '**{}**'.format(lang_name)
44 | else:
45 | with language_context(lang):
46 | text = '[{}]({})'.format(lang_name, get_lang_specified_file_name(file_name))
47 | nav_list.append('{}'.format(text))
48 | file.write('{}\n'.format(' | '.join(nav_list)))
49 | file.write('\n')
50 |
51 |
52 | def write_tree(root: PhaseTree, file: IO[str], *, simplified: bool = False, draw_line: bool = True):
53 | file.write('```\n')
54 | if simplified:
55 | root = root.extract(lambda n: n.node_id in IMPORTANT_PHASES)
56 | assert root is not None
57 | root.print_tree(lambda s: file.write(s + '\n'), draw_line=draw_line)
58 | file.write('```\n')
59 | file.write('\n')
60 |
61 |
62 | def gen_page(mcv: MCVersion, file: IO[str]):
63 | file.write('# {}\n\n'.format(Text('title', mcv.name)))
64 | file.write('{}\n\n'.format(Text('applicable_version', mcv.version_range)))
65 |
66 | root = trees[mcv]
67 | file.write('## {}\n\n'.format(Text('phase_tree.simplified')))
68 | write_tree(root, file, simplified=True)
69 |
70 | file.write('## {}\n\n'.format(Text('phase_tree.full')))
71 | write_tree(root, file, simplified=False)
72 |
73 | file.write('## {}\n\n'.format(Text('phase_details')))
74 |
75 | def print_detail(node: PhaseTree):
76 | file.write('### {}\n\n'.format(node.name))
77 | file.write('{}\n\n'.format(node.detail))
78 |
79 | if code_references := node.data.get('code_references', []):
80 | file.write('**{}**\n\n'.format(Text('code_reference.code_references')))
81 | for cr in code_references:
82 |
83 | # FIXME: temp stupid workaround
84 | if mcv.name in ['1.12.2', '1.13.2']:
85 | if len(code_references) == 2 and cr['mc_version'] != '1.13.2':
86 | continue
87 | else:
88 | if cr['mc_version'] == '1.13.2':
89 | continue
90 |
91 | file.write('{}\n\n'.format(Text('code_reference.mc_and_mapping', cr['mc_version'], cr['mapping'])))
92 | file.write('- {}: `{}`\n'.format(Text('code_reference.reference'), cr['reference']))
93 | if cr.get('caller'):
94 | file.write('- {}: `{}`\n'.format(Text('code_reference.caller'), cr['caller']))
95 | file.write('\n')
96 |
97 | root.for_each(print_detail)
98 |
99 |
100 | def gen_readme(lang: str):
101 | file_name = get_lang_specified_file_name('README.md')
102 | with utils.write_file(OUTPUT_PAGE_DIR / file_name) as f:
103 | write_nav_header(file_name, f)
104 | f.write('# {}\n\n'.format(Text('readme.index')))
105 |
106 | f.write('| {} | {} |\n'.format(Text('readme.mc_version'), Text('readme.applicable_version')))
107 | f.write('| --- | --- |\n')
108 | for mcv in MC_VERSIONS:
109 | f.write('| {} | {} |\n'.format('[{}](./phases/{}-{}.md)'.format(mcv.name, mcv.name, lang), mcv.version_range))
110 | f.write('\n')
111 |
112 |
113 | def gen_pages():
114 | for lang in LANGUAGES:
115 | with language_context(lang):
116 | gen_readme(lang)
117 |
118 | for mcv in MC_VERSIONS:
119 | file_name = '{}-{}.md'.format(mcv.name, lang)
120 | with utils.write_file(OUTPUT_PAGE_DIR / 'phases' / file_name) as f:
121 | write_nav_header(file_name, f)
122 | gen_page(mcv, f)
123 |
124 |
125 | def gen_git():
126 | name_full = 'phases_full.md'
127 | name_simplified = 'phases_simplified.md'
128 | for lang in LANGUAGES:
129 | repo_path = OUTPUT_DIFF_DIR / lang
130 | with language_context(lang):
131 | repo = Repo.init(repo_path)
132 | prev: Optional[MCVersion] = None
133 | for mcv in MC_VERSIONS:
134 | with utils.write_file(repo_path / name_simplified) as f:
135 | write_tree(trees[mcv], f, simplified=True, draw_line=False)
136 | with utils.write_file(repo_path / name_full) as f:
137 | write_tree(trees[mcv], f, simplified=False, draw_line=False)
138 |
139 | message = 'Minecraft {0}\n\nCurrent version: {0} ({1})'.format(mcv.name, mcv.version_range)
140 | if prev is not None:
141 | message += '\nPrevious version: {} ({})'.format(prev.name, prev.version_range)
142 | repo.index.add([name_full, name_simplified])
143 | repo.index.commit(message)
144 |
145 | prev = mcv
146 |
147 |
148 | def main():
149 | clean()
150 | load()
151 | gen_pages()
152 | gen_git()
153 |
154 |
155 | if __name__ == '__main__':
156 | main()
157 |
--------------------------------------------------------------------------------
/scripts/requirements.txt:
--------------------------------------------------------------------------------
1 | ruamel.yaml
2 | gitpython
3 |
--------------------------------------------------------------------------------
/scripts/translation.py:
--------------------------------------------------------------------------------
1 | from contextlib import contextmanager
2 | from typing import Dict, Optional
3 |
4 | import utils
5 | from constant import LANGUAGES, DATA_DIR, DEFAULT_LANGUAGE
6 |
7 | __all__ = [
8 | 'language_context',
9 | 'current_lang',
10 | 'tr',
11 | ]
12 |
13 | # lang -> (key -> text)
14 | __translation_dict: Dict[str, Dict[str, str]] = {}
15 | __current_lang: str = DEFAULT_LANGUAGE
16 |
17 |
18 | def __load():
19 | for lang in LANGUAGES:
20 | yml = utils.load_yaml(DATA_DIR / 'lang' / (lang + '.yml'))
21 | translation = {}
22 | __build(translation, yml, '')
23 | __translation_dict[lang] = translation
24 |
25 |
26 | def __build(translation: Dict[str, str], obj: dict, path: str):
27 | for key, value in obj.items():
28 | full_key = key if len(path) == 0 else path + '.' + key
29 | if isinstance(value, str):
30 | translation[full_key] = value
31 | elif isinstance(value, dict):
32 | __build(translation, value, full_key)
33 | else:
34 | raise TypeError()
35 |
36 |
37 | @contextmanager
38 | def language_context(lang: str):
39 | global __current_lang
40 | prev_lang = __current_lang
41 | __current_lang = lang
42 | try:
43 | yield
44 | finally:
45 | __current_lang = prev_lang
46 |
47 |
48 | def current_lang() -> str:
49 | return __current_lang
50 |
51 |
52 | def __get(lang: str, key: str) -> Optional[str]:
53 | return __translation_dict.get(lang, {}).get(key)
54 |
55 |
56 | def tr(key: str, *args, **kwargs):
57 | text = __get(__current_lang, key) or key
58 | return text.format(*args, **kwargs)
59 |
60 |
61 | def get_lang_specified_file_name(name: str) -> str:
62 | base, extension = name.rsplit('.', 1)
63 | split = base.rsplit('-', 1)
64 | if len(split) == 2 and split[1] in LANGUAGES:
65 | base = split[0] # remove existed language suffix
66 | if current_lang() == DEFAULT_LANGUAGE and base.upper() == 'README':
67 | return '{}.{}'.format(base, extension)
68 | else:
69 | return '{}-{}.{}'.format(base, current_lang(), extension)
70 |
71 |
72 | __load()
73 |
--------------------------------------------------------------------------------
/scripts/tree.py:
--------------------------------------------------------------------------------
1 | import functools
2 | from typing import List, Any, Callable, Optional
3 |
4 | import utils
5 | from constant import DATA_DIR
6 | from translation import tr
7 |
8 | _WRITER = Callable[[str], Any]
9 |
10 |
11 | class PhaseTree:
12 | @classmethod
13 | @functools.lru_cache
14 | def __read_phase_data(cls) -> dict:
15 | return utils.load_yaml(DATA_DIR / 'phase_data.yml')
16 |
17 | def __init__(self, node_id: str):
18 | self.node_id: str = node_id
19 | self.children: List['PhaseTree'] = []
20 | self.parent: Optional['PhaseTree'] = None
21 | self.data: dict = self.__read_phase_data().get(node_id) or {}
22 |
23 | def __repr__(self):
24 | return 'PhaseTree[id={}]'.format(self.node_id)
25 |
26 | @property
27 | def is_root(self) -> bool:
28 | return self.parent is None
29 |
30 | @property
31 | def is_leaf(self) -> bool:
32 | return len(self.children) == 0
33 |
34 | @property
35 | def is_last_child(self) -> bool:
36 | return not self.is_root and len(self.parent.children) > 0 and self.parent.children[-1] is self
37 |
38 | @property
39 | def name(self) -> str:
40 | return tr('phase.{}.name'.format(self.node_id))
41 |
42 | @property
43 | def detail(self) -> str:
44 | return tr('phase.{}.detail'.format(self.node_id))
45 |
46 | @classmethod
47 | def create(cls, data) -> 'PhaseTree':
48 | if isinstance(data, str):
49 | node_id = data
50 | children = []
51 | elif isinstance(data, dict):
52 | assert len(data) == 1
53 | node_id, children = list(data.items())[0]
54 | else:
55 | raise TypeError()
56 | node = PhaseTree(node_id)
57 | for child in children:
58 | node.add_child(cls.create(child))
59 | return node
60 |
61 | def add_child(self, node: 'PhaseTree'):
62 | self.children.append(node)
63 | node.parent = self
64 |
65 | def for_each(self, consumer: Callable[['PhaseTree'], Any]):
66 | def traverse(node: PhaseTree):
67 | consumer(node)
68 | for child in node.children:
69 | traverse(child)
70 |
71 | traverse(self)
72 |
73 | def print_tree(self, writer: _WRITER, *, draw_line: bool = True):
74 | def get_item_line(node: PhaseTree) -> str:
75 | if not draw_line:
76 | return ' '
77 | if node.is_last_child:
78 | return '└── '
79 | return '├── '
80 |
81 | def get_parent_line(node: PhaseTree) -> str:
82 | if node.is_root:
83 | return ''
84 | if not draw_line or node.is_last_child:
85 | return ' '
86 | return '│ '
87 |
88 | def __print_tree(node, prefix: str):
89 | line = node.name
90 | if not node.is_root:
91 | line = get_item_line(node) + line
92 | writer(prefix + line)
93 |
94 | for child in node.children:
95 | __print_tree(child, prefix + get_parent_line(node))
96 |
97 | __print_tree(self, '')
98 |
99 | def extract(self, predicate: Callable[['PhaseTree'], bool]) -> Optional['PhaseTree']:
100 | node = PhaseTree(self.node_id)
101 | if self.is_leaf:
102 | if predicate(self):
103 | return node
104 | return None
105 |
106 | for child in self.children:
107 | c = child.extract(predicate)
108 | if c is not None:
109 | node.add_child(c)
110 |
111 | if len(node.children) > 1 or predicate(self):
112 | return node
113 | elif len(node.children) == 1: # remove useless chaining node
114 | return node.children[0]
115 | return None
116 |
--------------------------------------------------------------------------------
/scripts/utils.py:
--------------------------------------------------------------------------------
1 | from contextlib import contextmanager
2 | from os import PathLike
3 | from pathlib import Path
4 | from typing import Union, IO
5 |
6 | from ruamel.yaml import YAML
7 |
8 |
9 | def load_yaml(path: Union[str, PathLike]) -> dict:
10 | with open(path, 'r', encoding='utf8') as f:
11 | return YAML(typ='safe').load(f)
12 |
13 |
14 | @contextmanager
15 | def write_file(path: Union[str, PathLike]) -> IO[str]:
16 | if isinstance(path, str):
17 | path = Path(path)
18 | path.parent.mkdir(parents=True, exist_ok=True)
19 | with open(path, 'w', encoding='utf8') as f:
20 | yield f
21 |
--------------------------------------------------------------------------------